From 72ef2f2637414221361d2a5c87d9b6e66ab6b6a2 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Sat, 10 Jul 2021 11:25:07 -0400 Subject: [PATCH] Corrected the pin matching so that it runs the same loop on unmatched pins on non-black-boxed circuits as it does not black-boxed circuits, but specifically looking for pins that are disconnected on both sides, since those do not appear in the node list and are not otherwise handled. Otherwise, disconnected pins will appear to have disappeared from the first netlist. --- VERSION | 2 +- base/netcmp.c | 63 ++++++++++++++++++++++++++++++--------------------- 2 files changed, 38 insertions(+), 27 deletions(-) diff --git a/VERSION b/VERSION index ed4d51c..b6834e4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.193 +1.5.194 diff --git a/base/netcmp.c b/base/netcmp.c index 1508353..e58401d 100644 --- a/base/netcmp.c +++ b/base/netcmp.c @@ -7343,35 +7343,44 @@ int MatchPins(struct nlist *tc1, struct nlist *tc2, int dolist) /* so apply only to black-box (CELL_PLACEHOLDER) entries. */ /* (Semi-hack: Allow "!" global flag) */ - if (((tc1->flags & CELL_PLACEHOLDER) && (tc2->flags & CELL_PLACEHOLDER)) || - (NodeClasses == NULL)) { - ob1 = tc1->cell; - bangptr1 = strrchr(ob1->name, '!'); - if (bangptr1 && (*(bangptr1 + 1) == '\0')) - *bangptr1 = '\0'; - else bangptr1 = NULL; + ob1 = tc1->cell; + bangptr1 = strrchr(ob1->name, '!'); + if (bangptr1 && (*(bangptr1 + 1) == '\0')) + *bangptr1 = '\0'; + else bangptr1 = NULL; - for (i = 0; i < numorig; i++) { - if (*(cover + i) == (char)0) { - j = 0; - for (ob2 = tc2->cell; ob2 != NULL; ob2 = ob2->next) { - char *name1, *name2; + for (i = 0; i < numorig; i++) { + if (*(cover + i) == (char)0) { + j = 0; + for (ob2 = tc2->cell; ob2 != NULL; ob2 = ob2->next) { + char *name1, *name2; - if (!IsPort(ob2)) break; + if (!IsPort(ob2)) break; - bangptr2 = strrchr(ob2->name, '!'); - if (bangptr2 && (*(bangptr2 + 1) == '\0')) - *bangptr2 = '\0'; - else bangptr2 = NULL; + bangptr2 = strrchr(ob2->name, '!'); + if (bangptr2 && (*(bangptr2 + 1) == '\0')) + *bangptr2 = '\0'; + else bangptr2 = NULL; - name1 = ob1->name; - name2 = ob2->name; + name1 = ob1->name; + name2 = ob2->name; - /* Recognize proxy pins as matching */ - if (!strncmp(name1, "proxy", 5)) name1 +=5; - if (!strncmp(name2, "proxy", 5)) name2 +=5; + /* Recognize proxy pins as matching unconnected pins */ + if (!strncmp(name1, "proxy", 5) && (ob2->node == -1)) name1 +=5; + if (!strncmp(name2, "proxy", 5) && (ob1->node == -1)) name2 +=5; + + if ((*matchfunc)(name1, name2)) { + + /* If both sides have unconnected nodes, then pins with */ + /* matching names are an automatic match. Otherwise, if */ + /* matching black-box entries, then pins are always */ + /* matched by name. */ + + if (((ob1->node == -1) && (ob2->node == -1)) || + (((tc1->flags & CELL_PLACEHOLDER) && + (tc2->flags & CELL_PLACEHOLDER)) || + (NodeClasses == NULL))) { - if ((*matchfunc)(name1, name2)) { ob2->model.port = i; /* save order */ *(cover + i) = (char)1; @@ -7398,13 +7407,15 @@ int MatchPins(struct nlist *tc1, struct nlist *tc2, int dolist) Tcl_NewStringObj(ob2->name, -1)); } #endif + if (bangptr2) *bangptr2 = '!'; + break; } - if (bangptr2) *bangptr2 = '!'; - j++; } + if (bangptr2) *bangptr2 = '!'; + j++; } - ob1 = ob1->next; } + ob1 = ob1->next; if (bangptr1) *bangptr1 = '!'; }