From f931b6a1c1d66e6831f524a3f6f7fb49fdadceff Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Tue, 2 Jul 2019 00:01:11 +0200 Subject: [PATCH] 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. --- src/db/db/dbNetlistCompare.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/db/db/dbNetlistCompare.cc b/src/db/db/dbNetlistCompare.cc index 5d94ea580..27326b0c0 100644 --- a/src/db/db/dbNetlistCompare.cc +++ b/src/db/db/dbNetlistCompare.cc @@ -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;