Product Documentation
Spectre Circuit Simulator Reference
Product Version 23.1, September 2023

Netlist Parameters (parameters)

Description

The Spectre native netlist language allows parameters to be specified and referenced in the netlist, both at the top-level scope and within subcircuit declarations (run spectre -h subckt for more details on parameters within subcircuits).

Definition

parameters <param=value> [param=value]...

Examples:

simulator lang=spectre
parameters p1=1 p2=2            // declare some parameters
r1 (1 0) resistor r=p1          // use a parameter, value=1
r2 (1 0) resistor r=p1+p2       // use parameters in an expression, value=3
x1 s1 p4=8      // "s1" is defined below, pass in value 8 for "p4"
subckt s1
parameters p1=4 p3=5 p4=6       // note: no "p2" here, p1 "redefined"
r1 (1 0) resistor r=p1          // local definition used: value=4
r2 (1 0) resistor r=p2          // inherit from parent(top-level) value=2
r3 (1 0) resistor r=p3          // use local definition, value=5
r4 (1 0) resistor r=p4          // use passed-in value, value=8
r5 (1 0) resistor r=p1+p2/p3    // use local+inherited/local = (4+2/5) = 4.4
ends
time_sweep tran start=0 stop=(p1+p2)*50e-6 // use 5*50e-6 = 150 us
dc_sweep dc param=p1 values=[0.5 1 +p2 (sqrt(p2*p2)) ]  // sweep p1 

Parameter Declaration

Parameters can be declared anywhere in the top-level circuit description or on the first line of a subcircuit definition.  Multiple parameters can be declared on a single line. When parameters are declared in the top-level, their values must be specified. When parameters are declared within subcircuits, their default values are optionally specified.

Parameter Inheritance

Subcircuit definitions inherit parameters from their parent (enclosing subcircuit definition or top-level definition). This inheritance continues across all levels of nesting of subcircuit definitions, that is, if a subcircuit s1 is defined, which itself contains a nested subcircuit definition s2, then any parameters accessible within the scope of s1 are also accessible from within s2. In addition, any parameters declared within the top-level circuit description are also accessible within both s1 and s2. However, any subcircuit definition can redefine a parameter that it has inherited. In this case, if no value is specified for the redefined parameter when the subcircuit is instantiated, the redefined parameter uses the locally defined default value, rather than inheriting the actual parameter value from the parent.

Parameter Referencing

Spectre netlist parameters can be referenced anywhere. A numeric value is normally specified on the right-hand side of an "=" sign or within a vector, where the vector itself is on the right-hand side of an "=" sign. This includes referencing of parameters in expressions (run spectre -h expressions for more details on netlist expression handling), as indicated in the preceding examples. You can use expressions containing parameter references when specifying device or analysis instance parameter values (for example, specifying the resistance of a resistor or the stop time of a transient analysis, as outlined in the preceding example), when specifying model parameter values in model cards (for example, specifying bf=p1*0.8 for a bipolar model parameter bf), or when specifying initial conditions and nodesets for individual circuit nodes.

Altering/Sweeping Parameters

Just as certain Spectre analyses (for example, sweep, alter, ac, dc, noise, sp, xf) can sweep device instance or model parameters, they can also sweep netlist parameters. Run spectre -h <analysis> to view the details for any of these analyses, where <analysis> is the analysis of interest.

Temperature as a Parameter

You can use the reserved parameters temp and tnom anywhere an expression can be used, including within expressions and user-defined functions. The temp parameter always represents the simulator (circuit) temperature, and tnom always represents the measurement temperature. All expressions involving temp or tnom are re-evaluated everytime the circuit temperature or measurement temperature changes.

You can also alter or sweep the temp and tnom parameters by using any of the techniques available for altering or sweeping the netlist or subcircuit parameters (with the exception of s).

This capability allows you to write temperature dependent models, for example, by using temp in an equation for a model or an instance parameter. For example:

r1 1 0 res r=(temp-tnom)*15+10k // temp is temperature
o1 options temp=55      // causes a change in above resistor r1

Reserved Parameters

The following parameters are reserved and must not be declared as either top-level parameters or subcircuit parameters: temp, tnom, scale, scalem, freq, time.

For additional information, refer to the Parameters Statement section in the Spectre Classic Simulator, Spectre APS, Spectre X, and Spectre XPS User Guide.


Return to top
 ⠀
X