1SPICE(1)                    General Commands Manual                   SPICE(1)
2
3
4

NAME

6       spice - circuit simulator
7

SYNOPSIS

9       spice [ -n ] [ -t term ] [ -r rawfile] [ -b ] [ -i ] [ input file ... ]
10

DESCRIPTION

12       This  manual  page describes the commands available for interactive use
13       of SPICE3. For details of circuit descriptions and the process of simu‐
14       lating a circuit, see the SPICE3 User's Manual.  The commands available
15       are a superset of those available for nutmeg - only the additional com‐
16       mands  available  in SPICE3 are described here.  You should be familiar
17       with the manual page for nutmeg(1) before reading this manual page.
18
19       Arguments are:
20
21       -n (or --no-spiceinit)
22              Don't try to source the file ".spiceinit" upon startup. Normally
23              SPICE3  tries  to find the file in the current directory, and if
24              it is not found then in the user's home directory.
25
26       -q (or --completion)
27              Enable command completion.
28
29       -t term (or --term=term)
30              The program is being run on a terminal with mfb name term.
31
32       -b (or --batch)
33              Run in batch mode. SPICE3 will read the standard  input  or  the
34              specified  input  file  and  do the simulation. Note that if the
35              standard input is not a terminal, SPICE3 will default  to  batch
36              mode, unless the -i flag is given.
37
38       -s (or --server)
39              Run  in server mode. This is like batch mode, except that a tem‐
40              porary rawfile is used and then written to the standard  output,
41              preceded  by  a  line with a single "@", after the simulation is
42              done. This mode is used by the spice daemon.
43
44       -i (or --interactive)
45              Run in interactive mode. This is useful if the standard input is
46              not  a terminal but interactive mode is desired. Command comple‐
47              tion is not available unless the standard input is  a  terminal,
48              however.
49
50       -r rawfile (or --rawfile=file)
51              Use  rawfile  as  the default file into which the results of the
52              simulation are saved.
53
54       -c circuitfile (or --circuitfile=circuitfile)
55              Use circuitfile as the default input deck.
56
57       -h (or --help)
58              Display a verbose help on the arguments available  to  the  pro‐
59              gram.
60
61       -v (or --version)
62              Display  a  version number and copyright information of the pro‐
63              gram.
64
65       Further arguments are taken to be SPICE3 input decks,  which  are  read
66       and saved. (If batch mode is requested then they are run immediately.)
67
68       SPICE3  will  accept  any  SPICE2  input decks, and output ascii plots,
69       fourier analyses, and node printouts as specified in .plot, .four,  and
70       .print cards.  If a out parameter is given on a .width card, the effect
71       is the same as set width = ....  Since SPICE3 ascii plots  do  not  use
72       multiple ranges, however, if vectors together on a .plot card have dif‐
73       ferent ranges they will not provide as much information as  they  would
74       in  SPICE2. The output of SPICE3 is also much less verbose than SPICE2,
75       in that the only data printed is that requested by the above cards.
76
77       Vector names are the same as in nutmeg, with this addition: a name such
78       as  @name[param], where name is either the name of a device instance or
79       model, denotes the value of the param parameter of the device or model.
80       See  the SPICE3 User's Manual for details of what parameters are avail‐
81       able. The value is a vector of length 1.  This function is also  avail‐
82       able  with the show command, and is available with variables for conve‐
83       nience for command scripts.
84
85       SPICE3 commands are as follows (these are only those commands not  also
86       available  in  nutmeg  -  consult  the nutmeg manual page for more com‐
87       mands):
88
89       setcirc [circuit name]
90              Change the current circuit. The current circuit is the one  that
91              is  used  for  the  simulation commands below. When a circuit is
92              loaded with the source command (see below) it becomes  the  cur‐
93              rent circuit.
94
95       op [.op card args]
96              Do an operating point analysis.
97
98       tran [.tran card args]
99              Do a transient analysis.
100
101       ac [.ac card args]
102              Do an ac analysis.
103
104       dc [.dc card args]
105              Do a dc transfer curve analysis.
106
107       listing [logical] [physical] [deck] [expand]
108              Print  a listing of the current circuit. If the logical argument
109              is given, the listing is with all continuation  lines  collapsed
110              into  one  line, and if the physical argument is given the lines
111              are printed out as they were found in the file. The  default  is
112              logical.  A  deck  listing  is  just  like the physical listing,
113              except without the line numbers it recreates the input file ver‐
114              batim  (except  that  it  does  not preserve case).  If the word
115              expand is present, the circuit will be printed with all  subcir‐
116              cuits expanded.
117
118       edit [file]
119              Print the current SPICE3 deck into a file, call up the editor on
120              that file and allow the user to modify it, and then read it back
121              in,  replacing  the  origonal deck. If a filename is given, then
122              edit that file and load it, making the circuit the current one.
123
124       resume Resume a simulation after a stop.
125
126       show   Show a device parameter.
127
128       alter  Alter a device parameter.
129
130       state  Print the state of the circuit.  (This command is largely  unim‐
131              plemented.)
132
133       save [all] [output ...]  or .save [all] [output ...]
134              Save  a  set of outputs, discarding the rest. If a node has been
135              mentioned in a save command, it will appear in the working  plot
136              after  a run has completed, or in the rawfile if spice is run in
137              batch mode. If a node is traced or plotted (see below)  it  will
138              also  be saved. For backward compatibility, if there are no save
139              commands given, all outputs are saved.
140
141       stop [ after n] [ when something cond something ] ...
142              Set a breakpoint. The argument after n means stop after n itera‐
143              tion  number  n,  and the argument when something cond something
144              means stop when the first something is  in  the  given  relation
145              with  the second something, the possible relations being eq or =
146              (equal to), ne or <> (not equal to), gt or > (greater than),  lt
147              or < (less than), ge or >= (greater than or equal to), and le or
148              <= (less than or equal to).  IO redirection is disabled for  the
149              stop  command,  since the relational operations conflict with it
150              (it doesn't produce any output anyway).   The  somethings  above
151              may  be  node  names in the running circuit, or real values.  If
152              more than one condition is given, e.g.  stop after 4 when v(1) >
153              4 when v(2) < 2, the conjunction of the conditions is implied.
154
155       trace [ node ...]
156              Trace nodes. Every iteration the value of the node is printed to
157              the standard output.
158
159       iplot [ node ...]
160              Incrementally plot the values of the nodes while SPICE3 runs.
161
162       step [number]
163              Iterate number times, or once, and then stop.
164
165       status Display all of the traces and breakpoints currently in effect.
166
167       delete [debug number ...]
168              Delete the specified breakpoints and traces. The  debug  numbers
169              are  those  shown by the status command. (Unless you do status >
170              file, in which case the debug numbers aren't printed.)
171
172       reset  Throw out any intermediate data in the  circuit  (e.g,  after  a
173              breakpoint  or  after  one  or  more  analyses  have  been  done
174              already), and re-parse the deck. The circuit can then be re-run.
175              (Note: this command used to be end in SPICE 3a5 and earlier ver‐
176              sions -- end is now used for control structures.)  The run  com‐
177              mand  will  take  care  of  this  automatically, so this command
178              should not be necessary...
179
180       run [rawfile]
181              Run the simulation as specified in the input file. If there were
182              any  of the control cards .ac, .op, .tran, or .dc, they are exe‐
183              cuted. The output is put in rawfile if it was given, in addition
184              to being available interactively.
185
186       source file
187              Read  the SPICE3 input file file. Nutmeg and SPICE3 commands may
188              be included in the file, and must be enclosed between the  lines
189              .control  and  .endc.   These  commands are executed immediately
190              after the circuit is loaded, so a control line of  ac  ...  will
191              work  the same as the corresponding .ac card.  The first line in
192              any input file is considered a title line  and  not  parsed  but
193              kept  as  the name of the circuit. The exception to this rule is
194              the file .spiceinit.  Thus, a SPICE3 command script  must  begin
195              with a blank line and then with a .control line.  Also, any line
196              beginning with the characters *# is considered a  control  line.
197              This  makes  it possible to imbed commands in SPICE3 input files
198              that will be ignored by earlier versions  of  SPICE.   Note:  in
199              spice3a7  and  before,  the  .control  and  .endc lines were not
200              needed, and any line beginning with the name of a front-end com‐
201              mand would be executed.
202
203       linearize vec ...
204              Create  a  new plot with all of the vectors in the current plot,
205              or only those mentioned if arguments are given.  The new vectors
206              will  be  interpolated onto a linear time scale, which is deter‐
207              mined by the values of tstep, tstart, and tstop in the currently
208              active  transient  analysis.   The  currently  loaded  deck must
209              include a transient analysis (a tran command may be run interac‐
210              tively before the last reset, alternately), and the current plot
211              must be from this transient analysis.  This  command  is  needed
212              because SPICE3 doesn't output the results from a transient anal‐
213              ysis in the same manner that SPICE2 did.
214
215       There are several set variables that SPICE3 uses but nutmeg  does  not.
216       They are:
217
218                       editor
219                       The editor to use for the edit command.
220
221                       modelcard
222                       The name of the model card (normally .model).
223
224                       noaskquit
225                       Do  not  check  to make sure that there are no circuits
226                       suspended and no plots unsaved.  Normally  SPICE3  will
227                       warn  the  user  when  he  tries to quit if this is the
228                       case.
229
230                       nobjthack
231                       Assume that BJT's have 4 nodes.
232
233                       noparse
234                       Don't attempt to parse decks  when  they  are  read  in
235                       (useful  for  debugging). Of course, they cannot be run
236                       if they are not parsed.
237
238                       nosubckt
239                       Don't expand subcircuits.
240
241                       renumber
242                       Renumber input lines when a deck has .include's.
243
244                       subend
245                       The card to end subcircuits (normally .ends).
246
247                       subinvoke
248                       The prefix to invoke subcircuits (normally x).
249
250                       substart
251                       The card to begin subcircuits (normally .subckt).
252
253       There are a number of rusage parameters available, in addition  to  the
254       ones available in nutmeg:
255
256
257
258       If there are subcircuits in the input file, SPICE3 expands instances of
259       them.  A subcircuit is delimited by the cards  .subckt  and  .ends,  or
260       whatever  the  value  of  the variables substart and subend is, respec‐
261       tively. An instance of a subcircuit is created by specifying  a  device
262       with type 'x' - the device line is written
263
264              xname node1 node2 ... subcktname
265
266       where  the  nodes are the node names that replace the formal parameters
267       on the .subckt line. All nodes  that  are  not  formal  parameters  are
268       prepended  with  the  name  given to the instance and a ':', as are the
269       names of the devices in the subcircuit. If  there  are  several  nested
270       subcircuits,  node and device names look like subckt1:subckt2:...:name.
271       If the variable subinvoke is set, then it is used as  the  prefix  that
272       specifies instances of subcircuits, instead of 'x'.
273

VMS NOTES

275       The standard suffix for rawspice files in VMS is ".raw".
276
277       You  may  have to redefine the value EDITOR if you wish to use the edit
278       command, since the default for VMS is "vi".
279

SEE ALSO

281       nutmeg(1), sconvert(1), spice(1), mfb(3),  writedata(3)  SPICE3  User's
282       Guide
283

AUTHORS

285       SPICE3:  Tom Quarles (quarles@cad.berkeley.edu)
286       nutmeg / User interface: Wayne Christopher (faustus@cad.berkeley.edu)
287

BUGS

289       SPICE3 will recognise all the notations used in SPICE2 .plot cards, and
290       will translate vp(1) into ph(v(1)), and so forth. However, if there are
291       spaces in these names it won't work. Hence v(1, 2) and (-.5, .5) aren't
292       recognised.
293
294       BJT's can have either 3 or 4 nodes, which makes it  difficult  for  the
295       subcircuit  expansion  routines to decide what to rename. If the fourth
296       parameter has been declared as a model name, then it  is  assumed  that
297       there  are  3 nodes, otherwise it is considered a node. To disable this
298       kludge, you can set the variable "nobjthack", which will force BJT's to
299       have 4 nodes (for the purposes of subcircuit expansion, at least).
300
301       The @name[param] notation might not work with trace, iplot, etc.  yet.
302
303       The  first  line  of  a  command  file (except for the .spiceinit file)
304       should be a comment.  Otherwise  SPICE  may  create  an  empty  circuit
305       structure.
306

CAVEATS

308       SPICE3 files specified on the command line are read in before the .spi‐
309       ceinit file is read. Thus if you define aliases there that you call  in
310       a  SPICE3  source  file  mentioned  on  the command line, they won't be
311       recognised.
312
313
314
315
3164th Berkeley Distribution        20 March 1986                        SPICE(1)
Impressum