Additional change to readspice script to handle various issues with

pins not matching between netlist and layout due to delimiter changes
or case sensitivity.
This commit is contained in:
Tim Edwards 2020-05-29 11:55:30 -04:00
parent 0b17bcdb86
commit bf061f0012
2 changed files with 31 additions and 3 deletions

View File

@ -1254,7 +1254,7 @@ lefWriteMacro(def, f, scale, hide)
lefWriteGeometry, (ClientData) &lc) == 1)
{
/* needHeader was set and there was something to write, */
/* so write the headr and then re-run the search. */
/* so write the header and then re-run the search. */
ispwrrail = LefWritePinHeader(f, lab);
if (ispwrrail == FALSE)

View File

@ -87,6 +87,9 @@ proc readspice {netfile} {
set n 1
set changed false
foreach pin [lrange $ftokens 2 end] {
# Tcl "split" will not group spaces and tabs but leaves
# empty strings.
if {$pin == {}} {continue}
# NOTE: Should probably check for CDL-isms, global bang
# characters, case insensitive matches, etc. This routine
@ -98,9 +101,34 @@ proc readspice {netfile} {
# name, only the one triggered by "goto" will be made into
# a port.
set pinidx [port $pin index]
set testpin $pin
set pinidx [port $testpin index]
# Test a few common delimiter translations. This list
# is by no means exhaustive.
if {$pinidx == ""} {
set testpin [string map {\[ < \] >]} $pin
set pinidx [port $testpin index]
}
if {$pinidx == ""} {
set testpin [string map {< \[ > \]} $pin
set pinidx [port $testpin index]
}
# Also test some case sensitivity issues (also not exhaustive)
if {$pinidx == ""} {
set testpin [string tolower $pin]
set pinidx [port $testpin index]
}
if {$pinidx == ""} {
set testpin [string toupper $pin]
set pinidx [port $testpin index]
}
if {$pinidx != ""} {
port $pin index $n
port $testpin index $n
if {$pinidx != $n} {
set changed true
}