TclSpice > Documents > Tclspice Interactive commands
NAME
spice circuit simulator
SYNOPSIS
spice:: option ?arg arg ...?
DESCRIPTION
spice::ac
spice::alias [ word ] [ text ... ]
spice::alter
spice::altermod
spice::asciiplot plotargs
spice::aspice input-file [ output-file ]
spice::bg
spice::bltplot
spice::break
spice::bug
spice::cd [ directory ]
spice::cdump
spice::compose
spice::continue
spice::cross vecname n [ vector1 vector2 ...]
spice::dc Source-Name Vstart Vstop Vincr [ Source2 Vstart2 Vstop2 Vincr2 ]
spice::define function(arg1 [ , arg2 ... ]) expression
spice::deftype spec name pan
spice::delete [ debug-number ... ]
spice::delta
spice::destroy [ plotnames | all ]
spice::diff plot1 plot2 [ vec ... ]
spice::display [ varname .. ]
spice::disto
spice::dowhile
spice::dump
spice::echo [ -n ] [ text ... ]
spice::edit [ file ]
spice::else
spice::end
spice::foreach
spice::fourier fundamental [ value ... ]
spice::get_output
spice::get_param
spice::goto
spice::halt
spice::hardcopy file plotargs
spice::help [ all ] [ command ... ]
spice::history [ -r ] [ number ]
spice::if
spice::iplot [ node ... ]
spice::jobs
spice::label
spice::lastvector
spice::let name = expr
spice::linearize [ vec ... ]
spice::listTriggers
spice::listings [ logical ] [ physical ] [ deck ] [ expand ]
spice::load [ filename ... ]
spice::loadsnap
spice::maxstep
spice::newhelp
spice::noise v(output [,ref]) src [ DEC | LIN | OCT ] Pts Fstart Fstop [PPS]
spice::oldhelp
spice::op
spice::option
spice::plot ***
spice::plot_datapoints
spice::plot_date
spice::plot_get_value
spice::plot_name
spice::plot_nvars
spice::plot_title
spice::plot_variables
spice::popTriggerEvents
spice::print [ col ] [ line ] expr [ expr2 ... ]
spice::pz node1 node2 node3 node4 { CUR | VOL } { POL | ZER | PZ }
spice::quit
spice::registerTriggers
spice::rehash
spice::repeat
spice::reset
spice::reshape ***
spice::resume
spice::rspice input file
spice::run [ rawfile ]
spice::running
spice::rusage [ resource ... ]
spice::save [ all | output ... ]
spice::savesnap
spice::sens ***
spice::set ***
spice::setcirc [ cktname ]
spice::setplot [ plotname ]
spice::setscale [ vector ]
spice::settype type vector [ vector ... ]
spice::shell [ command ]
spice::shift [ varname ] [ number ]
spice::show ***
spice::showmod models [ : parameters ] , ...
spice::source file
spice::spec start_freq stop_freq step_freq vector [vector ...]
spice::spice
spice::spice_data
spice::spice_header
spice::spicetoblt
spice::state
spice::status ***
spice::step [ number ]
spice::stop [ after n ] [ when value cond value ] ...
spice::strcmp result str1 str2
spice::tf opnode ipsource
spice::trace [ node ... ]
spice::tran Tstep Tstop [ Tstart [ Tmax ] ] [ UIC ]
spice::transpose
spice::tutorial
spice::unalias [ word ... ]
spice::undefine function
spice::unlet vector [ vector ... ]
spice::unregisterTrigger
spice::unset word [ word ... ]
spice::version [ verid ]
spice::where
spice::while
spice::write [ file ] [ expr ... ]
spice::xgraph
KEYWORDS

NAME

spice -

SYNOPSIS

spice:: option ?arg arg ...?

DESCRIPTION

This manual page describes the commands available for interactive use of SPICE3. For details of circuit descriptions and the process of simulating a circuit, see the SPICE3 User's Manual. The commands available are a superset of those available for nutmeg only the additional commands available in SPICE3 are described here. You should be familiar with the manual page for nutmeg(1) before reading this manual page.

spice::ac
Perform an AC, small-signal frequency response analysis.
     spice::ac [ DEC | OCT | LIN ] N Fstart Fstop
Do an ac analysis.

spice::alias
Create an alias for a command.
     spice::alias [ word ] [ text ... ]
Causes word to be aliased to text.

spice::alter
Change a device or model parameter.
     spice::alter dev = expression
     spice::alter dev param = expression
     spice::alter @dev[param] = expression
