From c45d51e950b123d6814b2f4d00b5f854a11c0621 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Fri, 31 Jul 2020 12:22:50 -0400 Subject: [PATCH] Tracked down and fixed problems with implicit pins in verilog (pins that are not declared in the verilog netlist because they don't connect to anything, and their presence is not required by verilog syntax) and the printing of proxy pins created to act as placeholders for those implicit pins. Also removed the pinting of the "disconnected pin" messages for black-box modules (since by definition they have disconnected pins, because black-box modules have no contents). --- VERSION | 2 +- base/netcmp.c | 29 +++++++++++++++++++++++++++-- base/query.c | 6 +++++- 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index 589628c..336a6bc 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.152 +1.5.153 diff --git a/base/netcmp.c b/base/netcmp.c index fb49c30..39bcf71 100644 --- a/base/netcmp.c +++ b/base/netcmp.c @@ -6918,6 +6918,8 @@ int MatchPins(struct nlist *tc1, struct nlist *tc2, int dolist) if (*(cover + i) == (char)0) { j = 0; for (ob2 = tc2->cell; ob2 != NULL; ob2 = ob2->next) { + char *name1, *name2; + if (!IsPort(ob2)) break; bangptr2 = strrchr(ob2->name, '!'); @@ -6925,7 +6927,14 @@ int MatchPins(struct nlist *tc1, struct nlist *tc2, int dolist) *bangptr2 = '\0'; else bangptr2 = NULL; - if ((*matchfunc)(ob1->name, 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; + + if ((*matchfunc)(name1, name2)) { ob2->model.port = i; /* save order */ *(cover + i) = (char)1; @@ -7032,7 +7041,7 @@ int MatchPins(struct nlist *tc1, struct nlist *tc2, int dolist) obn->name = (char *)MALLOC(6 + strlen(ob2->name)); sprintf(obn->name, "proxy%s", ob2->name); obn->type = UNKNOWN; - obn->model.port = -1; + // obn->model.port = -1; obn->instance.name = NULL; obn->node = -1; if (ob1 == tc1->cell) { @@ -7102,6 +7111,22 @@ int MatchPins(struct nlist *tc1, struct nlist *tc2, int dolist) obn->instance.name = NULL; obn->node = -1; + if (Debug == 0) { + if (strcmp(ob1->name, "(no pins)")) { + for (m = 0; m < left_col_end; m++) *(ostr + m) = ' '; + for (m = left_col_end + 1; m < right_col_end; m++) *(ostr + m) = ' '; + snprintf(ostr, left_col_end, "%s", ob1->name); + snprintf(ostr + left_col_end + 1, left_col_end, "(no matching pin)"); + for (m = 0; m < right_col_end + 1; m++) + if (*(ostr + m) == '\0') *(ostr + m) = ' '; + Fprintf(stdout, ostr); + } + } + else { + Fprintf(stderr, "No netlist match for cell %s pin %s\n", + tc1->name, ob1->name); + } + if (ob2 == tc2->cell) { obn->next = ob2; tc2->cell = obn; diff --git a/base/query.c b/base/query.c index 7067242..7da724f 100644 --- a/base/query.c +++ b/base/query.c @@ -801,7 +801,11 @@ void DescribeInstance(char *name, int file) { if (ob->node > nodemax) nodemax = ob->node; else if ((ob->node == -1) && (ob->model.port != PROXY)) { - if (!(tp->flags & CELL_PLACEHOLDER)) + + /* All black-box modules and placeholders by definition have all */ + /* disconnected pins, so don't report those. */ + + if (!(tp->flags & CELL_PLACEHOLDER) && (tp->class != CLASS_MODULE)) { if (disconnectednodes == 0) Fprintf(stderr, "\n"); disconnectednodes++;