form 1:
trig|targ at=value
form 2:
trig|targ variable [val=]value [td=delay] [cross=crosses] [rise=rises] [fall=falls]
form 3:
trig|targ when expr1=expr2 [td=delay] [cross=crosses] [rise=rises] [fall=falls]
Separate specifications for trig/targ are used to specify the boundaries of the measurement interval in the .measure statement.
Form 1 is straightforward; the interval starts (trig) or ends (targ) at value. Value must be within the simulation range of the scale variable (e.g., time in transient analysis).
The same effect can be achieved with:
from=value to=valueThe from keyword is equivalent to ``trig at'', the to keyword is equivalent to ``targ at''.
Form 2 allows the interval boundaries to be referenced to times when a variable crosses a threshold. The variable can be any vector whose value is available during simulation. The value is a constant which is used to measure crossing events. The val= which precedes the value is optional. At least one of the rise/fall/cross fields should be set. Their values are integers which represent the variable crossing the threshold a number of times. The rise indicates the variable rising through the threshold, fall indicates the variable decreasing from above to below the threshold, and cross indicates rises + falls. The interval boundary is set when the specified number of transitions is reached.
If the delay is specified, transition counting starts after the specified delay.
This indicates that the interval begins at the second time v(2) rises above 2.5V after 0.1ns.
The third form is similar to the second form, except that crossings are defined when expr1 = expr2. These are expressions, which must be enclosed in parentheses if they contain white space or commas. A rise is defined as expr1 going from less than to greater than expr2.
Note: In previous releases, it was recommended that single quotes be used to delimit complicated expressions. This will not work in the present WRspice release, since single quoted expressions are evaluated before simulation. Instead, the expression should be surrounded by parentheses. For example, a form such as ``'v(1) - v(2)''' must be changed to ``(v(1) - v(2))''.
A point can be specified with a trig or from specification as for an interval. One can also use the following form:
when expr1=expr2 [td=delay] [cross=crosses] [rise=rises] [fall=falls]
This works exactly as in ``trig when''.