From 6ea04d6c272a70b720b0a0c352ace2aca90c7875 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Tue, 13 Apr 2021 22:57:08 +0200 Subject: [PATCH] Small LVS enhancement: reject backtracking branch if it leads to ambiguous name conflicts --- src/db/db/dbNetlistCompare.cc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/db/db/dbNetlistCompare.cc b/src/db/db/dbNetlistCompare.cc index 4efcd9871..94d26a944 100644 --- a/src/db/db/dbNetlistCompare.cc +++ b/src/db/db/dbNetlistCompare.cc @@ -2382,6 +2382,25 @@ NetGraph::derive_node_identities_from_ambiguity_group (const NodeRange &nr, Devi std::vector >::const_iterator i1 = *ii1; + // in tentative mode, reject this choice if nets are named and all other nets in the ambiguity group differ -> this favors net matching by name + if (! data->dont_consider_net_names && tentative) { + + bool any_matching = false; + for (std::vector >::const_iterator>::iterator ii2 = iters2.begin (); ii2 != iters2.end () && ! any_matching; ++ii2) { + std::vector >::const_iterator i2 = *ii2; + any_matching = !net_names_are_different (i1->first->net (), i2->first->net ()); + } + + if (! any_matching) { + if (options ()->debug_netcompare) { + tl::info << indent_s << "ambiguity group rejected - all ambiguous other net names are mismatching for: " << i1->first->net ()->expanded_name (); + } + // a mismatch - stop here. + return failed_match; + } + + } + bool any = false; std::vector >::const_iterator>::iterator to_remove = iters2.end ();