The stop command will add a stop point to the runop list.
stop analysis point [postcmds]When a condition is true, simulation will stop, but can be resumed, after clearing the stop point, with the resume command. The stop points can be cleared with the delete command, and listed with the status command. The panel brought up by the Trace button in the Tools menu can also be used to manipulate stop points.
The stop command is a ``runop'' similar to the measure command, and is in fact implemented internally from the same components. Analogous to measure, there is also a .stop input syntax element which uses the same syntax, which will be in force when simulating the circuit containing the line. When entered on the command line, the stop is in force for all circuits, while the runop is active.
Note that this is a different implementation of the stop command than found in WRspice-4.3.8 and earlier, which was based on the Berkeley Spice3 implementation. Although similar, the present syntax is a little different, and the command has more features and options. It does basically duplicate the effect of the measure command with the stop clause.
There are a couple of optional ``postcmd'' operations which can be performed when the stop is triggered, but before simulation ends.
The script can be used for additional processing or testing of whatever sort. If the script returns 1, the current simulation will not stop, and will continue as if the stop condition never occurred. If the script returns 2, a global error is indicated and the present analysis is terminated. If any other value is returned, or there is no explicit return, the analysis will stop as normal, and can be resumed.
If a stop command is given at the prompt in interactive mode, it is placed in the global runop list, and activity will persist until deleted (with the delete command). If the command is given in a file, the command will be added to a list for the current circuit, and will apply only to that circuit. Thus, for example, a WRspice file can contain lines like
*# stop tran when ...and the action will be performed as that circuit is run, but the ``stop tran when ... '' directive will not apply to other circuits. This is the same effect as a .stop line.