gaf: Fix memory leak
[geda-gaf.git] / docs / wiki / geda-ngspice_mp.html
blobde7f92542e5d99cab8bc7eb64e2c9108964479a8
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html>
4 <head>
5 <link rel="stylesheet" media="screen" type="text/css" href="./style.css" />
6 <link rel="stylesheet" media="screen" type="text/css" href="./design.css" />
7 <link rel="stylesheet" media="print" type="text/css" href="./print.css" />
9 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10 </head>
11 <body>
13 <h1 id="ngspiceman-page">ngspice man-page</h1>
14 <div class="level1">
15 <pre class="code">SPICE(1) SPICE(1)
19 NAME
20 spice - circuit simulator
22 SYNOPSIS
23 spice [ -n ] [ -t term ] [ -r rawfile] [ -b ] [ -i ] [ input file ... ]
25 DESCRIPTION
26 This manual page describes the commands available for interactive use
27 of SPICE3. For details of circuit descriptions and the process of simu-
28 lating a circuit, see the SPICE3 User’s Manual. The commands available
29 are a superset of those available for nutmeg - only the additional com-
30 mands available in SPICE3 are described here. You should be familiar
31 with the manual page for nutmeg(1) before reading this manual page.
33 Arguments are:
35 -n (or --no-spiceinit)
36 Don’t try to source the file &quot;.spiceinit&quot; upon startup. Normally
37 SPICE3 tries to find the file in the current directory, and if
38 it is not found then in the user’s home directory.
40 -q (or --completion)
41 Enable command completion.
43 -t term (or --term=term)
44 The program is being run on a terminal with mfb name term.
46 -b (or --batch)
47 Run in batch mode. SPICE3 will read the standard input or the
48 specified input file and do the simulation. Note that if the
49 standard input is not a terminal, SPICE3 will default to batch
50 mode, unless the -i flag is given.
52 -s (or --server)
53 Run in server mode. This is like batch mode, except that a tem-
54 porary rawfile is used and then written to the standard output,
55 preceded by a line with a single &quot;@&quot;, after the simulation is
56 done. This mode is used by the spice daemon.
58 -i (or --interactive)
59 Run in interactive mode. This is useful if the standard input is
60 not a terminal but interactive mode is desired. Command comple-
61 tion is not available unless the standard input is a terminal,
62 however.
64 -r rawfile (or --rawfile=file)
65 Use rawfile as the default file into which the results of the
66 simulation are saved.
68 -c circuitfile (or --circuitfile=circuitfile)
69 Use circuitfile as the default input deck.
71 -h (or --help)
72 Display a verbose help on the arguments available to the pro-
73 gram.
75 -v (or --version)
76 Display a version number and copyright information of the pro-
77 gram.
79 Further arguments are taken to be SPICE3 input decks, which are read
80 and saved. (If batch mode is requested then they are run immediately.)
82 SPICE3 will accept any SPICE2 input decks, and output ascii plots,
83 fourier analyses, and node printouts as specified in .plot, .four, and
84 .print cards. If a out parameter is given on a .width card, the effect
85 is the same as set width = .... Since SPICE3 ascii plots do not use
86 multiple ranges, however, if vectors together on a .plot card have dif-
87 ferent ranges they will not provide as much information as they would
88 in SPICE2. The output of SPICE3 is also much less verbose than SPICE2,
89 in that the only data printed is that requested by the above cards.
91 Vector names are the same as in nutmeg, with this addition: a name such
92 as @name[param], where name is either the name of a device instance or
93 model, denotes the value of the param parameter of the device or model.
94 See the SPICE3 User’s Manual for details of what parameters are avail-
95 able. The value is a vector of length 1. This function is also avail-
96 able with the show command, and is available with variables for conve-
97 nience for command scripts.
99 SPICE3 commands are as follows (these are only those commands not also
100 available in nutmeg - consult the nutmeg manual page for more com-
101 mands):
103 setcirc [circuit name]
104 Change the current circuit. The current circuit is the one that
105 is used for the simulation commands below. When a circuit is
106 loaded with the source command (see below) it becomes the cur-
107 rent circuit.
109 op [.op card args]
110 Do an operating point analysis.
112 tran [.tran card args]
113 Do a transient analysis.
115 ac [.ac card args]
116 Do an ac analysis.
118 dc [.dc card args]
119 Do a dc transfer curve analysis.
121 listing [logical] [physical] [deck] [expand]
122 Print a listing of the current circuit. If the logical argument
123 is given, the listing is with all continuation lines collapsed
124 into one line, and if the physical argument is given the lines
125 are printed out as they were found in the file. The default is
126 logical. A deck listing is just like the physical listing,
127 except without the line numbers it recreates the input file ver-
128 batim (except that it does not preserve case). If the word
129 expand is present, the circuit will be printed with all subcir-
130 cuits expanded.
132 edit [file]
133 Print the current SPICE3 deck into a file, call up the editor on
134 that file and allow the user to modify it, and then read it back
135 in, replacing the origonal deck. If a filename is given, then
136 edit that file and load it, making the circuit the current one.
138 resume Resume a simulation after a stop.
140 show Show a device parameter.
142 alter Alter a device parameter.
144 state Print the state of the circuit. (This command is largely unim-
145 plemented.)
147 save [all] [output ...] or .save [all] [output ...]
148 Save a set of outputs, discarding the rest. If a node has been
149 mentioned in a save command, it will appear in the working plot
150 after a run has completed, or in the rawfile if spice is run in
151 batch mode. If a node is traced or plotted (see below) it will
152 also be saved. For backward compatibility, if there are no save
153 commands given, all outputs are saved.
155 stop [ after n] [ when something cond something ] ...
156 Set a breakpoint. The argument after n means stop after n itera-
157 tion number n, and the argument when something cond something
158 means stop when the first something is in the given relation
159 with the second something, the possible relations being eq or =
160 (equal to), ne or &lt;&gt; (not equal to), gt or &gt; (greater than), lt
161 or &lt; (less than), ge or &gt;= (greater than or equal to), and le or
162 &lt;= (less than or equal to). IO redirection is disabled for the
163 stop command, since the relational operations conflict with it
164 (it doesn’t produce any output anyway). The somethings above
165 may be node names in the running circuit, or real values. If
166 more than one condition is given, e.g. stop after 4 when v(1) &gt;
167 4 when v(2) &lt; 2, the conjunction of the conditions is implied.
169 trace [ node ...]
170 Trace nodes. Every iteration the value of the node is printed to
171 the standard output.
173 iplot [ node ...]
174 Incrementally plot the values of the nodes while SPICE3 runs.
176 step [number]
177 Iterate number times, or once, and then stop.
179 status Display all of the traces and breakpoints currently in effect.
181 delete [debug number ...]
182 Delete the specified breakpoints and traces. The debug numbers
183 are those shown by the status command. (Unless you do status &gt;
184 file, in which case the debug numbers aren’t printed.)
186 reset Throw out any intermediate data in the circuit (e.g, after a
187 breakpoint or after one or more analyses have been done
188 already), and re-parse the deck. The circuit can then be re-run.
189 (Note: this command used to be end in SPICE 3a5 and earlier ver-
190 sions -- end is now used for control structures.) The run com-
191 mand will take care of this automatically, so this command
192 should not be necessary...
194 run [rawfile]
195 Run the simulation as specified in the input file. If there were
196 any of the control cards .ac, .op, .tran, or .dc, they are exe-
197 cuted. The output is put in rawfile if it was given, in addition
198 to being available interactively.
200 source file
201 Read the SPICE3 input file file. Nutmeg and SPICE3 commands may
202 be included in the file, and must be enclosed between the lines
203 .control and .endc. These commands are executed immediately
204 after the circuit is loaded, so a control line of ac ... will
205 work the same as the corresponding .ac card. The first line in
206 any input file is considered a title line and not parsed but
207 kept as the name of the circuit. The exception to this rule is
208 the file .spiceinit. Thus, a SPICE3 command script must begin
209 with a blank line and then with a .control line. Also, any line
210 beginning with the characters *# is considered a control line.
211 This makes it possible to imbed commands in SPICE3 input files
212 that will be ignored by earlier versions of SPICE. Note: in
213 spice3a7 and before, the .control and .endc lines were not
214 needed, and any line beginning with the name of a front-end com-
215 mand would be executed.
217 linearize vec ...
218 Create a new plot with all of the vectors in the current plot,
219 or only those mentioned if arguments are given. The new vectors
220 will be interpolated onto a linear time scale, which is deter-
221 mined by the values of tstep, tstart, and tstop in the currently
222 active transient analysis. The currently loaded deck must
223 include a transient analysis (a tran command may be run interac-
224 tively before the last reset, alternately), and the current plot
225 must be from this transient analysis. This command is needed
226 because SPICE3 doesn’t output the results from a transient anal-
227 ysis in the same manner that SPICE2 did.
229 There are several set variables that SPICE3 uses but nutmeg does not.
230 They are:
232 editor
233 The editor to use for the edit command.
235 modelcard
236 The name of the model card (normally .model).
238 noaskquit
239 Do not check to make sure that there are no circuits
240 suspended and no plots unsaved. Normally SPICE3 will
241 warn the user when he tries to quit if this is the
242 case.
244 nobjthack
245 Assume that BJT’s have 4 nodes.
247 noparse
248 Don’t attempt to parse decks when they are read in
249 (useful for debugging). Of course, they cannot be run
250 if they are not parsed.
252 nosubckt
253 Don’t expand subcircuits.
255 renumber
256 Renumber input lines when a deck has .include’s.
258 subend
259 The card to end subcircuits (normally .ends).
261 subinvoke
262 The prefix to invoke subcircuits (normally x).
264 substart
265 The card to begin subcircuits (normally .subckt).
267 There are a number of rusage parameters available, in addition to the
268 ones available in nutmeg:
272 If there are subcircuits in the input file, SPICE3 expands instances of
273 them. A subcircuit is delimited by the cards .subckt and .ends, or
274 whatever the value of the variables substart and subend is, respec-
275 tively. An instance of a subcircuit is created by specifying a device
276 with type ’x’ - the device line is written
278 xname node1 node2 ... subcktname
280 where the nodes are the node names that replace the formal parameters
281 on the .subckt line. All nodes that are not formal parameters are
282 prepended with the name given to the instance and a ’:’, as are the
283 names of the devices in the subcircuit. If there are several nested
284 subcircuits, node and device names look like subckt1:subckt2:...:name.
285 If the variable subinvoke is set, then it is used as the prefix that
286 specifies instances of subcircuits, instead of ’x’.
288 VMS NOTES
289 The standard suffix for rawspice files in VMS is &quot;.raw&quot;.
291 You may have to redefine the value EDITOR if you wish to use the edit
292 command, since the default for VMS is &quot;vi&quot;.
294 SEE ALSO
295 nutmeg(1), sconvert(1), spice(1), mfb(3), writedata(3) SPICE3 User’s
296 Guide
298 AUTHORS
299 SPICE3: Tom Quarles (quarles@cad.berkeley.edu)
300 nutmeg / User interface: Wayne Christopher (faustus@cad.berkeley.edu)
302 BUGS
303 SPICE3 will recognise all the notations used in SPICE2 .plot cards, and
304 will translate vp(1) into ph(v(1)), and so forth. However, if there are
305 spaces in these names it won’t work. Hence v(1, 2) and (-.5, .5) aren’t
306 recognised.
308 BJT’s can have either 3 or 4 nodes, which makes it difficult for the
309 subcircuit expansion routines to decide what to rename. If the fourth
310 parameter has been declared as a model name, then it is assumed that
311 there are 3 nodes, otherwise it is considered a node. To disable this
312 kludge, you can set the variable &quot;nobjthack&quot;, which will force BJT’s to
313 have 4 nodes (for the purposes of subcircuit expansion, at least).
315 The @name[param] notation might not work with trace, iplot, etc. yet.
317 The first line of a command file (except for the .spiceinit file)
318 should be a comment. Otherwise SPICE may create an empty circuit
319 structure.
321 CAVEATS
322 SPICE3 files specified on the command line are read in before the .spi-
323 ceinit file is read. Thus if you define aliases there that you call in
324 a SPICE3 source file mentioned on the command line, they won’t be
325 recognised.
330 4th Berkeley Distribution 20 March 1986 SPICE(1)</pre>
332 </div>
333 </body>
334 </html>