General form [pre 3f4]:
     spice::alter device value
     spice::alter device parameter value [ parameter value ]

Alter changes the value for a device or a specified parameter of a device or model. The first form is used by simple devices which have one principal value (resistors, capacitors, etc.) the other forms are for more complex devices (bjt's, etc.). Model parameters can be changed with the second form if the name contains a "#".

For specifying vectors as values, start the vector with "[", followed by the values in the vector, and end with "]". Be sure to place a space between each of the values and before and after the "[" and "]".

spice::altermod
[Note: Altermod is absent from many implemetations, use alter instead.]

spice::asciiplot
Plot values using old-style character plots.
	spice::asciiplot plotargs
Produce a line printer plot of the vectors. The plot is sent to the standard output, so you can put it into a file with asciiplot args ... > file. The set options width, height, and nobreak determine the width and height of the plot, and whether there are page breaks, respectively. Note that you will have problems if you try to asciiplot something with an X-scale that isn't monotonic (i.e, something like sin(TIME)), because asciiplot uses a simple-minded linear interpolation.

spice::aspice
Asynchronous Spice run.
	spice::aspice input-file [ output-file ]
Start a Spice-3 run, and when it is finished load the resulting data. The raw data is kept in a temporary file. If output-file is specified then the diagnostic output is directed into that file, otherwise it is thrown away.

spice::bg
Run spice commands in the background.
	spice::bg run
	spice::bg resume
All spice commands should be recognised.

spice::bltplot

spice::break
Control structure.
	spice::break
If there is a
while, dowhile, or foreach enclosing this statement, control passes out of the block. Otherwise an error results.

Of course, control structures may be nested. When a block is entered and the input is the terminal, the prompt becomes a number of >'s corresponding to the number of blocks the user has entered. The current control structures may be examined with the debugging command cdump.

spice::bug
Mail a bug report.
 
	spice::bug
Send a bug report. Please include a short summary of the problem, the version number and name of the operating system that you are running, the version of Spice that you are running, and the relevant Spice input file.

spice::cd
Change directory.
	spice::cd [ directory ]
Change the current working directory to directory, or to the user's home directory if none is given.

spice::cdump

spice::compose
Compose a vector.
     spice::compose name values value1 [ value2 ... ]
     spice::compose name parm = val [ parm = val ... ]

[Note: This command was not fully implemented in the Berkeley release, however it is a way to create a vector from a list of values, which is lucky because the Berkeley frontend parser rejects expressions like [ 11 22 33 ].]

The first form takes the values and creates a new vector, the values may be arbitrary expressions.

The second form has the following possible parameters:

startThe value at which the vector should start.
stopThe value at which the vector should end.
stepThe difference between sucessive elements.
linThe number of points, linearly spaced.
logThe number of points, logarithmically spaced.
decThe number of points per decade, logarithmically spaced.
centerWhere to center the range of points.
spanThe size of the range of points.

spice::continue
Control structure.
	spice::continue 
If there is a
while, dowhile, or foreach enclosing this statement, control passes out to the test, or in the case of foreach, the next value is taken. Otherwise an error results.

spice::cross
Create a vector.
	spice::cross vecname n [ vector1 vector2 ... ]

Create a new vector vecname from the nth elements of the listed vectors. Note: If any input vector is complex then the output vector will be complex, and vector[n] is the first element of vector. If n is a vector only the real part of its first element is used.

spice::dc
Perform a DC-sweep analysis.
	spice::dc Source-Name Vstart Vstop Vincr [ Source2 Vstart2 Vstop2 Vincr2 ]
Do a dc transfer curve analysis.

spice::define
Define a function.
     	spice::define function(arg1 [ , arg2  ... ]) expression

Define the user-definable function with the name function and arguments arg1, arg2, ... to be expression, which may involve the arguments. When the function is later used, the arguments it is given are substituted for the formal arguments when it is parsed. If expression is not present, any definition for function is printed, and if there are no arguments to define then all currently active definitions are printed. Note that you may have different functions defined with the same name but different arities [i.e. number of arguments.].

Some useful definitions are:


    	define max(x,y) (x > y) * x + (x <= y) * y
	define min(x,y) (x < y) * x + (x >= y) * y

spice::deftype
Define type of plot or vector.
	spice::deftype spec name pan
Redefine vector and plot types.

spice::delete
Remove a trace or breakpoint.
	spice::delete [ debug-number ... ]

Delete the specified breakpoints, traces and saves. The debug numbers are those shown by the status command (unless you do status > file, in which case the debug numbers are not printed).

spice::delta
set Delta value.
	spice::delta value 
Sets the value of delta to the given value, if given. It returns the current setting of delta

spice::destroy
Delete a data set.
	spice::destroy [ plotnames | all ]
Release the memory holding the data for the specified runs.

spice::diff
Compare vectors.
	spice::diff plot1 plot2 [ vec ... ]

Compare all the vectors in the specified plots, or only the named vectors if any are given. There are different vectors in the two plots, or any values in the vectors differ significantly the difference is reported. The variable diff_abstol, diff_reltol, and diff_vntol are used to determine what is meant by a significant difference.

spice::display
List known vectors and types.
	spice::display [ varname ... ]

Prints a summary of currently defined vectors, or of the names specified. The vectors are sorted by name unless the variable nosort is set. The information given is the name of the vector, the length, the type of the vector, and whether it is real or complex data. Additionally, one vector is labeled [scale]. When a command such as plot is given without a vs argument, this scale is used for the X-axis. It is always the first vector in a rawfile, or the first vector defined in a new plot. If you undefine the scale (i.e., let TIME = []), one of the remaining vectors becomes the new scale (which is undetermined). See also setscale.

spice::disto

spice::dowhile
Control structure.
     spice::dowhile condition
                    statement
                    ...
     spice::end
The same as
while, except that the condition is tested after the statements are executed.

spice::dump

spice::echo
Print text.
	spice::echo [ -n ] [ text ... ]
Echos the given text to the screen. If the first argument is -n the terminating newline is suppressed.

spice::edit
Edit the current circuit.
	spice::edit [ file ]

Print the current Spice3 input file into a file, call up the editor on that file and allow the user to modify it, and then read it back in, replacing the original file. If a filename is given, then edit that file and load it, making the circuit the current one.

spice::else
Control structure.
     spice::if condition
               statement
               ...
     spice::else
               statement
               ...
     spice::end
If the condition is non-zero then the first set of statements are executed, otherwise the second set. The else and the second set of statements may be omitted.

spice::end
Control structure.
	spice::end

Terminates if, while, dowhile and foreach control structures

spice::foreach
Control structure.
     spice::foreach var value ...
            	  statement
            	  ...
     spice::end

The statements are executed once for each of the values, each time with the variable var set to the current one. (var can be accessed by the $var notation - see below).

spice::fourier
Perform a fourier transform.
	spice::fourier fundamental [ value ... ]
Does a Fourier analysis of each of the given values, using the first 10 multiples of the fundamental frequency (or the first
nfreqs, if that variable is set - see below). The output is like that of the .FOUR Spice3 line. The values may be any valid expression. The values are interpolated onto a fixed-space grid with the number of points given by the fourgridsize variable, or 200 if it is not set. The interpolation is of degree polydegree if that variable is set, or 1. If polydegree is 0, then no interpolation is done. This is likely to give erroneous results if the time scale is not monotonic, though.

spice::get_output

spice::get_param

spice::goto
Control structure.
	spice::goto word
If a statement of the form label word is present in the block or an enclosing block, control is transferred there. Note that if the label is at the top level, it must be before the goto statement (i.e. a forward goto) may occur only within a block).

