From 14251b797fa45f4ff9706bedeb488fd642b796b7 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Tue, 30 Jun 2020 18:05:12 -0400 Subject: [PATCH] Corrected readspice.tcl script to ignore CDL parameters in the subcircuit I/O list, and to not fail with an error if something in the PININFO line cannot be found in the layout (just prints an error message instead). --- tcltk/readspice.tcl | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tcltk/readspice.tcl b/tcltk/readspice.tcl index 3773aac3..aee24037 100644 --- a/tcltk/readspice.tcl +++ b/tcltk/readspice.tcl @@ -106,6 +106,10 @@ proc readspice {netfile} { set n 1 set changed false foreach pin [lrange $ftokens 2 end] { + # If "=" is in the name, then we have finished the pins + # and are looking at parameters, and so parsing is done. + if {[string first = $pin] >= 0} {break} + # Tcl "split" will not group spaces and tabs but leaves # empty strings. if {$pin == {}} {continue} @@ -177,11 +181,14 @@ proc readspice {netfile} { set infopair [split $pininfo :] set pinname [lindex $infopair 0] set pindir [lindex $infopair 1] - set pin [dict get $pindict $pinname] - case $pindir { - B {port $pin class inout} - I {port $pin class input} - O {port $pin class output} + if {![catch {set pin [dict get $pindict $pinname]}]} { + case $pindir { + B {port $pin class inout} + I {port $pin class input} + O {port $pin class output} + } + } elseif {$pinname != ""} { + puts stderr ".PININFO error: Pin $pinname not found." } } }