1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en"
6 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8" />
7 <title>geda:ngspice_mp
</title>
8 <meta name=
"generator" content=
"DokuWiki Release rc2007-05-24" />
9 <meta name=
"robots" content=
"noindex,nofollow" />
10 <meta name=
"date" content=
"2007-05-24T22:27:25-0400" />
11 <meta name=
"keywords" content=
"geda,ngspice_mp" />
12 <link rel=
"search" type=
"application/opensearchdescription+xml" href=
"http://geda.seul.org/wiki/lib/exe/opensearch.php" title=
"geda Wiki" />
13 <link rel=
"start" href=
"http://geda.seul.org/wiki/" />
14 <link rel=
"contents" href=
"http://geda.seul.org/wiki/geda:ngspice_mp?do=index" title=
"Index" />
15 <link rel=
"alternate" type=
"application/rss+xml" title=
"Recent Changes" href=
"http://geda.seul.org/wiki/feed.php" />
16 <link rel=
"alternate" type=
"application/rss+xml" title=
"Current Namespace" href=
"http://geda.seul.org/wiki/feed.php?mode=list&ns=geda" />
17 <link rel=
"alternate" type=
"text/html" title=
"Plain HTML" href=
"http://geda.seul.org/wiki/_export/xhtml/geda:ngspice_mp" />
18 <link rel=
"alternate" type=
"text/plain" title=
"Wiki Markup" href=
"http://geda.seul.org/wiki/_export/raw/geda:ngspice_mp" />
19 <link rel=
"stylesheet" media=
"all" type=
"text/css" href=
"lib/exe/css" />
20 <link rel=
"stylesheet" media=
"screen" type=
"text/css" href=
"lib/exe/001css" />
21 <link rel=
"stylesheet" media=
"print" type=
"text/css" href=
"lib/exe/002css" />
24 <div class=
"dokuwiki export">
28 <h1><a name=
"ngspice_man-page" id=
"ngspice_man-page">ngspice man-page
</a></h1>
30 <pre class=
"code">SPICE(
1) SPICE(
1)
35 spice - circuit simulator
38 spice [ -n ] [ -t term ] [ -r rawfile] [ -b ] [ -i ] [ input file ... ]
41 This manual page describes the commands available for interactive use
42 of SPICE3. For details of circuit descriptions and the process of simu-
43 lating a circuit, see the SPICE3 User’s Manual. The commands available
44 are a superset of those available for nutmeg - only the additional com-
45 mands available in SPICE3 are described here. You should be familiar
46 with the manual page for nutmeg(
1) before reading this manual page.
50 -n (or --no-spiceinit)
51 Don’t try to source the file
".spiceinit
" upon startup. Normally
52 SPICE3 tries to find the file in the current directory, and if
53 it is not found then in the user’s home directory.
56 Enable command completion.
58 -t term (or --term=term)
59 The program is being run on a terminal with mfb name term.
62 Run in batch mode. SPICE3 will read the standard input or the
63 specified input file and do the simulation. Note that if the
64 standard input is not a terminal, SPICE3 will default to batch
65 mode, unless the -i flag is given.
68 Run in server mode. This is like batch mode, except that a tem-
69 porary rawfile is used and then written to the standard output,
70 preceded by a line with a single
"@
", after the simulation is
71 done. This mode is used by the spice daemon.
74 Run in interactive mode. This is useful if the standard input is
75 not a terminal but interactive mode is desired. Command comple-
76 tion is not available unless the standard input is a terminal,
79 -r rawfile (or --rawfile=file)
80 Use rawfile as the default file into which the results of the
83 -c circuitfile (or --circuitfile=circuitfile)
84 Use circuitfile as the default input deck.
87 Display a verbose help on the arguments available to the pro-
91 Display a version number and copyright information of the pro-
94 Further arguments are taken to be SPICE3 input decks, which are read
95 and saved. (If batch mode is requested then they are run immediately.)
97 SPICE3 will accept any SPICE2 input decks, and output ascii plots,
98 fourier analyses, and node printouts as specified in .plot, .four, and
99 .print cards. If a out parameter is given on a .width card, the effect
100 is the same as set width = .... Since SPICE3 ascii plots do not use
101 multiple ranges, however, if vectors together on a .plot card have dif-
102 ferent ranges they will not provide as much information as they would
103 in SPICE2. The output of SPICE3 is also much less verbose than SPICE2,
104 in that the only data printed is that requested by the above cards.
106 Vector names are the same as in nutmeg, with this addition: a name such
107 as @name[param], where name is either the name of a device instance or
108 model, denotes the value of the param parameter of the device or model.
109 See the SPICE3 User’s Manual for details of what parameters are avail-
110 able. The value is a vector of length
1. This function is also avail-
111 able with the show command, and is available with variables for conve-
112 nience for command scripts.
114 SPICE3 commands are as follows (these are only those commands not also
115 available in nutmeg - consult the nutmeg manual page for more com-
118 setcirc [circuit name]
119 Change the current circuit. The current circuit is the one that
120 is used for the simulation commands below. When a circuit is
121 loaded with the source command (see below) it becomes the cur-
125 Do an operating point analysis.
127 tran [.tran card args]
128 Do a transient analysis.
134 Do a dc transfer curve analysis.
136 listing [logical] [physical] [deck] [expand]
137 Print a listing of the current circuit. If the logical argument
138 is given, the listing is with all continuation lines collapsed
139 into one line, and if the physical argument is given the lines
140 are printed out as they were found in the file. The default is
141 logical. A deck listing is just like the physical listing,
142 except without the line numbers it recreates the input file ver-
143 batim (except that it does not preserve case). If the word
144 expand is present, the circuit will be printed with all subcir-
148 Print the current SPICE3 deck into a file, call up the editor on
149 that file and allow the user to modify it, and then read it back
150 in, replacing the origonal deck. If a filename is given, then
151 edit that file and load it, making the circuit the current one.
153 resume Resume a simulation after a stop.
155 show Show a device parameter.
157 alter Alter a device parameter.
159 state Print the state of the circuit. (This command is largely unim-
162 save [all] [output ...] or .save [all] [output ...]
163 Save a set of outputs, discarding the rest. If a node has been
164 mentioned in a save command, it will appear in the working plot
165 after a run has completed, or in the rawfile if spice is run in
166 batch mode. If a node is traced or plotted (see below) it will
167 also be saved. For backward compatibility, if there are no save
168 commands given, all outputs are saved.
170 stop [ after n] [ when something cond something ] ...
171 Set a breakpoint. The argument after n means stop after n itera-
172 tion number n, and the argument when something cond something
173 means stop when the first something is in the given relation
174 with the second something, the possible relations being eq or =
175 (equal to), ne or
<> (not equal to), gt or
> (greater than), lt
176 or
< (less than), ge or
>= (greater than or equal to), and le or
177 <= (less than or equal to). IO redirection is disabled for the
178 stop command, since the relational operations conflict with it
179 (it doesn’t produce any output anyway). The somethings above
180 may be node names in the running circuit, or real values. If
181 more than one condition is given, e.g. stop after
4 when v(
1)
>
182 4 when v(
2)
< 2, the conjunction of the conditions is implied.
185 Trace nodes. Every iteration the value of the node is printed to
189 Incrementally plot the values of the nodes while SPICE3 runs.
192 Iterate number times, or once, and then stop.
194 status Display all of the traces and breakpoints currently in effect.
196 delete [debug number ...]
197 Delete the specified breakpoints and traces. The debug numbers
198 are those shown by the status command. (Unless you do status
>
199 file, in which case the debug numbers aren’t printed.)
201 reset Throw out any intermediate data in the circuit (e.g, after a
202 breakpoint or after one or more analyses have been done
203 already), and re-parse the deck. The circuit can then be re-run.
204 (Note: this command used to be end in SPICE
3a5 and earlier ver-
205 sions -- end is now used for control structures.) The run com-
206 mand will take care of this automatically, so this command
207 should not be necessary...
210 Run the simulation as specified in the input file. If there were
211 any of the control cards .ac, .op, .tran, or .dc, they are exe-
212 cuted. The output is put in rawfile if it was given, in addition
213 to being available interactively.
216 Read the SPICE3 input file file. Nutmeg and SPICE3 commands may
217 be included in the file, and must be enclosed between the lines
218 .control and .endc. These commands are executed immediately
219 after the circuit is loaded, so a control line of ac ... will
220 work the same as the corresponding .ac card. The first line in
221 any input file is considered a title line and not parsed but
222 kept as the name of the circuit. The exception to this rule is
223 the file .spiceinit. Thus, a SPICE3 command script must begin
224 with a blank line and then with a .control line. Also, any line
225 beginning with the characters *# is considered a control line.
226 This makes it possible to imbed commands in SPICE3 input files
227 that will be ignored by earlier versions of SPICE. Note: in
228 spice3a7 and before, the .control and .endc lines were not
229 needed, and any line beginning with the name of a front-end com-
230 mand would be executed.
233 Create a new plot with all of the vectors in the current plot,
234 or only those mentioned if arguments are given. The new vectors
235 will be interpolated onto a linear time scale, which is deter-
236 mined by the values of tstep, tstart, and tstop in the currently
237 active transient analysis. The currently loaded deck must
238 include a transient analysis (a tran command may be run interac-
239 tively before the last reset, alternately), and the current plot
240 must be from this transient analysis. This command is needed
241 because SPICE3 doesn’t output the results from a transient anal-
242 ysis in the same manner that SPICE2 did.
244 There are several set variables that SPICE3 uses but nutmeg does not.
248 The editor to use for the edit command.
251 The name of the model card (normally .model).
254 Do not check to make sure that there are no circuits
255 suspended and no plots unsaved. Normally SPICE3 will
256 warn the user when he tries to quit if this is the
260 Assume that BJT’s have
4 nodes.
263 Don’t attempt to parse decks when they are read in
264 (useful for debugging). Of course, they cannot be run
265 if they are not parsed.
268 Don’t expand subcircuits.
271 Renumber input lines when a deck has .include’s.
274 The card to end subcircuits (normally .ends).
277 The prefix to invoke subcircuits (normally x).
280 The card to begin subcircuits (normally .subckt).
282 There are a number of rusage parameters available, in addition to the
283 ones available in nutmeg:
287 If there are subcircuits in the input file, SPICE3 expands instances of
288 them. A subcircuit is delimited by the cards .subckt and .ends, or
289 whatever the value of the variables substart and subend is, respec-
290 tively. An instance of a subcircuit is created by specifying a device
291 with type ’x’ - the device line is written
293 xname node1 node2 ... subcktname
295 where the nodes are the node names that replace the formal parameters
296 on the .subckt line. All nodes that are not formal parameters are
297 prepended with the name given to the instance and a ’:’, as are the
298 names of the devices in the subcircuit. If there are several nested
299 subcircuits, node and device names look like subckt1:subckt2:...:name.
300 If the variable subinvoke is set, then it is used as the prefix that
301 specifies instances of subcircuits, instead of ’x’.
304 The standard suffix for rawspice files in VMS is
".raw
".
306 You may have to redefine the value EDITOR if you wish to use the edit
307 command, since the default for VMS is
"vi
".
310 nutmeg(
1), sconvert(
1), spice(
1), mfb(
3), writedata(
3) SPICE3 User’s
314 SPICE3: Tom Quarles (quarles@cad.berkeley.edu)
315 nutmeg / User interface: Wayne Christopher (faustus@cad.berkeley.edu)
318 SPICE3 will recognise all the notations used in SPICE2 .plot cards, and
319 will translate vp(
1) into ph(v(
1)), and so forth. However, if there are
320 spaces in these names it won’t work. Hence v(
1,
2) and (-
.5,
.5) aren’t
323 BJT’s can have either
3 or
4 nodes, which makes it difficult for the
324 subcircuit expansion routines to decide what to rename. If the fourth
325 parameter has been declared as a model name, then it is assumed that
326 there are
3 nodes, otherwise it is considered a node. To disable this
327 kludge, you can set the variable
"nobjthack
", which will force BJT’s to
328 have
4 nodes (for the purposes of subcircuit expansion, at least).
330 The @name[param] notation might not work with trace, iplot, etc. yet.
332 The first line of a command file (except for the .spiceinit file)
333 should be a comment. Otherwise SPICE may create an empty circuit
337 SPICE3 files specified on the command line are read in before the .spi-
338 ceinit file is read. Thus if you define aliases there that you call in
339 a SPICE3 source file mentioned on the command line, they won’t be
345 4th Berkeley Distribution
20 March
1986 SPICE(
1)