Setting Up Different Port References for a SPICE Network

Define SPICE files with an absolute or relative port reference for a SPICE network.

Example of a SPICE file with an absolute port reference

A SPICE example of pi-network using an absolute port reference (each port is referenced to the SPICE global ground n0). The total number of output nodes is equal to the amount of network terminals when creating a general network.


Figure 1. Example of a circuit using an absolute reference (node 0).
* Subcircuit PI Network
.SUBCKT PINETWORK n1 n2 
R1 n1 0 290
R2 n1 n2 18
R3 n2 0 290
.ENDS   PINETWORK

.SUBCKT NWN1 n1 n2 (absolute port reference)
X1 n1 n2 PINETWORK
.ENDS NWN1
.END

Example of a SPICE file using an relative port reference

A SPICE example of a pi-network using a relative port reference, exposing the negative and positive pins of each terminal in the network. The total number of output nodes is double the amount of network terminals.


Figure 2. Example of a circuit using an relative reference.
* Subcircuit PI Network
.SUBCKT PINETWORK n1 n2 n3
R1 n1 n3 290
R2 n1 n2 18
R3 n2 n3 290
.ENDS   PINETWORK

.SUBCKT NWN1 n1p n1m n2p n2m (relative port reference)
X1 n1p n2p n1m PINETWORK
R1 n1m n2m 0
.ENDS NWN1
.END