From ec57806816cb15965ac99fbd0b2b27cd556014b6 Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Fri, 30 May 2025 21:16:48 +0200 Subject: [PATCH] =?UTF-8?q?spice.awk:=20allow=20to=20expand=20nodes=20plac?= =?UTF-8?q?ed=20after=20an=20=3D=20sign=20as=20in=20some=20cdl=20netlists:?= =?UTF-8?q?=20$SUB=3D@@B=20-->=20$SUB=3D=3F1=20B=20-->=20spice.awk=20-->?= =?UTF-8?q?=20$SUB=3DB?= --- src/spice.awk | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/spice.awk b/src/spice.awk index 415b9775..e80ec34c 100755 --- a/src/spice.awk +++ b/src/spice.awk @@ -303,7 +303,8 @@ function process( i,j, iprefix, saveinstr, savetype, saveanalysis) for(j=2;j<=NF;j+=1) # start from 2 not from 3 20070221 { # ............ --> matches ?n and ?-n - if($j ~/^\?-?[0-9]+$/) continue # handle the case that $2 not pinlist 20070221 + # some CDL netlists have this: $SUB=?1 B where B is a node + if($j ~/^(.*=)?\?-?[0-9]+$/) continue # handle the case that $2 not pinlist 20070221 arg_num[j]=split($j,tmp,",") for(k=1;k<=arg_num[j]; k++) { arg_name[j,k]=tmp[k] @@ -316,14 +317,20 @@ function process( i,j, iprefix, saveinstr, savetype, saveanalysis) for(j=2;j<=NF;j++) { # ............ --> matches ?n and ?-n - if($j !~ /^\?-?[0-9]+$/) + # some CDL netlists have this: $SUB=?1 B where B is a node + if($j !~ /^(.*=)?\?-?[0-9]+$/) { printf "%s ", $j # if not a node just print it } else { + nmult=$(j) + if(nmult ~ /^(.*=)/) { # some CDL netlists have this: $SUB=?1 B where B is a node + sub(/=.*/, "=", nmult) + printf "%s", nmult + } nmult=$(j++) - sub(/\?/,"",nmult) + sub(/(.*=)?\?/,"",nmult) if(nmult+0==-1) nmult=arg_num[j] for(l=0;l