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