next up previous contents index
Next: The shapes Button: Add Up: The Side Menu: Geometry Previous: The round Button: Create   Contents   Index

The run Button: Run SPICE Analysis


The run button, available only in electrical mode, will establish interprocess communication with the WRspice program. If a link can not be established, the run command terminates with a message. If connection is established, then a SPICE run of the circuit is performed.

The user is first prompted for the WRspice analysis command string to run. This should be in a format understandable to WRspice as an interactive-mode command. During prompting, the last six unique analysis commands entered are available and can be cycled through with the up and down arrow keys.

The first word in the analysis string is checked, and only words from the following list will be accepted:

ac loop run tran
check noise send  
dc op sens  
disto pz tf  

The ``send'' keyword is not a WRspice command. If given, the circuit will be sent to WRspice and sourced, but no analysis is run. Other commands can be sent to WRspice with the spcmd button.

The link is established to the SPICE server (wrspiced daemon) named in the SPICE_HOST environment variable, or the SpiceHost ``!set'' variable (which overrides the environment). If neither is set, Xic will attempt to attach to WRspice on the local machine.

By default, the WRspice toolbar is visible when a connection has been established. This gives the user more control over WRspice by providing access to the visual tools. If the NoSpiceTools variable is set (with the !set command), the toolbar will not be visible.

During a simulation run, a small pop-up window appears, which contains a status message, and a Pause button. Pressing Pause will pause the analysis. It can be resumed by pressing the run button again. The analysis can also be paused by pressing Ctrl-c in the controlling terminal (xterm) window. A Ctrl-c press over a drawing window goes to Xic, where it stops redraws and other functions as usual.

Xic is notified when a run is paused from WRspice (using the red X button in the toolbar), and will change state accordingly. However, Xic is not notified when a run is restarted from WRspice (with the green triangle button in the toolbar), and will continue to assume that WRspice is inactive. In this case, commands from Xic that communicate with WRspice will pause any analysis in progress before executing. The user will have to resume the analysis manually after the operation completes, either with the run button or from the WRspice toolbar.

This affects the plot, iplot, and run buttons, and the !spcmd command. When a run is started or resumed with the run button in Xic, these features are locked out, producing a ``WRspice busy'' message, and the run in progress is not affected.

The node connectivity is recomputed, if necessary, before the run. If the variable CheckSolitary is set with the !set command, then warnings are issued if nodes with only one connection are encountered. A SPICE file is generated internally, and transmitted to WRspice for evaluation. Only devices and subcircuits that are ``connected'' will be included in the SPICE file. A device or subcircuit is connected if one of the following is true:

As a final step before sending the circuit text to SPICE, Xic will recursively expand all .include and .lib lines, replacing the .include lines with the actual file text, and the .lib lines with the indicated text block from the library. This is to handle the case where WRspice is located on a remote machine, and the user's files are on the local machine. As in WRspice, .inc is a synonym for .include, and the `h' option (strip `$' comments for HSPICE compatibility) is recognized.

The .include and .lib lines are generally inserted into the SPICE text using the spicetext label mechanism. There may be occasions where the expansion of these lines by Xic is undesirable, such as when the included file resides on the SPICE host, or one wishes to use the WRspice sourcepath variable to resolve the file. To this end, the user can use the .spinclude keyword rather than .include, and .splib rather than .lib. The .sp directives use the same syntax as the normal keywords, however Xic will not attempt to expand these directives, rather it changes the keyword to the normal directive (``.include'' or ``.lib''). Thus, WRspice will see and handle these inclusions.

WRspice release 2.2.60 and later recognize .spinclude as a synonym for .include. This allows WRspice to be able to directly source top-level cell files, where the SPICE listing may contain .spinclude lines, without syntax errors. WRspice release 2.2.62-2 and later recognize .splib as a synonym for .lib, and is able to handle .lib constructs sent from Xic.

Sometimes it may be desirable to place the output of a SPICE run initiated from Xic into a rawfile, rather than saving the output internally. To do this, use the spicetext labels to add an analysis string, such as ``spicetext .tran 1p 1000p'' (note that the `.' ahead of ``tran'' is necessary). One can also add a save command using ``spicetext *#save v(1) ...'' to save only a subset of the circuit variables. The ``*#'' means that the save is executed as a shell command, ``.save'' is ignored since WRspice is in interactive mode. Then, for the analysis string from Xic, use ``run filename'', where filename is the name for the rawfile. The run will be performed, but the output data will go to the file, so don't expect to see it with the plot command. If the filename is omitted, the run will be performed with internal storage as usual.

The !spcmd command can be used to give arbitrary commands to WRspice.

next up previous contents index
Next: The shapes Button: Add Up: The Side Menu: Geometry Previous: The round Button: Create   Contents   Index
Stephen R. Whiteley 2022-05-28