Bugfix: avoid an assertion in the netlist browser

Reason: when a circuit does not have pins and is top level,
but the reference has pins, the reference pins are regarded
to match against (nil). This case has to be reported properly,
otherwise the model can't be built consistently.
This commit is contained in:
Matthias Koefferlein 2019-07-02 00:01:11 +02:00
parent 1e49338fe9
commit f931b6a1c1
1 changed files with 11 additions and 1 deletions

View File

@ -2276,7 +2276,17 @@ NetlistComparer::compare_circuits (const db::Circuit *c1, const db::Circuit *c2,
// skip pin mapping in case one circuit does not feature pins
// This is often the case for top-level circuits. We don't necessarily need pins for them.
// We still report those circuits with "pin mismatch" so they don't get considered within
// subcircuits.
// subcircuits. Plus we report the pins so they get listed in the cross-ref (but with a
// "match" - this is important to cover the cases which are found when analyzing the nets).
if (mp_logger) {
for (db::Circuit::const_pin_iterator p = c1->begin_pins (); p != c1->end_pins (); ++p) {
mp_logger->match_pins (p.operator-> (), 0);
}
for (db::Circuit::const_pin_iterator p = c2->begin_pins (); p != c2->end_pins (); ++p) {
mp_logger->match_pins (0, p.operator-> ());
}
}
if (c1->pin_count () != c2->pin_count ()) {
pin_mismatch = true;