.PARAM

In this Topic Hide

.PARAM parameter_name [=] parameter_value [parameter_name [=] parameter_value]...
.PARAM parameter_name [=] AGAUSS(nominal, abs_variation, sigma, [multiplier]) ...
.PARAM parameter_name [=] AUNIF(nominal, abs_variation, [multiplier]) ...
.PARAM parameter_name [=] GAUSS(nominal, rel_variation, sigma, [multiplier]) ...
.PARAM parameter_name [=] UNIF(nominal, rel_variation, [multiplier]) ...

Defines a simulation variable for use in an expression. Expressions may be used to define device parameters, to define model parameters, for arbitrary sources and to define variables themselves. See Using Expressions for details.

The syntax for the first form is described below. For details of the remaining forms (using AGAUSS, AUNIF, GAUSS and UNIF) see Hspice Distribution Functions.

parameter_name Sequence of alpha-numeric characters. Must begin with a letter or underscore. May not contain spaces.
parameter_value Either:

A constant

OR

An expression enclosed by '{' and '}'. See Using Expressions.

Examples

.PARAM Vthresh = 2.4
.PARAM Vthresh = {(Vhigh+Vlow)/2}
.PARAM F0 1k Alpha 1 C1 {2*c2}
.PARAM R1 {2/(2*pi*freq*C1*alpha}

Netlist Order

apply in subcircuits). .PARAM statements that are defined as an expression that depends on other .PARAMs also defined as an expression must be placed in sequential order. For example, the following is OK:

.PARAM C2 {C1*alpha*alpha/4}
.PARAM C1 1n
.PARAM alpha 1
.PARAM R1 {2/(2*PI*F0*C2*alpha}

The first .PARAM depends on alpha and C1 which are defined later in netlist. This is OK (as long as it is not in a subcircuit) because icode{alpha} and C1 are constants. The fourth .PARAM depends on C2, which is defined as an expression. The definition for must - and does in the above example - come before the definition of R1. The following would yield an error as the definition for C2 comes after the definition of R1:

.PARAM R1 {2/(2*PI*F0*C2*alpha}
.PARAM C1 1n
.PARAM alpha 1
.PARAM C2 {C1*alpha*alpha/4}

Note that .PARAMs inside subcircuits are local to the subcircuit. This is explained in next section.

Subcircuit Parameters

Parameters may be declared within sub circuits. E.g

.subckt ADevice n1 n2 n3 n4
.PARAM Vthresh 3.5
...
...
ends

In the above example, in reference to Vthresh within the subcircuit would use the value declared by the .PARAM declared inside the subcircuit. That value would not be available outside the subcircuit definition. Parameters may also be passed to subcircuits. E.g.

X1 1 2 3 4 ADevice : threshold=2.4

or

X1 1 2 3 4 ADevice params: threshold=2.4

Any reference to threshold within the subcircuit definition would use that value.

Default values for parameters may also be specified in subcircuit definition:

.subckt ADevice n1 n2 n3 n4 params: threshold=2.4
...
.ends

If that subcircuit is called without specifying threshold the default value of 2.4 will be used. Note that it is not compulsory to declare default values.

Using .PARAM in Schematics

.PARAM in Libraries