spice::halt
Interrupts a simualtion.
	spice::halt

spice::hardcopy
Save a plot to a file for printing.
	spice::hardcopy file plotargs

Just like plot, except creates a file called file containing the plot in the format specified by the variable hcopydevtype. The default file format is an image in plot(5) format, and can be printed by either the [unix] plot(1) program or lpr with the -g flag. See also the hcopy variables.

spice::help
Print summaries of Spice3 commands.
	spice::help [ all ] [ command ... ]
Prints help. If the argument all is given, a short description of everything you could possibly type is printed. If commands are given, descriptions of those commands are printed. Otherwise help for only a few major commands is printed.

spice::history
Review previous commands.
	spice::history [ -r ] [ number ]
Print out the history, or the last number commands typed at the keyboard. Note: in Spice3 version 3a7 and earlier, all commands (including ones read from files) were saved. The -r option reverses the printing order

spice::if
Control structure.
     spice::if condition
               statement
               ...
     spice::else
               statement
               ...
     spice::end
If the condition is non-zero then the first set of statements are executed, otherwise the second set. The else and the second set of statements may be omitted.

spice::iplot
Incremental plot.
	spice::iplot [ node ... ]

Incrementally plot the values of the nodes while Spice3 runs. The iplot command can be used with the where command to find trouble spots in a transient simulation; it is essentially a graphical version of trace. Several iplots may be active simulataneously. Iplotting is not applicable for all analyses. The status command displays a list of current iplots, and these can be removed with the delete command.

