Improving reports for errors in 'same_nets' cases

This commit is contained in:
Matthias Koefferlein 2024-05-27 00:43:36 +02:00
parent 3edb193562
commit f01d8d46b5
6 changed files with 30 additions and 17 deletions

View File

@ -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);

View File

@ -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) {

View File

@ -83,6 +83,7 @@ const size_t unknown_id = std::numeric_limits<size_t>::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<const db::Net *, const db::Net *> &np);

View File

@ -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)
)
)
)

View File

@ -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)

View File

@ -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)