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

Parameter Soft Limits (param_limits)

Description

The parameter values passed to Spectre components and analysis are subject to both hard and soft limits. If you set a parameter to a value that violates a hard limit, such as giving z0=0 to a transmission line, Spectre issues an error message and quits. If the given parameter value violates a soft limit, a warning is issued, but Spectre uses the value of the component as given. Hard limits are used to prevent you from using values that would cause Spectre to fail or put a model in an invalid region. Soft limits are used to call attention to unusual parameter values that might have been given mistakenly. If a parameter value violates a soft limit, a message similar to one of the following sample messages is printed:

Parameter rb has the unusually small value of 1uOhms.

or

Parameter rb has the unusually large value of 1MOhms.

Spectre has built-in soft limits on a few parameter values. However, it is possible for you to override these limits or to provide limits on parameters that do not have built-in limits. To do so, create a parameter range limits file and run Spectre by providing the name of the file after the +param command-line option. For example:

spectre +param limits-file input-file

Limits are specified using the following syntax:

[PrimitiveName] [model] [LowerLimit <[=]] [|]Param[|] [<[=] UpperLimit]

The limits can be given as strict (using <=) or nonstrict (using <). If the limits are strict, there can be no space between < and =. The limits for one parameter are given on one line. There is no way of continuing the specification of the limits for a parameter over more than one line. If a parameter is specified more than once, the limits specified at last override the earlier limits. The primitive name must be a Spectre primitive name, and not a name used for SPICE compatibility. For example, mos3 must be used instead of mos. Parameter limits can be written using Spectre native mode metric scale factors. Therefore, a limit of f <= 1.0e6 can also be written as f <= 1M.

Examples

mos3       0.5u <= l <= 100u
0.5u <= w
0 < as <= 1e-8
0 < ad <= 1e-8
model |vto| <= 3

It is not necessary to specify the primitive name each time. If the primitive name is not specified, it is assumed to be the same as the previous parameter. Upper and lower limits may be specified, but if these are not specified, there is no limit on the parameter value. Therefore, in the example, if w is less than 0.5um, a warning is issued, but there is no limit on how large w can be. If a parameter is mentioned, but no limits are given, all limits are disabled for that parameter. Limits are placed on model parameters by giving the model keyword. If the model keyword is not given, the limits are applied to instance parameters. Notice that you can also place upper or lower limits on the absolute value of a parameter. For example:

resistor 0.1 < |r| < 1M

indicates that the absolute value of r should be greater than 0.1 Ohm and less than 1 MOhm. There can be no spaces between the absolute value symbols and the parameter name.

Examples

1 <= x < 0.5
1 <= y <= 1
1 < z < 1

In the first case, the lower bound is larger than the upper bound, which indicates that the range of x is all real numbers, except those from 0.5 to 1, including 0.5. The limits are applied separately, therefore, x must be both greater than or equal to 1 (1 <= x) and less than 0.5 (x < 0.5). The second case specifies that y should be 1, and the third case specifies that z should not be 1.

It is possible to specify limits for any scalar parameter that takes a real number, an integer, or an enumeration. To specify the limits of a parameter that takes enumerations, use the indexes associated with the enumerations. For example, consider the region parameter of the bjt. There are four possible regions: off, fwd, rev, and sat (see spectre -help bjt). Each enumeration is assigned a number starting at 0 and counting up. Therefore, off=0, fwd=1, rev=2, and sat=3. The specification bjt 3 <= region <= 1 indicates that a warning should be printed if region=rev because the conditions (3 <= region) and (region <= 1) exclude only (region=2) and region 2 is rev.

It is possible to read a parameter limits file from within another file. To do so, use an include statement. For example,

include "filename"

temporarily suspends the reading of the current file until the contents of filename have been read. Include statements may be nested arbitrarily deep with the condition that the operating system may limit the number of files that Spectre may have open at once. Paths in file names are taken to be relative to the directory that contains the current file, and not from the directory from which Spectre was run.

Spectre can be instructed to always read a parameter limits file by using the SPECTRE_DEFAULTS environment variable. For example, if you put the following in you shell initialization file (.profile for sh, .cshrc for csh)

setenv SPECTRE_DEFAULTS "+param /cds/etc/spectre/param.lmts"

Spectre always reads the specified limits file.

For more information, see Selecting Limits for Parameter Value Warning Messages in the Spectre Classic Simulator, Spectre APS, Spectre X, and Spectre XPS User Guide.


Return to top
 ⠀
X