From 62d035214917779ebf7c3a0ed60f9b98b9f3611d Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Fri, 19 Mar 2021 09:41:42 -0400 Subject: [PATCH 1/3] Modified the "-noflatten" command option to "lvs" so that it can be given a filename as a value in addition to being passed a list of cells directly. --- VERSION | 2 +- tcltk/netgen.tcl.in | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index b707fed..d683ffe 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.172 +1.5.173 diff --git a/tcltk/netgen.tcl.in b/tcltk/netgen.tcl.in index e3ac928..69aff27 100644 --- a/tcltk/netgen.tcl.in +++ b/tcltk/netgen.tcl.in @@ -389,8 +389,23 @@ proc netgen::lvs { name1 name2 {setupfile setup.tcl} {logfile comp.out} args} { puts stdout "Treating empty subcircuits as black-box cells" netgen::model blackbox on } elseif {[string first "-noflatten=" $arg] == 0} { - set noflat [string trim [string range $arg 11 end] \"\{\}] - puts stdout "Will not flatten these subcells: $noflat" + set value [string range $arg 11 end] + # If argument is a filename then read the list of cells from it; + # otherwise, argument is the list of files itself in quotes or + # braces. + if {![catch {file exists $value}]} { + if {![catch {open $value r} fnf]} { + while {[gets $fnf line] >= 0} { + lappend noflat $line + } + close $fnf + } else { + puts stderr "Cannot open file $value for reading cell list." + } + } else { + set noflat [string trim $value \"\{\}] + puts stdout "Will not flatten these subcells: $noflat" + } } } From 330b34139cd235f8d419ff51b645758e9c1579f6 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Fri, 19 Mar 2021 10:51:42 -0400 Subject: [PATCH 2/3] Slight modification to print the list of cells being forced to match for both the filename option and immediate list. --- tcltk/netgen.tcl.in | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tcltk/netgen.tcl.in b/tcltk/netgen.tcl.in index 69aff27..ce3215f 100644 --- a/tcltk/netgen.tcl.in +++ b/tcltk/netgen.tcl.in @@ -395,15 +395,21 @@ proc netgen::lvs { name1 name2 {setupfile setup.tcl} {logfile comp.out} args} { # braces. if {![catch {file exists $value}]} { if {![catch {open $value r} fnf]} { - while {[gets $fnf line] >= 0} { - lappend noflat $line - } - close $fnf + while {[gets $fnf line] >= 0} { + if {[lindex $line 0] != "#"} { + foreach cell $line { + lappend noflat $cell + } + } + } + close $fnf } else { puts stderr "Cannot open file $value for reading cell list." } } else { set noflat [string trim $value \"\{\}] + } + if {[llength $noflat] > 0} { puts stdout "Will not flatten these subcells: $noflat" } } From 0a2adeb5931f92697ab9f7451c7010b19c58ce92 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Fri, 19 Mar 2021 13:57:11 -0400 Subject: [PATCH 3/3] Modified the "flatten" command to allow class "module" to be flattened. This is marginally useful---since the "module" class is a black box, it is essentially the same as using the "ignore" command. --- base/flatten.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/flatten.c b/base/flatten.c index 1f278ba..f53e16e 100644 --- a/base/flatten.c +++ b/base/flatten.c @@ -319,7 +319,7 @@ int flattenInstancesOf(char *name, int fnum, char *instance) Printf(" Flattening instance: %s, primitive = %s\n", ParentParams->instance.name, (ChildCell->class == CLASS_SUBCKT) ? "no" : "yes"); - if (ChildCell->class != CLASS_SUBCKT) { + if ((ChildCell->class != CLASS_SUBCKT) && (ChildCell->class != CLASS_MODULE)) { LastObj = ParentParams; continue; }