diff --git a/src/db/db/dbNetlistCompare.cc b/src/db/db/dbNetlistCompare.cc index 038fb9e7c..6d0e3128c 100644 --- a/src/db/db/dbNetlistCompare.cc +++ b/src/db/db/dbNetlistCompare.cc @@ -938,8 +938,16 @@ NetlistComparer::compare_circuits (const db::Circuit *c1, const db::Circuit *c2, if (mp_logger) { if (p->second && ! exact_match) { if (m_with_log) { - mp_logger->log_entry (db::Error, - tl::sprintf (tl::to_string (tr ("Nets %s are paired explicitly, but are not identical topologically")), nets2string (p->first))); + if (! p->first.first) { + mp_logger->log_entry (db::Error, + tl::sprintf (tl::to_string (tr ("Right-side net %s is paired explicitly with a left-side one, but no net is present there")), expanded_name (p->first.second))); + } else if (! p->first.second) { + mp_logger->log_entry (db::Error, + tl::sprintf (tl::to_string (tr ("Left-side net %s is paired explicitly with a right-side one, but no net is present there")), expanded_name (p->first.first))); + } else { + mp_logger->log_entry (db::Error, + tl::sprintf (tl::to_string (tr ("Nets %s are paired explicitly, but are not identical topologically")), nets2string (p->first))); + } } mp_logger->net_mismatch (p->first.first, p->first.second); } else { @@ -950,7 +958,11 @@ NetlistComparer::compare_circuits (const db::Circuit *c1, const db::Circuit *c2, } else if (p->second && g1.has_node_index_for_net (p->first.first)) { if (mp_logger) { - mp_logger->net_mismatch (p->first.first, 0); + mp_logger->net_mismatch (p->first.first, p->first.second); + if (m_with_log && p->first.second) { + mp_logger->log_entry (db::Error, + tl::sprintf (tl::to_string (tr ("Nets %s are paired explicitly, but are not identical topologically")), nets2string (p->first))); + } } size_t ni1 = g1.node_index_for_net (p->first.first); @@ -959,7 +971,11 @@ NetlistComparer::compare_circuits (const db::Circuit *c1, const db::Circuit *c2, } else if (p->second && g2.has_node_index_for_net (p->first.second)) { if (mp_logger) { - mp_logger->net_mismatch (0, p->first.second); + mp_logger->net_mismatch (p->first.first, p->first.second); + if (m_with_log && p->first.first) { + mp_logger->log_entry (db::Error, + tl::sprintf (tl::to_string (tr ("Nets %s are paired explicitly, but are not identical topologically")), nets2string (p->first))); + } } size_t ni2 = g2.node_index_for_net (p->first.second); diff --git a/src/db/db/dbNetlistCompareUtils.cc b/src/db/db/dbNetlistCompareUtils.cc index 97951ca25..0e7be811a 100644 --- a/src/db/db/dbNetlistCompareUtils.cc +++ b/src/db/db/dbNetlistCompareUtils.cc @@ -73,7 +73,7 @@ nl_compare_debug_indent (size_t depth) const std::string var_sep = tl::to_string (tr (" vs. ")); -static std::string +std::string expanded_name (const db::Net *a) { if (a == 0) { diff --git a/src/db/db/dbNetlistCompareUtils.h b/src/db/db/dbNetlistCompareUtils.h index 55614577a..f84c30ab0 100644 --- a/src/db/db/dbNetlistCompareUtils.h +++ b/src/db/db/dbNetlistCompareUtils.h @@ -83,6 +83,7 @@ const size_t unknown_id = std::numeric_limits::max () - 1; // Some utilities std::string nl_compare_debug_indent (size_t depth); +std::string expanded_name (const db::Net *a); std::string nets2string (const db::Net *a, const db::Net *b); std::string nets2string (const std::pair &np); diff --git a/testdata/lvs/blackbox3.lvsdb b/testdata/lvs/blackbox3.lvsdb index f95a64186..0ea7fb1e5 100644 --- a/testdata/lvs/blackbox3.lvsdb +++ b/testdata/lvs/blackbox3.lvsdb @@ -185,10 +185,9 @@ xref( ) circuit(TOP TOP nomatch log( - entry(error description('Nets $1 vs. (not connected) are paired explicitly, but are not identical topologically')) + entry(error description('Nets 7 are paired explicitly, but are not identical topologically')) ) xref( - net(() 7 mismatch) net(1 () mismatch) net(5 1 match) net(4 2 match) @@ -196,8 +195,10 @@ xref( net(3 4 match) net(7 5 match) net(8 6 match) + net(9 7 mismatch) net(6 8 match) - circuit(1 1 mismatch) + circuit(() 1 mismatch) + circuit(1 () mismatch) ) ) ) diff --git a/testdata/lvs/blackbox4.lvsdb b/testdata/lvs/blackbox4.lvsdb index a54819f42..5e782006a 100644 --- a/testdata/lvs/blackbox4.lvsdb +++ b/testdata/lvs/blackbox4.lvsdb @@ -181,9 +181,8 @@ xref( ) circuit(TOP TOP nomatch log( - entry(error description('Nets (not connected) vs. 5 are paired explicitly, but are not identical topologically')) - entry(error description('Nets 5,7 vs. (not connected) are paired explicitly, but are not identical topologically')) - entry(error description('Nets (not connected) vs. 7 are paired explicitly, but are not identical topologically')) + entry(error description('Left-side net 5,7 is paired explicitly with a right-side one, but no net is present there')) + entry(error description('Net 5,7 is not matching any net from reference netlist')) ) xref( net(() 5 mismatch) diff --git a/testdata/lvs/blackbox5.lvsdb b/testdata/lvs/blackbox5.lvsdb index 391475a66..6d8f88e0a 100644 --- a/testdata/lvs/blackbox5.lvsdb +++ b/testdata/lvs/blackbox5.lvsdb @@ -184,15 +184,11 @@ xref( ) circuit(TOP TOP nomatch log( - entry(error description('Nets $1 vs. (not connected) are paired explicitly, but are not identical topologically')) - entry(error description('Nets (not connected) vs. 5 are paired explicitly, but are not identical topologically')) - entry(error description('Nets 5,7 vs. (not connected) are paired explicitly, but are not identical topologically')) - entry(error description('Nets (not connected) vs. 7 are paired explicitly, but are not identical topologically')) + entry(error description('Left-side net 5,7 is paired explicitly with a right-side one, but no net is present there')) ) xref( net(() 5 mismatch) - net(() 7 mismatch) - net(1 () mismatch) + net(1 7 match) net(5 1 match) net(4 2 match) net(2 3 match)