next up previous contents index
Next: Analysis Specification Up: Subcircuits Previous: .ends Line   Contents   Index


Subcircuit Calls

General Form:
xname n1 [n2 n3 ...] subnam [param1=val1 param2=val2 ...]
Example:
x1 2 4 17 3 1 multi

Subcircuits are used in WRspice by specifying pseudo-elements beginning with the letter `x' or `X', followed by the circuit nodes to be used in expanding the subcircuit.

Note that when a circuit is parsed, all devices and local nodes in subcircuits are renamed as devicetype:subcktname:devicename. Nested subcircuit instances will have multiple colon-separated qualifiers. WRspice will also accept subcircuit names with components separated by periods, so long as the names do not clash with vector names specifiable as plotname.value.

The names and default values of the params are specified in the .subckt line. During subcircuit expansion, the param tokens are replaced by their corresponding value tokens in the text. If a list of params is given in the subcircuit instantiation line, those values will supersede the defaults in that subcircuit instance, and parameters set in .param lines.

Example:
.subckt resistor 1 2 resis=1k
r1 1 2 resis
.ends

x1 3 4 resistor resis = 500
x2 5 6 resistor
x3 7 8 resistor resis=2k


next up previous contents index
Next: Analysis Specification Up: Subcircuits Previous: .ends Line   Contents   Index
Stephen R. Whiteley 2006-10-23