From 1bb486622630576643fa2f1971fc3d77d81ea90a Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Sat, 23 Oct 2021 14:41:58 -0400 Subject: [PATCH 1/5] Revert "Made a correction to the flattening code, removed a duplicate" This reverts commit 625e043efffac2864275d0d74bf45a62f642bc11. Reverting back to before pull request #33. --- VERSION | 2 +- tcltk/netgen.tcl.in | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/VERSION b/VERSION index 27774a1..4b0033d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.205 +1.5.204 diff --git a/tcltk/netgen.tcl.in b/tcltk/netgen.tcl.in index 861b1c9..7c2e1e4 100644 --- a/tcltk/netgen.tcl.in +++ b/tcltk/netgen.tcl.in @@ -567,8 +567,7 @@ proc netgen::lvs { name1 name2 {setupfile setup.tcl} {logfile comp.out} args} { netgen::flatten class "[lindex $endval 1] $fnum2" } else { netgen::log put " Continuing with black-boxed subcircuits $endval\n" - lappend matcherr [lindex $endval 0]"(1)" - lappend matcherr [lindex $endval 1]"(2)" + lappend matcherr [lindex $endval 0] # Match pins netgen::log echo off if {$dolist == 1} { @@ -610,15 +609,16 @@ proc netgen::lvs { name1 name2 {setupfile setup.tcl} {logfile comp.out} args} { } else { # Flatten the non-matching subcircuit (but not the top-level cells) if {[netgen::print queue] != {}} { - if {([lsearch $noflat [lindex $endval 0]] == -1) && + if {([lsearch $noflat [lindex $endval 1]] == -1) && ([lsearch $noflat [lindex $endval 1]] == -1)} { netgen::log put " Flattening non-matched subcircuits $endval\n" netgen::flatten class "[lindex $endval 0] $fnum1" netgen::flatten class "[lindex $endval 1] $fnum2" } else { netgen::log put " Continuing with black-boxed subcircuits $endval\n" - lappend matcherr [lindex $endval 0]"(1)" - lappend matcherr [lindex $endval 1]"(2)" + lappend matcherr [lindex $endval 0] + netgen::log put " Continuing with black-boxed subcircuits $endval\n" + lappend matcherr [lindex $endval 0] # Match pins netgen::log echo off if {$dolist == 1} { From 56d4d581e748248586d75730e828b29237a90c4a Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Sat, 23 Oct 2021 14:42:28 -0400 Subject: [PATCH 2/5] Revert "Minor syntactical editing of pull request #33, and updated version" This reverts commit 6ceeddf09610e641b6787e0224a162a872fe1b7a. Reverting back to before pull request #33. --- VERSION | 2 +- base/flatten.c | 68 ++++++++++++++++++++++++-------------------------- 2 files changed, 34 insertions(+), 36 deletions(-) diff --git a/VERSION b/VERSION index 4b0033d..137ac1e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.204 +1.5.203 diff --git a/base/flatten.c b/base/flatten.c index 5b3f610..8dd7d34 100644 --- a/base/flatten.c +++ b/base/flatten.c @@ -259,16 +259,13 @@ int flattenInstancesOf(char *name, int fnum, char *instance) struct objlist *ChildObjList, *ChildListEnd; struct objlist *ChildStart, *ChildEnd, *ParentEnd, *ParentNext; struct nlist *ThisCell; - struct nlist *ChildCell; + struct nlist *ChildCell; struct objlist *tmp, *ob2, *ob3; - int notdone, rnodenum; - char tmpstr[1024]; - int nextnode, oldmax, numflat = 0; - struct objlist *myObject_p, *myPort_p; - struct objlist *myFirstPin_p, *myPin_p; - int myDeleteCount = 0; + int notdone, rnodenum; + char tmpstr[1024]; + int nextnode, oldmax, numflat = 0; #if !OLDPREFIX - int prefixlength; + int prefixlength; #endif if (name == NULL) { @@ -602,37 +599,38 @@ int flattenInstancesOf(char *name, int fnum, char *instance) } CacheNodeNames(ThisCell); ThisCell->dumped = 1; /* indicate cell has been flattened */ + { // Remove disconnected ports. New block to ensure isolated scope. + // Fprintf(stdout, "DEBUG: check pins for %s of %d\n", name, fnum); + struct objlist *myObject_p, *myPort_p; + struct objlist *myFirstPin_p, *myPin_p; + int myDeleteCount = 0; - // Remove disconnected ports. - // Fprintf(stdout, "DEBUG: check pins for %s of %d\n", name, fnum); - - myFirstPin_p = NULL; - - // Save first pin definition so we don't have to search for each port - for (myObject_p = ThisCell->cell; myObject_p != NULL; myObject_p = myObject_p->next) { - if (myObject_p->type >= FIRSTPIN) { - myFirstPin_p = myObject_p; - break; + myFirstPin_p = NULL; + // Save first pin definition so we don't have to search for each port + for ( myObject_p = ThisCell->cell; myObject_p != NULL; myObject_p = myObject_p->next ) { + if ( myObject_p->type >= FIRSTPIN ) { + myFirstPin_p = myObject_p; + break; + } } - } - if (myFirstPin_p != NULL) { // Not a black box. Black boxes contain no pins. - // For each port, check for pin connection. If none, mark for deletion. - // Assumes that all ports occur at the beginning of the list - for (myPort_p = ThisCell->cell; myPort_p != NULL && IsPort(myPort_p); - myPort_p = myPort_p->next ) { - for (myPin_p = myFirstPin_p; myPin_p != NULL; myPin_p = myPin_p->next) { - if (myPort_p->node == myPin_p->node) { // only need to find one connection - break; + if ( myFirstPin_p != NULL ) { // not a black box. Black boxes contain no pins. + // For each port, check for pin connection. If none, mark for deletion. + // Assumes that all ports occur at the beginning of the list + for ( myPort_p = ThisCell->cell; myPort_p != NULL && IsPort(myPort_p); myPort_p = myPort_p->next ) { + for ( myPin_p = myFirstPin_p; myPin_p != NULL; myPin_p = myPin_p->next ) { + if ( myPort_p->node == myPin_p->node ) { // only need to find one connection + break; + } + } + if ( myPin_p == NULL ) { // mark disconnected ports + myDeleteCount++; + myPort_p->node = -2; } } - if (myPin_p == NULL) { // mark disconnected ports - myDeleteCount++; - myPort_p->node = -2; + if ( myDeleteCount > 0 ) { // delete disconnected ports + CleanupPins(name, fnum); } } - if (myDeleteCount > 0) { // delete disconnected ports - CleanupPins(name, fnum); - } } return numflat; } @@ -1617,8 +1615,8 @@ PrematchLists(char *name1, int file1, char *name2, int file2) } } else { - // Apply recursive flattening when a cell exists in - // one circuit but not the other. + // cell exists in one circuit but not the other, so flatten it. + // match = 0; break; } } From d09f0dd53b2586a34364b4a5ae024d71719b7453 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Sat, 23 Oct 2021 14:42:32 -0400 Subject: [PATCH 3/5] Revert "Flatten unmatched cells that don't contain instances from the other file." This reverts commit 42b1acc564e0380454d8d0aa365270be4739f13a. Reverting back to before pull request #33. --- base/flatten.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/base/flatten.c b/base/flatten.c index 8dd7d34..9c7cef0 100644 --- a/base/flatten.c +++ b/base/flatten.c @@ -1615,8 +1615,7 @@ PrematchLists(char *name1, int file1, char *name2, int file2) } } else { - // cell exists in one circuit but not the other, so flatten it. - // match = 0; + match = 0; break; } } From 23ff2f00a3a79618287f1286a3db82afee9c1891 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Sat, 23 Oct 2021 14:42:37 -0400 Subject: [PATCH 4/5] Revert "Remove disconnected ports after flattening." This reverts commit 6d6da9cf5c0ae6ec6e72a5687640cd52a160a38c. Reverting back to before pull request #33. --- base/flatten.c | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/base/flatten.c b/base/flatten.c index 9c7cef0..f21c807 100644 --- a/base/flatten.c +++ b/base/flatten.c @@ -599,39 +599,6 @@ int flattenInstancesOf(char *name, int fnum, char *instance) } CacheNodeNames(ThisCell); ThisCell->dumped = 1; /* indicate cell has been flattened */ - { // Remove disconnected ports. New block to ensure isolated scope. - // Fprintf(stdout, "DEBUG: check pins for %s of %d\n", name, fnum); - struct objlist *myObject_p, *myPort_p; - struct objlist *myFirstPin_p, *myPin_p; - int myDeleteCount = 0; - - myFirstPin_p = NULL; - // Save first pin definition so we don't have to search for each port - for ( myObject_p = ThisCell->cell; myObject_p != NULL; myObject_p = myObject_p->next ) { - if ( myObject_p->type >= FIRSTPIN ) { - myFirstPin_p = myObject_p; - break; - } - } - if ( myFirstPin_p != NULL ) { // not a black box. Black boxes contain no pins. - // For each port, check for pin connection. If none, mark for deletion. - // Assumes that all ports occur at the beginning of the list - for ( myPort_p = ThisCell->cell; myPort_p != NULL && IsPort(myPort_p); myPort_p = myPort_p->next ) { - for ( myPin_p = myFirstPin_p; myPin_p != NULL; myPin_p = myPin_p->next ) { - if ( myPort_p->node == myPin_p->node ) { // only need to find one connection - break; - } - } - if ( myPin_p == NULL ) { // mark disconnected ports - myDeleteCount++; - myPort_p->node = -2; - } - } - if ( myDeleteCount > 0 ) { // delete disconnected ports - CleanupPins(name, fnum); - } - } - } return numflat; } From 4c4bad08f2885cb47ec1e2e33a2425b4adc0eca3 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Sat, 23 Oct 2021 14:47:30 -0400 Subject: [PATCH 5/5] After reverting back to before pull request #33, updated the version and re-applied the fixes from issue #34. --- VERSION | 2 +- tcltk/netgen.tcl.in | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index 137ac1e..966de6e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.203 +1.5.206 diff --git a/tcltk/netgen.tcl.in b/tcltk/netgen.tcl.in index 7c2e1e4..428dd00 100644 --- a/tcltk/netgen.tcl.in +++ b/tcltk/netgen.tcl.in @@ -609,16 +609,16 @@ proc netgen::lvs { name1 name2 {setupfile setup.tcl} {logfile comp.out} args} { } else { # Flatten the non-matching subcircuit (but not the top-level cells) if {[netgen::print queue] != {}} { - if {([lsearch $noflat [lindex $endval 1]] == -1) && + if {([lsearch $noflat [lindex $endval 0]] == -1) && ([lsearch $noflat [lindex $endval 1]] == -1)} { netgen::log put " Flattening non-matched subcircuits $endval\n" netgen::flatten class "[lindex $endval 0] $fnum1" netgen::flatten class "[lindex $endval 1] $fnum2" } else { netgen::log put " Continuing with black-boxed subcircuits $endval\n" - lappend matcherr [lindex $endval 0] + lappend matcherr [lindex $endval 0]"(1)" netgen::log put " Continuing with black-boxed subcircuits $endval\n" - lappend matcherr [lindex $endval 0] + lappend matcherr [lindex $endval 0]"(2)" # Match pins netgen::log echo off if {$dolist == 1} {