better node multiplicity detection in spice and verilog awk netlist post-processors (\?-?[0-9]+)

This commit is contained in:
Stefan Schippers 2020-10-16 00:13:39 +02:00
parent 742f854964
commit 35c2d0fa93
4 changed files with 14 additions and 16 deletions

View File

@ -212,7 +212,7 @@ function process( i, iprefix)
# .probe tran v( ?1 DL[3],DL[2],DL[1],DL[0] , ?1 WL[3],WL{2],WL[1],WL[0] ) # .probe tran v( ?1 DL[3],DL[2],DL[1],DL[0] , ?1 WL[3],WL{2],WL[1],WL[0] )
if($1 ==".probe" && $4 ~/^\?[0-9]+$/ && $7 ~/^\?[0-9]+$/ && NF==9) { if($1 ==".probe" && $4 ~/^\?-?0-9]+$/ && $7 ~/^\?-?[0-9]+$/ && NF==9) {
num1=split($5,name,",") num1=split($5,name,",")
num2=split($8,name2,",") num2=split($8,name2,",")
@ -222,7 +222,7 @@ function process( i, iprefix)
} }
# .save v( ?1 DL[3],DL[2],DL[1],DL[0] , ?1 WL[3],WL{2],WL[1],WL[0] ) # .save v( ?1 DL[3],DL[2],DL[1],DL[0] , ?1 WL[3],WL{2],WL[1],WL[0] )
} else if($1 ==".save" && $3 ~/^\?[0-9]+$/ && $6 ~/^\?[0-9]+$/ && NF==8) { } else if($1 ==".save" && $3 ~/^\?-?[0-9]+$/ && $6 ~/^\?-?[0-9]+$/ && NF==8) {
num1=split($4,name,",") num1=split($4,name,",")
num2=split($7,name2,",") num2=split($7,name2,",")
@ -233,13 +233,13 @@ function process( i, iprefix)
# .probe tran v( ?1 LDY1_B[1],LDY1_B[0] ) # .probe tran v( ?1 LDY1_B[1],LDY1_B[0] )
} else if($1 ==".probe" && $4 ~/^\?[0-9]+$/ && NF==6) { } else if($1 ==".probe" && $4 ~/^\?-?[0-9]+$/ && NF==6) {
num=split($5,name,",") num=split($5,name,",")
for(i=1;i<=num;i++) { for(i=1;i<=num;i++) {
print $1 " " $2 " " $3 " " name[i] " " $6 print $1 " " $2 " " $3 " " name[i] " " $6
} }
# .save v( ?1 LDY1_B[1],LDY1_B[0] ) # .save v( ?1 LDY1_B[1],LDY1_B[0] )
} else if($1 ==".save" && $3 ~/^\?[0-9]+$/ && NF==5) { } else if($1 ==".save" && $3 ~/^\?-?[0-9]+$/ && NF==5) {
num=split($4,name,",") num=split($4,name,",")
for(i=1;i<=num;i++) { for(i=1;i<=num;i++) {
print $1 " " $2 " " name[i] " " $5 print $1 " " $2 " " name[i] " " $5
@ -277,7 +277,7 @@ function process( i, iprefix)
for(j=2;j<=NF;j+=1) # start from 2 not from 3 20070221 for(j=2;j<=NF;j+=1) # start from 2 not from 3 20070221
{ {
if($j ~/^\?[0-9]+$/) continue # handle the case that $2 not pinlist 20070221 if($j ~/^\?-?[0-9]+$/) continue # handle the case that $2 not pinlist 20070221
arg_num[j]=split($j,tmp,",") arg_num[j]=split($j,tmp,",")
for(k=1;k<=arg_num[j]; k++) { for(k=1;k<=arg_num[j]; k++) {
arg_name[j,k]=tmp[k] arg_name[j,k]=tmp[k]
@ -289,7 +289,7 @@ function process( i, iprefix)
for(j=2;j<=NF;j++) for(j=2;j<=NF;j++)
{ {
if($j !~ /^\?[0-9]+$/) if($j !~ /^\?-?[0-9]+$/)
{ {
printf "%s ", $j # if not a node just print it printf "%s ", $j # if not a node just print it
} }

View File

@ -245,7 +245,7 @@ begin_module && $1 ~/^\);$/ {
{ {
pin="" pin=""
if(j>7) {printf ","} if(j>7) {printf ","}
if($j !~ /^\?[0-9]+$/) if($j !~ /^\?-?[0-9]+$/)
{ {
pin=pin $j # if not a node just print it pin=pin $j # if not a node just print it
} }

View File

@ -2657,10 +2657,8 @@ proc abs_sym_path {fname {ext {} } } {
return "$fname" return "$fname"
} }
} }
if { $::OS ne {Windows}} { # transform a/b/../c to a/c or a/b/c/.. to a/b
# transform a/b/../c to a/c or a/b/c/.. to a/b while {[regsub {([^/]*\.*[^./]+[^/]*)/\.\./?} $fname {} fname] } {}
while {[regsub {([^/]*\.*[^./]+[^/]*)/\.\./?} $fname {} fname] } {}
}
# remove trailing '/'s to non empty path # remove trailing '/'s to non empty path
regsub {([^/]+)/+$} $fname {\1} fname regsub {([^/]+)/+$} $fname {\1} fname
# if fname copy tmpfname is ../../e/f # if fname copy tmpfname is ../../e/f
@ -2679,9 +2677,7 @@ proc abs_sym_path {fname {ext {} } } {
} else { set tmpfname "${tmpdirname}/$tmpfname" } } else { set tmpfname "${tmpdirname}/$tmpfname" }
if { [file exists "$tmpfname"] } { return "$tmpfname" } if { [file exists "$tmpfname"] } { return "$tmpfname" }
## should we return path if directory exists ? ## should we return path if directory exists ?
if { $::OS ne {Windows} } { if { [file exists [file dirname "$tmpfname"]] } { return "$tmpfname" }
if { [file exists [file dirname "$tmpfname"]] } { return "$tmpfname" }
}
} }
# remove any leading './' # remove any leading './'
while { [regsub {^\./} $fname {} fname] } {} while { [regsub {^\./} $fname {} fname] } {}

View File

@ -1,5 +1,7 @@
v {xschem version=2.9.5_RC5 file_version=1.1} v {xschem version=2.9.8 file_version=1.2}
G {type=netlist_options G {}
K {type=netlist_options
template="name=n1"
} }
V {} V {}
S {} S {}