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

\epsfbox{run.eps}

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 SPICE analysis string to run. This should be in a format understandable to WRspice as an interactive-mode command. The run is then performed.

The link is established to the SPICE server 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, and WRspice is running on the local machine. 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.

An asynchronous WRspice interface is now the default for all operating systems supported with binary releases of Xic. 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.

If the variable NoAsyncSpice is set (with the !set command), the synchronous WRspice interface is used. In this case, there is no pop-up, and status is indicated in the prompt area. Pressing Ctrl-C over the controlling terminal window or over a drawing window pauses the analysis. The user should never press command buttons during an analysis if the interface is not asynchronous, as this is inviting a program crash. With the asynchronous interface, it is safe to continue working in Xic while the analysis is running.

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.

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.

To access the file data for plotting in Xic, press the run button, and enter for the analysis string ``load filename'', where filename is the name of an existing rawfile. The plot command can then be used to access the vectors as usual. When the analysis string is of the form ``load filename'', then no analysis is performed, but rather the filename (which must be a pre-existing rawfile) is loaded into WRspice. The plot command can then be used as usual to view the data in filename, if the plot data came from a previous run of the current circuit (there is no checking for consistency). It is not an error to load an inconsistent rawfile, and in fact the plot command can be used, but vector names must be entered from the keyboard.


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 2006-10-23