Using Algebraic Expressions 1

You can replace any parameter defined in the netlist by an algebraic expression with quoted strings. Then, these expressions may be used as output variables in the .PLOT, .PRINT, and .GRAPH statements. Using algebraic expressions can expand your options in the input netlist file. Some usages of algebraic expressions are

.PARAM x = 'y+3'

.PARAM rho(leff,weff) = '2+*leff*weff-2u'

R1 1 0 r = 'ABS(v(1)/i(m1))+10'

.MEAS vmax MAX V(1)
.MEAS imax MAX I(q2)
.MEAS ivmax PARAM = 'vmax*imax'

.PRINT conductance = PAR(`i(m1)/v(22)')

Algebraic Expressions for Output

Syntax

PAR(`algebraic expression')

In addition to using quotations, the expression must be defined inside the PAR( ) statement for output.The continuation character for quoted parameter strings is a double backslash, "\\". (Outside of quoted strings, the single backslash, "\", is the continuation character.)


1. Star-Hspice uses double-precision numbers (15 digits) for expressions, user-defined parameters, and sweep variables. For better precision, use parameters instead of constants in algebraic expressions, since constants are only single-precision numbers (7 digits).

Star-Hspice Manual - Release 2001.2 - June 2001