Stefan Schippers
05/24/2021, 10:00 PM@pinlist
in the symbol '`format="..."`' attribute then the order is the creation order of the symbol pins. You can change this order: select a pin you want to be netlisted first (the small red square) in a symbol, press 'Shift-S' and set it's sequence number to zero (first pin). Then select the pin you want to be netlisted in second position , set it's sequence number to 1, and so on (see picture).
A more flexible approach is to replace the @pinlist
attribute with the explicit order of pins: for example for a NAND2 gate (inputs A,B, output Z) the format string should be something like: format="@name @@A @@B @@Z @model ..."
or (for a subcircuit) format="@name @@A @@B @@Z @symname"
. This way you get rid of any ordering of pins in the symbol. The @@X
syntax means: "put the name of the net attached to the '`X`' pin'. The .subckt declaration and the instance call (X line) will consistently have the same and matching pin ordering.