From 3ebdfa83f9a458ec0485a9b43cfe8c9ec414a55c Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 14 Apr 2019 19:38:31 +0200 Subject: [PATCH] Netlist compare: successfully applied the netlist compare to a bigger example. --- src/db/db/dbNetlistCompare.cc | 38 +++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/src/db/db/dbNetlistCompare.cc b/src/db/db/dbNetlistCompare.cc index ab1a45527..29092538d 100644 --- a/src/db/db/dbNetlistCompare.cc +++ b/src/db/db/dbNetlistCompare.cc @@ -29,7 +29,8 @@ #include "tlLog.h" // verbose debug output -#define PRINT_DEBUG_NETCOMPARE +// TODO: make this a feature? +// #define PRINT_DEBUG_NETCOMPARE namespace db { @@ -1230,11 +1231,40 @@ NetDeviceGraph::derive_node_identities_from_node_set (const std::vector::const_iterator nr = node_ranges.begin (); nr != node_ranges.end (); ++nr) { + for (std::vector::iterator nr = node_ranges.begin (); nr != node_ranges.end (); ++nr) { - // @@@ node ranges might have changed - adjust to real count and skip leading pairs assigned already + // node ranges might have changed - adjust to real count and skip leading pairs assigned already - if (nr->num == 1) { + while (nr->n1 != nr->nn1 && nr->n2 != nr->nn2) { + if ((*nr->n1)->has_other ()) { + ++nr->n1; + } else if ((*nr->n2)->has_other ()) { + ++nr->n2; + } else { + break; + } + } + + nr->num = 0; + std::vector::const_iterator i1 = nr->n1, i2 = nr->n2; + + while (i1 != nr->nn1 && i2 != nr->nn2) { + if ((*i1)->has_other ()) { + ++i1; + } else if ((*i2)->has_other ()) { + ++i2; + } else { + ++nr->num; + ++i1; + ++i2; + } + } + + if (nr->num < 1) { + + // ignore this - it got obsolete. + + } else if (nr->num == 1) { if (! (*nr->n1)->has_other () && ! (*nr->n2)->has_other ()) {