Assume in this section that the pstr1 and pstr2 parameter specification strings do not appear, then the the shell variables value1 and value2, which are accessible in the circuit as $value1 and $value2, are incremented, as in operating range analysis. This is the behavior of the historic loop command. As in operating range analysis, there are various related ways of introducing the variations.
set value1 = foo1 value2 = foo2
The most important example is temperature sweeping, using the temp option. A temperature sweep would look like
sweep -50 50 25 analysis
This will run the analysis at -50, -25, 0, 25, and 50 Celsius.
let vec = 0
let checkN1 = 5 checkN2 = 6
set value = vec
The first line creates a vector named ``vec'' of size sufficient to contain the indices. The iterated values will be placed in vec and vec. The circuit should reference these values, either through shell substitution (e.g., $&vec) or directly as vectors.
Alternatively, a variable named ``checkN1'' can be set. If the value of this variable is an integer, that integer will be used as the index. If the variable is a name token, then the index will be supplied by a vector of the given name. The same applies to checkN2. The following example illustrates these alternatives:
let vec = 0
set checkN1 = 5
let foo = 6
set checkN2 = foo
set &vector = value
it is possible to iterate vectors with the sweep command. The form above is equivalent to
let vector = value
Note, however, that the `&' character has special significance to the WRspice shell, so when this form is given on the command line the ampersand should be quoted, e.g., by preceding it with a backslash.
Thus, suppose that the circuit depends on a vector named delta. One can set up iteration using this vector as
set value1 = '&delta'
where devname is the name of a device or model in the circuit, and param is one of the parameter keywords for the device or model. These keywords can be listed with the show command.
For example, if the circuit contains a MOS device m1 one might have
set value1 = '&@m1[w]'
sweep 1.0u 2.0u 0.25u analysis
This will perform the analysis while varying the m1 w (device width) parameter from 1.0 to 2.0 microns in 0.25 micron increments.