next up previous contents index
Next: The noise Command Up: The measure Command Previous: Post-Measurement Commands   Contents   Index


Referencing Results in Sources

It is possible to reference measurement results in sources. The referencing token has the same form as a circuit variable, with an optional index, i.e.

@result[index]
where the index, if used, is an integer that references a specific component of the result (0-based). The value is always zero for timepoints before the measurement has been performed, and a constant value afterward.

Example:

.measure tran peak from=50n to=150n max v(5)
.measure tran stuff trig v(4) val=4.5 rise=1 targ v(4) val=4.5 fall=2
+ min v(4) max v(4) pp v(4) avg v(4) rms v(4) print
vxx 1 0 @peak
vyy 2 0 @stuff[2]

In this example, during transient analysis, vxx is zero until 150 nS, where the measurement takes place, at which point it jumps to the value measured. Likewise, vyy is zero until the measurement, at which point it jumps to the third component (``pp v(4)'') result. The resulting voltages can be used elsewhere in the circuit. Note that we have two implementations of a behavioral peak detector.


next up previous contents index
Next: The noise Command Up: The measure Command Previous: Post-Measurement Commands   Contents   Index
Stephen R. Whiteley 2024-10-26