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.
When a circuit is parsed, all devices and local nodes in subcircuits are renamed as
devicetype[sep]subcktname[sep]devicename,where [sep] is a separation character. In SPICE3 and WRspice prior to release 3.2.4, this was the colon (`:') character. However, this choice can lead to conflicts and parser trouble due to the use of the colon in the ternary conditional operator a?b:c. In release 3.2.4, the separation character was changed to the underscore (`_').
The character employed can be set from the shell with the shell variable subc_catchar. If this variable is set to a string consisting of a single punctuation character, then this character becomes the [sep] character.
Nested subcircuit instances will have multiple [sep]-separated qualifiers.
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.