spice::jobs
List active asynchronous Spicer runs.
	spice::jobs
Report on the asynchronous Spice-3 jobs currently running. Nutmeg checks to see if the jobs are finished every time you execute a command. If it is done then the data is loaded and becomes available.

spice::label
Control structure.
	spice::label word
If a statement of the form goto word is encountered, control is transferred to this point, otherwise this is a no-op.

spice::lastvector
Save vectors last values.
	spice::lastvector bltVectorName
Sets bltvectorName with all the vectors values at the last timestep.

spice::let
Assign a value to a vector.
	spice::let name = expr
Creates a new vector called name with the value specified by expr, an expression as described above. If expr is [] (a zero-length vector) then the vector becomes undefined [Note: This doesn't work with the Berkeley 3f4/5 release code, try
unlet instead.]. Individual elements of a vector may be modified by appending a subscript to name (e.g. name[0]). If there are no arguments, let is the same as display.

[Note. Let creates a vector in the current plot, use set to create a new plot.]

spice::linearize
Interploate to a linear scale.
	spice::linearize [ vec ... ]
Create a new plot with all of the vectors in the current plot, or only those mentioned if arguments are given. The new vectors are interpolated onto a linear time scale, which is determined by the values of tstep, tstart, and tstop in the currently active transient analysis. The currently loaded input file must include a transient analysis (a tran command may be run interactively before the last reset, alternately), and the current plot must be from this transient analysis. This command is needed because Spice3 doesn't output the results from a transient analysis in the same manner that Spice2 did.

spice::listTriggers
Lists all set triggers.
	spice::listtriggers
Returns a list of triggers set by
registerTriggers.

spice::listings
Print a listing of the current circuit.
	spice::listing [ logical ] [ physical ] [ deck ] [ expand ]
If the logical argument is given, the listing is with all continuation lines collapsed into one line, and if the physical argument is given the lines are printed out as they were found in the file. The default is logical. A deck listing is just like the physical listing, except without the line numbers it recreates the input file verbatim (except that it does not preserve case). If the word expand is present, the circuit is printed with all subcircuits expanded.

spice::load
Load rawfile data.
	spice::load [ filename ... ]
Loads either binary or ascii format rawfile data from the files named. The default filename is rawSpice.raw, or the argument to the -r flag if there was one when Spice was invoked.

spice::loadsnap
***
	spice::loadsnap inputfile snapFileName
***

spice::maxstep
Maximum step size allowed.
	spice::maxstep stepsize 
Same as
delta but for the maximum stepsize allowed.

spice::newhelp

