From 964bb0e91adba5f48af0f665e160664159420c50 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Tue, 7 Dec 2021 15:34:45 -0500 Subject: [PATCH 1/2] Added sorting of the output lines for items which match both name and contents (previously wasn't done), and also added sorting for items with non-matching names which have only one item in the group for each circuit (so they must be matching in some sense). This makes the output a bit more readable without re-enabling the compute-intensive sorting method for non-matching entries. --- VERSION | 2 +- base/netcmp.c | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index bca61d4..a0e2dde 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.210 +1.5.211 diff --git a/base/netcmp.c b/base/netcmp.c index 9161dbb..6ab72c8 100644 --- a/base/netcmp.c +++ b/base/netcmp.c @@ -1367,8 +1367,8 @@ void SortUnmatchedLists(nlists1, nlists2, n1max, n2max) nlists2[n1] = temp; HashPtrInstall(nlists2[n1]->name, (void *)((long)n1 + 1), &n2hash); HashPtrInstall(nlists2[n2]->name, (void *)((long)n2 + 1), &n2hash); - SortFanoutLists(nlists1[n1], nlists2[n1]); } + SortFanoutLists(nlists1[n1], nlists2[n1]); } } @@ -1423,8 +1423,13 @@ void SortUnmatchedLists(nlists1, nlists2, n1max, n2max) nlists1[n2] = temp; HashPtrInstall(nlists1[n1]->name, (void *)((long)n1 + 1), &n1hash); HashPtrInstall(nlists1[n2]->name, (void *)((long)n2 + 1), &n1hash); - SortFanoutLists(nlists2[n2], nlists1[n2]); } + SortFanoutLists(nlists2[n2], nlists1[n2]); + } + else if ((n1max == 1) && (n2max == 1)) { + /* Names didn't match but there's only one entry on each side, */ + /* so do a sort anyway. */ + SortFanoutLists(nlists2[n2], nlists1[n2]); } } /* For all nets that didn't match by name, match by content */ From 9908349fddc9f83f955b8e105154a66fc06d2e27 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Tue, 7 Dec 2021 16:33:43 -0500 Subject: [PATCH 2/2] Modified the output of "debug on" mode to print the instance name for each connection in the dump of incorrect nets. This is definitely critical to finding local swapping errors, and needs to be incorporated into the non-debug mode, preferably as part of the JSON file dump. But that's for later. --- base/netcmp.c | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/base/netcmp.c b/base/netcmp.c index 6ab72c8..48745eb 100644 --- a/base/netcmp.c +++ b/base/netcmp.c @@ -893,9 +893,8 @@ struct FormattedList *FormatBadNodeFragment(struct Node *N) WITH THE SAME HASH NUMBER, are on this node */ for (j = i+1; j < fanout; j++) { if (pins[j] != NULL && - (*matchfunc) (model, - pins[j]->subelement->element->object->model.class) && - pins[i]->subelement->pin_magic == pins[j]->subelement->pin_magic) { + (*matchfunc)(model, pins[j]->subelement->element->object->model.class) && + pins[i]->subelement->pin_magic == pins[j]->subelement->pin_magic) { count++; nodelist->fanout--; pins[j] = NULL; @@ -975,16 +974,36 @@ void PrintBadNodeFragment(struct Node *N) WITH THE SAME HASH NUMBER, are on this node */ for (j = i+1; j < fanout; j++) { if (pins[j] != NULL && - (*matchfunc)(model, - pins[j]->subelement->element->object->model.class) && - pins[i]->subelement->pin_magic == pins[j]->subelement->pin_magic) { - count++; - pins[j] = NULL; - } + (*matchfunc)(model, pins[j]->subelement->element->object->model.class) && + pins[i]->subelement->pin_magic == pins[j]->subelement->pin_magic) { + count++; + /* pins[j] = NULL; */ /* Done in diagnostic output, below */ + } } - if (i != 0) Fprintf(stdout, ";"); + if (i != 0) { + /* Fprintf(stdout, ";"); */ + Fprintf(stdout, "\n"); + Ftab(stdout, 32); + } Fprintf(stdout, " %s:%s = %d", model, pinname, count); + + /* Diagnostic */ + Fprintf(stdout, "\n"); + Ftab(stdout, 25); + Fprintf(stdout, ">>> %s", pins[i]->subelement->element->object->instance); + for (j = i+1; j < fanout; j++) { + if (pins[j] != NULL && + (*matchfunc)(model, pins[j]->subelement->element->object->model.class) && + pins[i]->subelement->pin_magic == pins[j]->subelement->pin_magic) { + /* Diagnostic */ + Fprintf(stdout, "\n"); + Ftab(stdout, 25); + Fprintf(stdout, ">>> %s", pins[j]->subelement->element->object->instance); + pins[j] = NULL; + } + } + pins[i] = NULL; /* not really necessary */ } Fprintf(stdout, "\n");