From 73556d6edcea9501a7e4029443c3033e792c339e Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Wed, 30 Oct 2019 23:55:08 +0100 Subject: [PATCH] Netlist compare issue fixed In tentative mode, node equivalence shall not be assumed if the nodes have edges which don't appear in the other node. --- src/db/db/dbNetlistCompare.cc | 39 ++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/src/db/db/dbNetlistCompare.cc b/src/db/db/dbNetlistCompare.cc index 9b21eda88..bdfdc1943 100644 --- a/src/db/db/dbNetlistCompare.cc +++ b/src/db/db/dbNetlistCompare.cc @@ -32,7 +32,7 @@ // verbose debug output // TODO: make this a feature? -// #define PRINT_DEBUG_NETCOMPARE +#define PRINT_DEBUG_NETCOMPARE // verbose net graph output // TODO: make this a feature? @@ -1676,6 +1676,9 @@ NetGraph::derive_node_identities (size_t net_index, size_t depth, size_t n_branc tl::info << indent(depth) << "deducing from pair: " << n->net ()->expanded_name () << " vs. " << n_other->net ()->expanded_name (); } else { tl::info << indent(depth) << "tentatively deducing from pair: " << n->net ()->expanded_name () << " vs. " << n_other->net ()->expanded_name (); +if (n->net()->expanded_name() == "$I30" && n_other->net ()->expanded_name () == "DWSA_0") { +printf("@@@ BANG!\n"); +} } #endif @@ -1730,12 +1733,46 @@ NetGraph::derive_node_identities (size_t net_index, size_t depth, size_t n_branc new_nodes += bt_count; } + } else if (tentative) { + // in tentative mode an exact match is required: no having the same edges for a node disqualifies the node + // as matching. +#if defined(PRINT_DEBUG_NETCOMPARE) + tl::info << indent(depth) << "! rejected pair for missing edge."; +#endif + return failed_match; } e = ee; } + if (tentative) { + + // in tentative mode, again an exact match is required + + for (NetGraphNode::edge_iterator e_other = n_other->begin (); e_other != n_other->end (); ) { + + NetGraphNode::edge_iterator ee_other = e_other; + ++ee_other; + + while (ee_other != n_other->end () && ee_other->first == e_other->first) { + ++ee_other; + } + + NetGraphNode::edge_iterator e = n->find_edge (e_other->first); + if (e == n->end ()) { +#if defined(PRINT_DEBUG_NETCOMPARE) + tl::info << indent(depth) << "! rejected pair for missing edge."; +#endif + return failed_match; + } + + e_other = ee_other; + + } + + } + #if defined(PRINT_DEBUG_NETCOMPARE) if (! tentative && new_nodes > 0) { tl::info << indent(depth) << "finished pair deduction: " << n->net ()->expanded_name () << " vs. " << n_other->net ()->expanded_name () << " with " << new_nodes << " new pairs";