From 05872ca9182936ebdb2ae20a248e4f10df233bf6 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Wed, 2 Oct 2024 21:20:27 -0400 Subject: [PATCH] Corrected an apparently long-standing error that is responsible for some errors failing to list in the output while also being responsible for a number of non-errors showing up in the output. This fix may substantially clean up netgen output. Also: Added text to the output noting that pin matching may be incorrect with respect to symmetries if the nets have failed to match. --- VERSION | 2 +- base/netcmp.c | 8 ++++++-- tcltk/tclnetgen.c | 4 +++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index 7aee4d0..3f3f285 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.279 +1.5.280 diff --git a/base/netcmp.c b/base/netcmp.c index 34e7296..b062004 100644 --- a/base/netcmp.c +++ b/base/netcmp.c @@ -2706,7 +2706,9 @@ CheckLegalElementPartition(struct ElementClass *head) found = 0; for (scan = head; scan != NULL; scan = scan->next) { - if (scan->count == 2) continue; + /* Quick check for matching 1:1 case */ + if ((scan->count == 2) && (scan->elements->graph != scan->elements->next->graph)) + continue; C1 = C2 = 0; for (E = scan->elements; E != NULL; E = E->next) { if (E->graph == Circuit1->file) C1++; @@ -2828,7 +2830,9 @@ CheckLegalNodePartition(struct NodeClass *head) found = 0; for (scan = head; scan != NULL; scan = scan->next) { - if (scan->count == 2) continue; + /* Quick check for matching 1:1 case */ + if ((scan->count == 2) && (scan->nodes->graph != scan->nodes->next->graph)) + continue; C1 = C2 = 0; for (N = scan->nodes; N != NULL; N = N->next) { if (N->graph == Circuit1->file) C1++; diff --git a/tcltk/tclnetgen.c b/tcltk/tclnetgen.c index 9b6754a..dede0fe 100644 --- a/tcltk/tclnetgen.c +++ b/tcltk/tclnetgen.c @@ -2651,8 +2651,10 @@ _netcmp_verify(ClientData clientData, disable_interrupt(); if (index == EQUIV_IDX || index == UNIQUE_IDX) Tcl_SetObjResult(interp, Tcl_NewBooleanObj(0)); - else + else { Fprintf(stdout, "Netlists do not match.\n"); + Fprintf(stdout, "Port matching may fail to disambiguate symmetries.\n"); + } } else if (automorphisms == -2) { if (index == EQUIV_IDX)