From 92dfa74403ed53836c78d9d731000ea8758c14cb Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Mon, 14 Jun 2021 14:30:10 -0400 Subject: [PATCH] Corrected an issue that was caused by introducing a type of parallel device with one or more no-connect pins. The flag that indicates a no-connect pin was checked incorrectly, potentially causing obscure and misleading property mismatch messages to be generated. --- VERSION | 2 +- base/netcmp.c | 17 +++++++++++++---- base/netgen.c | 2 ++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/VERSION b/VERSION index 0fccd67..4f1fcfd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.186 +1.5.187 diff --git a/base/netcmp.c b/base/netcmp.c index ded9c87..8cb52db 100644 --- a/base/netcmp.c +++ b/base/netcmp.c @@ -5601,6 +5601,7 @@ PropertyMatch(struct objlist *ob1, int file1, int t1type, t2type; int i, mismatches = 0, checked_one; int rval = 1; + int flags1, flags2; char *inst1, *inst2; #ifdef TCL_NETGEN Tcl_Obj *proplist = NULL, *mpair, *mlist; @@ -5696,8 +5697,7 @@ PropertyMatch(struct objlist *ob1, int file1, /* (Permutable pins may need to be handled correctly. . . */ for (tp1 = ob1, tp2 = ob2; (tp1 != NULL) && tp1->type >= FIRSTPIN && - (tp2 != NULL) && tp2->type >= FIRSTPIN; tp1 = tp1->next, tp2 = tp2->next) - { + (tp2 != NULL) && tp2->type >= FIRSTPIN; tp1 = tp1->next, tp2 = tp2->next) { struct objlist *node1, *node2; if (file1 == Circuit1->file) @@ -5710,8 +5710,17 @@ PropertyMatch(struct objlist *ob1, int file1, else node2 = Circuit2->nodename_cache[tp2->node]; - if (node1->instance.flags != node2->instance.flags) - { + /* NOTE: A "no-connect" node (multiple no-connects represented by a + * single node) has non-zero flags. A non-node entry in the cache + * implies a node with zero flags. + */ + flags1 = flags2 = 0; + if ((node1->type <= NODE) && (node1->type >= UNIQUEGLOBAL)) + flags1 = node1->instance.flags; + if ((node2->type <= NODE) && (node2->type >= UNIQUEGLOBAL)) + flags2 = node2->instance.flags; + + if (flags1 != flags2) { Fprintf(stdout, " Parallelized instances disagree on pin connections.\n"); Fprintf(stdout, " Circuit1 instance %s pin %s connections are %s (%d)\n", tp1->instance.name, node1->name, diff --git a/base/netgen.c b/base/netgen.c index 18890d3..cc4d04d 100644 --- a/base/netgen.c +++ b/base/netgen.c @@ -3259,6 +3259,8 @@ int CombineParallel(char *model, int file) if ((ob2->node >= 0) && (nodecount[ob2->node] == 1)) { nob = (tp->nodename_cache)[ob2->node]; + /* NOTE: nob must be a pin type or NODE, so it's */ + /* okay to set the instance.flags record for it. */ nob->instance.flags = NO_CONNECT; strcat(pptr, "_nc"); }