next up previous contents index
Next: File Menu Up: Xic Variables Previous: Side Menu Commands   Contents   Index


SPICE Interface

The following !set variables affect the interface to the WRspice simulator, and SPICE output in general.

SpiceListAll
Value: boolean.
When set, all devices and subcircuits in the schematic will be included in SPICE output. Otherwise, only devices and subcircuits that are ``connected'' will be included, as explained in the deck and run command descriptions.

SpiceAlias
Value: string.
This variable is set to a string which will modify the printing of device names in SPICE output. The aliasing operates on the first token of device lines. The format of the value string is
prefix1=newprefix1 prefix2=newprefix2 ...
This will cause lines beginning with prefix to have prefix replaced with newprefix. If the ``=newprefix'' is omitted, that line will not be printed. For example, to map all devices that begin with `B' to `J', and to suppress all `G' devices, the full command is
!set SpiceAlias B=J G.
Note that there can be no space around the `='. After this command is given, the indicated mappings will be performed as SPICE text is produced.

SpiceHost
Value: host name string.
This will set the name of the host which maintains a server for remote WRspice runs. If set, this will override the value of the SPICE_HOST environment variable. The host name specified in the SPICE_HOST environment variable and the SpiceHost !set variable can have a suffix ``:portnum'', i.e., a colon followed by a port number. The port number is the port used by the wrspiced program on the specified server, which defaults to 6114, the IANA registered port for this service. If the server uses a non-standard port, and the wrspice/tcp service has not been registered (usually in the /etc/services file) on this port, the port number must be provided.

SpiceHostDisplay
Value: X display string.
This variable can be set to the X display string to use on a remote host for running WRspice through a wrspiced daemon, from Xic in electrical mode. It is intended to facilitate use of ssh X forwarding to take care of setting up permission for the remote host to draw on the local display.

The variable is set automatically from the !ssh command, or can be set by hand.

When using a remote host, this specifies the X display string to use, which is needed for running graphics. If not set, a display name will be created as follows: If the local DISPLAY variable is something like ``:0.0'', the remote display name will be ``localhostname:0.0''. If the local DISPLAY variable is already in the form ``localhostname:0.0'', this is passed verbatim.

One can use ssh transport for the X connection on the remote system as follows. Use ``ssh -X'' to open a shell on the remote machine. Type ``echo $DISPLAY'' into this window, it will print something like ``localhost:10.0''. Use this value for SpiceHostDisplay. The !ssh command will set the variable automatically. The shell must remain open while running WRspice, exiting the shell will close the X connection.

This will work under Windows, if Cygwin is installed, along with the OpenSSH package (for the ssh command) and the Cygwin X server. One weirdness: use ``ssh -Y'' instead of ``ssh -X''. The -Y option, which applies to recent ssh versions, is similar to -X, but overcomes stronger security checks included in recent ssh implementations. This seems to be necessary when using the Cygwin X server.

Background

In legacy X-window systems, the display name would typically be in the form hostname:0.0, where the hostname could be (and usually is) missing. A remote system will draw to the local display if the local hostname was used in the display name, and the local X server permissions were set (with xauth/xhost) to allow access. Typically, the user would log in to a remote system with telnet or ssh, set the DISPLAY variable, perhaps give ``xhost +'' on the local machine, then run X programs.

This method has been largely superseded by use of ``X forwarding'' in ssh. This is often automatic, or may require the `-X' or `-Y'option in the ssh command line. In this case, after using ssh to log in to the remote machine, the DISPLAY variable is automatically set to display on the local machine. X applications ``just work'', with no need to fool with the DISPLAY variable, or permissions.

The present Xic remote access code does not know about the ssh protocol, so we have to fake it in some cases. In most cases the older method will still work.

The ssh protocol works by setting up a dummy display, with a name something like ``localhost:10.0'', which in actuality connects back to the local display. Depending on how many ssh connections are currently in force, the ``10'' could be ``11'', ``12'', etc.

In the present case, if we want to use ssh for X transmission, the display name must match an existing ssh display name on the remote system that maps back to the local display.

If there is an existing ssh connection to the remote machine, the associated DISPLAY can be used. If there is no existing ssh connection, one can be established, and that used. E.g., from the ssh window, type ``echo $DISPLAY'' and use the value printed.

The display name provided by the SpiceHostDisplay variable will override the assumed display name created internally with the local host name.

SpiceInclude
Value: file path string.
This can be set to a file path. When a SPICE netlist is created with this variable set, text will be added to the top of the SPICE deck. If the file exists and is readable, the text from the file is added to the deck verbatim. Othewise, ``.include path'' is added, the path being the file path from the variable. This applies when creating SPICE with the deck button, or when preparing input for the simulator when using the run button.

SpiceProg
Value: program path string.
This will set the full path name of the WRspice executable. This is useful if there are multiple versions of WRspice available, or the binary has been renamed. If given, the value supersedes the values from environment variables or the !set variables described below.

SpiceExecDir
Value: directory path string.
This will set the directory to search for the WRspice executable. If given, the value overrides the
SPICE_EXEC_DIR environment variable. The default search location is ``/usr/local/xictools/bin'', or, if the XT_PREFIX environment variable has been set, its value will replace ``/usr/local''.

SpiceExecName
Value: program name string.
This will set the name of the WRspice binary. If given, the value overrides the SPICE_EXEC_NAME environment variable. The default name is ``wrspice''.

SpiceSubcCatchar
Value: string, single printing character.
This sets the concatenation character used in WRspice subcircuit expansion. It affects the internally-generated node and other names within subcircuits. Please refer to the WRspice-3.2.15 release notes or documentation for a full description of the WRspice subc_catmode and subc_catchar variables and their effects.

SpiceSubcCatmode
Value: string, ``wrspice'' or ``spice3''.
This sets the algorithm used by WRspice for subcircuit expansion. It affects the internally-generated node and other names within subcircuits. Please refer to the WRspice-3.2.15 release notes or documentation for a full description of the WRspice subc_catmode and subc_catchar variables and their effects.

When running WRspice from Xic, there should not be compatibility issues, as Xic will automatically recognize the capabilities of the connected WRspice and compensate accordingly - as long as the hypertext facility is used to define node, branch, and device names. This is true when point-and-click is used to generate names. However, subcircuit reference names that for some reason are entered by hand may need to be updated, or a .options line added as a spicetext label, or the SpiceSubcCatchar, SpiceSubcCatmode variables may be set to enforce backward compatibility.

CheckSolitary
Value: boolean.
If set, warning messages will be issued when electrical netlists are generated for nodes having only one connection. This affects the run and deck commands, and the Dump Elec Netlist command in the Extract Menu.

NoSpiceTools
Value: boolean.
When running WRspice from Xic, by default the WRspice toolbar is shown, if WRspice is running on the local machine. This gives the user much greater flexibility and control over WRspice. If this variable is set, before the connection to WRspice is established, the toolbar will not be visible.

In releases 3.0.8 and later, this variable will also control toolbar visibility if the wrspiced daemon is used. However, this requires wrspiced distributed with wrspice-3.0.7 or later. If this variable is set with an earlier wrspiced release, the WRspice connection will not work!


next up previous contents index
Next: File Menu Up: Xic Variables Previous: Side Menu Commands   Contents   Index
Stephen R. Whiteley 2024-09-29