From b93c9af97c290125667ec0c402d913bdcb387f67 Mon Sep 17 00:00:00 2001 From: Stefan Frederik Date: Mon, 10 Oct 2022 17:45:56 +0200 Subject: [PATCH] flatten.awk: allow to specify additional custom devices node number with metacomments inserted in the netlist, like *.nodes[W] = 2, or *. nodes["W"]=2 --- src/flatten.awk | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/flatten.awk b/src/flatten.awk index 72bd326c..af34f48e 100755 --- a/src/flatten.awk +++ b/src/flatten.awk @@ -46,6 +46,16 @@ BEGIN{ } { if( ($0 !~/^\.include/) && ($0 !~/^\.INCLUDE/) ) $0=toupper($0) + # allow to specify *.nodes[W]=2 or *.nodes["W"] = 2 in the netlist for additional + # custom devices nodes specification. + if($0 ~/^[ \t]*\*\.[ \t]*NODES\["?[^]["]"?\][ \t]*=[ \t]*.*/) { + n_nodes = $0 + sub(/^.*=[ \t]*/, "", n_nodes) + n_initial = $0 + sub(/"?\].*/, "", n_initial) + sub(/^.*\["?/, "", n_initial) + nodes[n_initial] = n_nodes + } if($0 ~ /^\**\.SUBCKT/ && first_subckt) { topcell=$2 sub(/^\*\*/,"",$0)