spice::noise
Perform a noise analysis.
	spice::noise v(output [,ref) src [ DEC | LIN | OCT ] Pts Fstart Fstop [PPS]
Do an noise analysis.

spice::oldhelp

spice::op
Perform an operating point analysis.
	spice::op
Do a operating point analysis.

spice::option

spice::plot
Plot values on the display.
     plot exprs [ylimit ylo yhi] [xlimit xlo xhi] [xindices xilo xihi]
          [xcompress comp] [xdelta xdel] [ydelta ydel] [xlog] [ylog] [loglog]
          [vs xname] [xlabel word] [ylabel word] [title word] [samep]
          [keyword ... ]

Plot the given exprs on the screen (if you are on a graphics terminal). The xlimit and ylimit arguments determine the high and low x- and y-limits of the axes, respectively. The xindices arguments determine what range of points are to be plotted - everything between the xiloth point and the xihith point is plotted. The xcompress argument specifies that only one out of every comp points should be plotted. If an xdelta or a ydelta parameter is present, it specifies the spacing between grid lines on the X- and Y-axis. These parameter names may be abbreviated to xl, yl, xind, xcomp, xdel, and ydel respectively.

The xname argument is an expression to use as the scale on the x-axis. If xlog or ylog are present then the X or Y scale, respectively, is logarithmic (loglog is the same as specifying both). The xlabel and ylabel arguments cause the specified labels to be used for the X and Y axes, respectively.

If samep is given, the values of the other parameters (other than xname) from the previous plot, hardcopy, or asciiplot command is used unless re-defined on the command line.

The title argument is used in the place of the plot name at the bottom of the graph.

The following keywords are available in Spice3f:

linearoverride a default log-scale plot (as in the output for an AC analysis
linplotsynonym for linear
lingridoverride a default log-scale plot without tranforming the data
smithSmith plot - data is transformed by the function (x-1)/(x+1)
gridsmithpolar plot with a Smith grid but without transforming the data.
pointplotplot the points without joining them.
combplotplot vectors by drawing a vertical line from each point to the X-axis, as opposed to joining the points.

[Note: The Berkeley release version of this command seems to ignore the variables that one would expect to influence this command. CDHW.]

spice::plot_datapoints
Time steps.
	spice::plot_datapoints plot 
returns number of time steps saved so far.

spice::plot_data
Returns date string.
	spice::plot_date plot

spice::plot_get_value
Returns value of varable "name" in plot "plot", at position "index".
	spice::plot_get_value name plot index 

spice::plot_name
Returns plot name.
	spice::plot_name plot 

spice::plot_nvars
Returns number of variables in the plot.
	spice::plot_nvars plot

spice::plot_title
Returns plot title.
	spice::plot_title plot 	

spice::plot_variables
Returns a list of variables in plot "plot" plot is from 0-numofplots, newest plot being 0.
	spice::plot_variables plot

spice::popTriggerEvents
***
	spice::popTriggerEvent
***pops the stack of saved triggers returning { Node ? ? ? }

spice::print
Print values.
	spice::print [ col ] [ line ] expr [ expr2 ... ]

Prints the vector described by the expression expr. If the col argument is present, print the vectors named side by side. If line is given, the vectors are printed horizontally. col is the default, unless all the vectors named have a length of one, in which case line is the default. The options width, height, and nobreak are effective for this command (see asciiplot). If the expression is all, all of the vectors available are printed. Thus print col all > file prints everything in the file in Spice2 format. The scale vector (time, frequency) is always in the first column unless the variable noprintscale is true.

spice::pz
Pole-Zero Analysis.
	spice::pz node1 node2 node3 node4 { CUR | VOL } { POL | ZER | PZ }
Performs a
pole-zero analysis of the current circuit, as described earlier.

spice::quit
Leave Spice3 or Nutmeg.
	spice::quit
Quit nutmeg or Spice.

spice::registerTriggers
***
	spice::registerTriggers node start** finish***
***

spice::rehash
Reset internal hash tables.
	spice::rehash
Recalculate the internal hash tables used when looking up UNIX commands, and make all UNIX commands in the user's PATH available for command completion. This is useless unless you have set unixcom first

spice::repeat
     spice::repeat [ number ]
                    statement
                    ...
     spice::end 
Execute the statements number times, or forever if no argument is given.

spice::reset
Reset an analysis.
	spice::reset

Recalculate the internal hash tables used when looking up UNIX commands, and make all UNIX commands in the user's PATH available for command completion. This is useless unless you have set unixcom first (see below).

spice::reshape
Alter the dimensionality or dimensions of a vector.
     spice::reshape vector vector ...
     or
     spice::reshape vector vector ...  [ dimension, dimension, ...  ]
     or
     spice::reshape vector vector ... [ dimension ][ dimension ] ...

This command changes the dimensions of a vector or a set of vectors. The final dimension may be left off and it will be filled in automatically. If no dimensions are specified, then the dimensions of the first vector are copied to the other vectors. An error message of the form 'dimensions of x were inconsistent' can be ignored.

spice::resume
Continue a simulation after a stop.
	spice::resume 
Resume a simulation after a
stop or interruption (control-C).

spice::rspice
Remote Spice submission.
	spice::rspice input file

Runs a Spice-3 remotely taking the input file as a Spice-3 input file, or the current circuit if no argument is given. Nutmeg or Spice3 waits for the job to complete, and passes output from the remote job to the user's standard output. When the job is finished the data is loaded in as with aSpice. If the variable rhost is set, nutmeg connects to this host instead of the default remote Spice3 server machine. This command uses the "rsh" command and thereby requires authentication via a ".rhosts" file or other equivalent method. Note that "rsh" refers to the "remote shell" program, which may be "remsh" on your system; to override the default name of "rsh", set the variable remote_shell. If the variable rprogram is set, then rSpice uses this as the pathname to the program to run on the remote system.

Note: rSpice will not acknowledge elements that have been changed via the alter or altermod commands. [Note: Altermod is absent from many implemetations, use alter instead.]

spice::run
Run analysis from the input file.
	spice::run [ rawfile ]
Run the analyses specified in the input file for the current circuit. If there are any of the control lines specified in
Section 4.3 present they are executed. The output is put in rawfile if it is given, in addition to being available interactively. In Spice-3e and earlier versions, the input file would be re-read and any affects of the set or alter commands would be reversed. This is no longer the effect.

spice::running
Simulation state.
	spice::running
Returns a '1' if simultaion is running, else a '0' if simulation has been interupted or halted.

spice::rusage
Resource usage.
	spice::rusage [ resource ... ]
Print resource usage statistics. If any resources are given, just print the usage of that resource. Most resources require that a circuit be loaded. Currently valid resources are:
 
allEverything below.
elapsedThe amount of time elapsed since the last rusage elaped call.
faultsNumber of page faults and context switches (BSD only).
spaceData space used.
timeCPU time used so far.
tempOperating temperature.
tnomTemperature at which device parameters were measured.
  
equationsCircuit Equations
timeTotal Analysis Time
totiterTotal iterations
acceptAccepted timepoints
rejectedRejected timepoints
  
loadtimeTime spent loading the circuit matrix and RHS.
reordertimeMatrix reordering time
lutimeL-U decomposition time
solvetimeMatrix solve time
  
trantimeTransient analysis time
tranpointsTransient timepoints
traniterTransient iterations
trancuritersTransient iterations for the last time point (listed incorrectly as "Transient iterations per point")
tranlutimeTransient L-U decomposition time
transolvetimeTransient matrix solve time
  
everythingAll of the above.

spice::save
Save a set of outputs.
	spice::save [ all | output ... ]

Save a set of outputs, discarding the rest. If a node has been mentioned in a save command, it appears in the working plot after a run has completed, or in the rawfile if Spice is run in batch mode. If a node is traced or plotted (see below) it is also saved. For backward compatibility, if there are no save commands given, all outputs are saved.

When the keyword "all" appears in the save command, all default values (node voltages and voltage source currents) are saved in addition to any other values listed. See also the status command.

spice::savesnap
***
	spice::savesnap filename
***see also loadsnap

spice::sens
Run a sensitivity analysis.
     spice::sens output
     spice::sens output ac [ DEC | OCT | LIN ] N Fstart Fstop

Perform a sensitivity analysis. The variable output is either a node voltage (e.g. "v(1)" or "v(A,out)") or a current through a voltage source (e.g. "i(vtest)"). The first form calculates DC sensitivities, the second form calculates AC sensitivities. The output values are in dimensions of change in output per unit change of input (as opposed to percent change in output or per percent change of input).

spice::set
Set the value of a variable.
     spice::set [ word ]
     spice::set [ word = value ] ...

Set the value of word to be value, if it is present. You can set any word to be any value, numeric or string. If no value is given then the value is the boolean 'true'.

The value of word may be inserted into a command by writing $word. If a variable is set to a list of values that are enclosed in parentheses (which must be separated from their values by white space), the value of the variable is the list.

The variables affecting Nutmeg are listed in the following section (5.5). The 'set' command can also be used to change simulator parameters for the current circuit (see setcirc below). Set values will be used (until the circuit is reset) when the current circuit is run and take precedence over a .options statement.

spice::setcirc
Change the current circuit.
     spice::setcirc [ cktname ]

Selects cktname as the 'current' circuit. When a circuit is loaded with the source command it is added to a list of available circuits and becomes the current circuit. The setcirc without an argument prints a menu of available circuits.

spice::setplot
Switch the current set of vectors.
     spice::setplot [ plotname ]

Set the current plot to the plot with the given name, or if no name is given, prompt the user with a menu. (Note that the plots are named as they are loaded, with names like tran1 or op2. These names are shown by the setplot and display commands and are used by diff, above.) If the "New plot" item is selected, the current plot becomes one with no vectors defined.

Note that here the word "plot" refers to a group of vectors that are the result of one Spice analysis run. When more than one file is loaded in, or more than one plot is present in one file, Nutmeg keeps them separate and only shows you the vectors in the current plot.

spice::setscale
Set the scale vector for current plot.
     spice::setscale [ vector ]

Defines the scale vector for the current plot. If no argument is given, the current scale vector is printed.

spice::settype
Set the type of a vector.
     spice::settype type vector [ vector ... ]

Change the type of the named vectors to type. Type names can be found in the manual page for sconvert.

spice::shell
Call the command interpreter.
     spice::shell [ command ]

Call the operating system's command interpreter; execute the specified command or call for interactive use.

spice::shift
Alter a list variable.
     spice::shift [ varname ] [ number ]

If varname is the name of a list variable, it is shifted to the left by number elements (i.e, the number leftmost elements are removed). The default varname is argv, and the default number is 1.

spice::show
List device state.
     spice::show devices [ : parameters ] , ...
Old form:
     spice::show -v @device [ [ name ] ]

The show command prints out tables summarizing the operating condition of selected devices (much like the Spice2 operation point summary). If device is missing, a default set of devices are listed, if device is a single letter, devices of that type are listed; if device is a subcircuit name (beginning and ending in ":") only devices in that subcircuit are shown (end the name in a double-":" to get devices within sub-subcircuits recursively). The second and third forms may be combined ("letter:subcircuit:") or "letter:subcircuit::") to select a specific type of device from a subcircuit. A device's full name may be specified to list only that device. Finally, devices may be selected by model by using the form "#modelname" or ":subcircuit#modelname" or "letter:subcircuit#modelname".

If no parameters are specified, the values for a standard set of parameters are listed. If the list of parameters contains a "+", the default set of parameters is listed along with any other specified parameters.

For both devices and parameters, the word "all" has the obvious meaning. Note: there must be spaces separating the ":" that divides the device list from the parameter list.

The "old form" (with "-v") prints the data in an older, more verbose pre-Spice3f format.

spice::showmod
List model parameter values.
     spice::showmod models [ : parameters ] , ...

The showmod command operates like the show command (above) but prints out model parameter values. The applicable forms for models are a single letter specifying the device type letter, "letter:subckt:", "modelname", ":subckt:modelname", or "letter:subcircuit:modelname".

spice::source
Read a Spice3 input file.
     spice::source file

For Spice3: Read the Spice3 input file file. Nutmeg and Spice3 commands may be included in the file, and must be enclosed between the lines .control and .endc. These commands are executed immediately after the circuit is loaded, so a control line of ac ... works the same as the corresponding .AC card. The first line in any input file is considered a title line and not parsed but kept as the name of the circuit. The exception to this rule is the file .Spiceinit. Thus, a Spice3 command script must begin with a blank line and then a control line. Also, any line starting with the characters *# is considered a control line. This makes it possible to embed commands in Spice3 input files that are ignored by earlier versions of Spice2.

For Nutmeg: Reads commands from the file filename. Lines beginning with the character * are considered comments and ignored.

spice::spec
Create a frequency domain plot.
     spice::spec start_freq stop_freq step_freq vector [vector ...]

Calculates a new complex vector containing the Fourier transform of the input vector (typically the linearized result of a transient analysis). The default behaviour is to use a Hanning window, but this can be changed by setting the variables specwindow and specwindoworder appropriately. Typical usage:

    spice3 > linearize
    spice3 > set specwindow = "blackman"
    spice3 > spec 10 1000000 1000 v(out)
    spice3 > plot mag(v(out))

Possible values for specwindow are: none, hanning, cosine, rectangular, hamming, triangle, bartlet, blackman, gaussian. In the case of a gaussian window specwindoworder is a number specifying its order.

[Note: This command was not part of the original Berkeley Spice release. The source code was released by its author, and is often incorporated. A command script version is (Hanning window only) available for use in other cases.

spice::spice
Foreground run.
	spice::spice command
Runs the specified spice command in the foreground.

spice::spice_data
List spice variables.
	spice::spice_data
Returns the names and types of avaliable spice variables {name type} {name type} ... {name type}.

spice::spice_header
File header information.
	spice::spice_header
Returns the current run's title, analysis name, date, and the number of signals as follows: {title ??} {name ???} {date ????} {variables ???}.

spice::spicetoblt
Assign node values to a BLT vector.
	spice::spicetoblt node bltVectorName [ startStep ] [ endStep ]
Sets bltVectorName with all node values from startStep to endstep.

spice::state
lists simultaion information.
	spice::state 
*****

spice::status
Display breakpoint information.
     spice::status
     spice::status > file

Display all of the save, trace, iplot and breakpoint events currently in effect. If the output is redirected to a file, it is assumed that the intention is to re-import it later using the source command so the event numbers are omitted.See also the delete command.

spice::step
Run a fixed number of timepoints.
     spice::step [ number ]
Iterate number times, or once, and then stop.

spice::stop
Set a breakpoint.
     spice::stop [ after n ] [ when value cond value ] ...

Set a breakpoint. The argument 'after n' means stop after iteration number n, and the argument 'when value cond value' means stop when the first value is in the given relation with the second value, the possible relations being

gt >lt <ge >=
le <=ne <>eq =

IO redirection is disabled for the stop command, since the relational operations conflict with it (stop doesn't produce any output anyway). The values above may be node names in the running circuit, or real values. If more than one condition is given, e.g. stop after 4 when v(1) > 4 when v(2) < 2, the conjunction of the conditions is implied.

See also status.

spice::strcmp
Compare strings.
     spice::strcmp result str1 str2

The strcmp command compares two string variables str1 and str2 for equality and sets result as follows:

0if they are equal
Negative integerif str1 < str2
Positive integerif str1 > str2

Some implementations consider "ABC" to be equal to "abc".

spice::tf
Run a Transfer Function analysis.
     spice::tf opnode ipsource

The tf command performs a transfer function analysis, returning the transfer function (output/input), output resistance, and input resistance between the given output node and the given input source. The analysis assumes a small-signal DC (slowly varying) input.

spice::trace
Trace nodes.
     spice::trace [ node ... ]

For every step of an analysis, the value of the node is printed. Several traces may be active at once. Tracing is not applicable for all analyses. To remove a trace, use the delete command.

spice::tran
Perform a transient analysis.
     spice::tran Tstep Tstop [ Tstart [ Tmax ] ] [ UIC ]

Perform a transient analysis. See the previous sections of this manual for more details.

spice::transose
Swap the elements in a multi-dimensional data set.
     spice::transpose vector [ vector ... ]
This command transposes a multidimensional vector. No analysis in Spice3 produces multidimensional vectors, although the
DC transfer curve may be run with two varying sources. You must use the reshape command to reform the one-dimensional vectors into two dimensional vectors. In addition, the default scale is incorrect for plotting. You must plot versus the vector corresponding to the second source, but you must also refer only to the first segment of this second source vector. For example (circuit to produce the transfer characteristic of a MOS transistor):
     Spice3 > spice::dc vgg 0 5 1 vdd 0 5 1
     Spice3 > spice::plot i(vdd)
     Spice3 > spice::reshape all [6,6]
     Spice3 > spice::transpose i(vdd) v(drain)
     Spice3 > spice::plot i(vdd) vs v(drain)[0]

spice::tutorial

spice::unalias
Retract an alias.
     spice::unalias [ word ... ]

Removes any aliases present for the words.

spice::undefine
Retract a definition.
     spice::undefine function

Definitions for the named user-defined functions are deleted.

spice::unlet
Delete a vector.
     spice::unlet vector [ vector ... ]

Delete the specified vector(s). See also let.

spice::unregisterTrigger
***
     spice::unregisterTrigger node 

l.

spice::unset
Clear a variable.
     spice::unset word [ word ... ]
Clear the value of the specified variable(s) (word).

spice::version
Print the version of Spice.
     spice::version [ verid ]

Print out the version of nutmeg that is running. If there are arguments, it checks to make sure that the arguments match the current version of Spice. (This is mainly used as a Command: line in rawfiles.)

spice::where
Identify troublesome node or device.
     spice::where

When performing a transient or operating point analysis, the name of the last node or device to cause non-convergence is saved. The where command prints out this information so that you can examine the circuit and either correct the problem or make a bug report. You may do this either in the middle of a run or after the simulator has given up on the analysis. For transient simulation, the iplot command can be used to monitor the progress of the analysis. When the analysis slows down severly or hangs, interrupt the simulator (with control-C) and issue the where command. Note that only one node or device is printed; there may be problems with more than one node.

spice::while
Control structure.
     spice::while condition
                  statement
                  ...
     spice::end
While condition, an arbitrary algebraic expression, is true, execute the statements.

spice::write
Write data to a file.
     spice::write [ file ] [ expr ... ]

Writes out the expressions to file.

First, vectors are grouped together by plots, and written out as such (i.e, if the expression list contained three vectors from one plot and two from another, then two plots are written, one with three vectors and one with two). Additionally, if the scale for a vector isn't present, it is automatically written out as well.

The default format is ascii, but this can be changed with a set filetype = command. The default filename is rawSpice.raw, or the argument to the -r flag on the command line, if there was one, and the default expression list is 'all'.

spice::xgraph
use the xgraph(1) program for plotting.
     spice::xgraph file [ expr ... ] [ options ]
The Spice3/nutmeg xgraph command plots data like the
plot command but via xgraph, a popular X11 plotting program.

If file is either "temp" or "tmp" a temporary file is used to hold the data while being plotted. For available plot options, see the plot command. All options except for polar and Smith plots are supported.