Next: , Previous: Analyses and Output Control, Up: Top


10 Interactive Interpreter

Ngspice consists of a simulator and a front-end for data analysis and plotting. The front-end may be run as a separate "stand-alone" program under the name Nutmeg.

Nutmeg will read in the "raw" data output file created by ngspice -r or with the write command in an interactive Ngspice session. Nutmeg or interactive Ngspice can plot data from a simulation on a graphics terminal or a workstation display. Most of the commands available in the interactive Ngspice front end are available in nutmeg; where this is not the case, ngspice-only commands have been marked with an asterisk ("*"). Note that the raw output file is different from the data that Spice2 writes to the standard output, which may also be produced by ngspice with the "-b" command line option.

Ngspice and Nutmeg use the X Window System for plotting if they find the environment variable DISPLAY. Otherwise, a graphics-terminal independent interface (MFB) is used. If you are using X on a workstation, the DISPLAY variable should already be set; if you want to display graphics on a system different from the one you are running Ngspice or Nutmeg on, DISPLAY should be of the form "machine:0.0". See the appropriate documentation on the X Window System for more details.

Command Synopsis

     ngspice [ -n ] [ -t term ] [ -r rawfile] [ -b ] [ -i ] [ input file ... ]
     
     nutmeg [ - ] [ -n ] [ -t term ] [ datafile ... ]

Options are:

-
Don't try to load the default data file ("rawspice.raw") if no other files are given. Nutmeg only.
-n (or -N)
Don't try to source the file ".spiceinit" upon startup. Normally ngspice and nutmeg try to find the file in the current directory, and if it is not found then in the user's home directory.
-t term (or -T term)
The program is being run on a terminal with mfb name term.
-b (or -B)
Run in batch mode. Ngspice reads the default input source (e.g. keyboard) or reads the given input file and performs the analyses specified; output is either Spice2-like line-printer plots ("ascii plots") or a ngspice rawfile. See the following section for details. Note that if the input source is not a terminal (e.g. using the IO redirection notation of "<") Ngspice defaults to batch mode (-i overrides). This option is valid for Ngspice only.
-s (or -S)
Run in server mode. This is like batch mode, except that a temporary rawfile is used and then written to the standard output, preceded by a line with a single "@", after the simulation is done. This mode is used by the ngspice daemon. This option is valid for Ngspice only.
-i (or -I)
Run in interactive mode. This is useful if the standard input is not a terminal but interactive mode is desired. Command completion is not available unless the standard input is a terminal, however. This option is valid for Ngspice only.
-r rawfile (or -P rawfile)
Use rawfile as the default file into which the results of the simulation are saved. This option is valid for Ngspice only.

Further arguments to ngspice are taken to be Ngspice input files, which are read and saved (if running in batch mode then they are run immediately). Ngspice accepts most Spice2 input file, and output ascii plots, fourier analyses, and node printouts as specified in .plot, .four, and .print cards. If an out parameter is given on a .width card, the effect is the same as set width = .... Since Ngspice ascii plots do not use multiple ranges, however, if vectors together on a .plot card have different ranges they are not provide as much information as they would in Spice2. The output of Ngspice is also much less verbose than Spice2, in that the only data printed is that requested by the above cards.

For nutmeg, further arguments are taken to be data files in binary or ascii format (see sconvert(1)) which are loaded into nutmeg. If the file is in binary format, it may be only partially completed (useful for examining Spice2 output before the simulation is finished). One file may contain any number of data sets from different analyses.