next up previous contents index
Next: .param Line Up: Parameters and Expressions Previous: Parameters and Expressions   Contents   Index


Single-Quoted Expressions

Text enclosed in single quotes (') will be evaluated as an expression as the file is read and the string will be replaced by the result. This will occur throughout the SPICE text, with the exception of .measure lines, where single-quotes are traditionally (i.e., in HSPICE) used as expression delimiters.

Single-quoted expressions outside of .subckt blocks are expanded before variable substitution and subcircuit expansion. In this case, since evaluation is performed before shell substitution, the expression can not contain shell variables or other `$' references. Single-quoted expressions that appear within .subckt blocks are evaluated after variable substitution during subcircuit expansion. Thus, these expressions can contain shell '$' constructs.

In general, single-quoted expressions can not contain vectors other than those defined in the constants plot and ``temper''. If a vector reference such as ``v(1)'' is found in a single-quoted expression being evaluated, the expression will be parameter expanded as much as possible, but left in the form of an expression. Thus, the construct can appear only where an expression is expected by the circuit parser, such as for the definitions of resistance and capacitance for resistor and capacitor devices.

If the single-quoted expression appears to the left of an '=' sign, as an assignment, no substitution is done. In this case, the quotes are ignored.


next up previous contents index
Next: .param Line Up: Parameters and Expressions Previous: Parameters and Expressions   Contents   Index
Stephen R. Whiteley 2024-10-26