⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 spice.1

📁 spice中支持多层次元件模型仿真的可单独运行的插件源码
💻 1
字号:
.\" RCS Info: $Revision: 1.3 $ on $Date: 86/01/07 06:12:37 $.\"           $Source: /cad4/faustus/spice/doc/RCS/spice.1,v $.\" Copyright (c) 1985 Wayne A. Christopher, U. C. Berkeley CAD Group.TH SPICE 1 "20 March 1986".ds S \s-2SPICE\s+2\&3.UC 4.SH NAMEspice \- circuit simulator.SH SYNOPSIS\fBspice [ -n ] [ -t term ] [ -r rawfile] [ -b ][ -i ] [ input file ... ]\fR.SH DESCRIPTIONThis manual page describes the commands available for interactiveuse of \*S. For details of circuit descriptions and theprocess of simulating a circuit, see the \*S User's Manual.The commands available are a superset of those available for\fBnutmeg\fR \- only the additional commands available in \*Sare described here.  You should be familiar with the manual page for\fBnutmeg(1)\fR before reading this manual page..PPArguments are:.TP\fB-n\fR (or \fB-N\fR)Don't try to source the file ".spiceinit" upon startup. Normally \*Stries to find the file in the current directory, and if it is not found thenin the user's home directory..TP\fB-t term\fR (or \fB-T term\fR)The program is being run on a terminal with \fImfb\fR name \fBterm\fR..TP\fB-b\fR (or \fB-B\fR)Run in batch mode. \*S will read the standard input or the specifiedinput file and do the simulation. Note that if the standard inputis not a terminal, \*S will default to batch mode, unless the-i flag is given..TP\fB-s\fR (or \fB-S\fR)Run in server mode. This is like batch mode, except that a temporaryrawfile is used and then written to the standard output, preceded bya line with a single "@", after the simulation is done. This modeis used by the spice daemon..TP\fB-i\fR (or \fB-I\fR)Run in interactive mode. This is useful if the standard input isnot a terminal but interactive mode is desired. Command completion isnot available unless the standard input is a terminal, however..TP\fB-r rawfile\fR (or \fB-R rawfile\fR)Use \fBrawfile\fR as the default file into which the results ofthe simulation are saved..PPFurther arguments are taken to be \*S input decks, which are readand saved. (If batch mode is requested then they are run immediately.).PP\*S will accept any \s-2SPICE\s+2\&2 input decks, and outputascii plots, fourier analyses, and node printouts as specifiedin .plot, .four, and .print cards.  If a \fBout\fR parameteris given on a .width card, the effect is the same as \fBset width = ...\fR.Since \*S ascii plots do not use multiple ranges, however, if vectorstogether on a .plot card have different ranges they will not provideas much information as they would in \s-2SPICE\s+2\&2. The outputof \*S is also much less verbose than \s-2SPICE\s+2\&2, in that the onlydata printed is that requested by the above cards..PPVector names are the same as in \fBnutmeg\fR, with this addition:a name such as \fB@name[param]\fR, where \fBname\fR is eitherthe name of a device instance or model, denotes the value of the\fBparam\fR parameter of the device or model. See the \*S User'sManual for details of what parameters are available. The value is avector of length 1.  This function is also available with the\fBshow\fR command, and is available with variables for convenience forcommand scripts..PP\*Scommands are as follows (these are only those commands not alsoavailable in \fBnutmeg\fR \- consult the \fBnutmeg\fR manual page formore commands):.TP\fBsetcirc [circuit name]\fRChange the current circuit. The current circuit is the one that isused for the simulation commands below. When a circuit is loadedwith the \fIsource\fR command (see below) it becomes thecurrent circuit..TP\fBop [.op card args]\fRDo an operating point analysis..TP\fBtran [.tran card args]\fRDo a transient analysis..TP\fBac [.ac card args]\fRDo an ac analysis..TP\fBdc [.dc card args]\fRDo a dc transfer curve analysis..TP\fBlisting [logical] [physical] [deck] [expand]\fRPrint a listing of the current circuit. If the \fBlogical\fR argumentis given, the listing is with all continuation lines collapsedinto one line, and if the \fBphysical\fRargument is given the lines are printed out as they were found inthe file. The default is \fBlogical\fR. A \fBdeck\fR listing is just likethe \fBphysical\fR listing, except without the line numbers it recreatesthe input file verbatim (except that it does not preserve case).If the word \fBexpand\fR is present, the circuit will be printed with allsubcircuits expanded..TP\fBedit [file]\fRPrint the current \*S deck into a file, call up the editor on that fileand allow the user to modify it, and then read it back in, replacingthe origonal deck. If a \fBfilename\fR is given, then edit that fileand load it, making the circuit the current one..TP\fBresume\fRResume a simulation after a stop..TP\fBshow \fRShow a device parameter..TP\fBalter \fRAlter a device parameter..TP\fBstate\fRPrint the state of the circuit.  (This command is largely unimplemented.).TP\fBsave [all] [output ...]\fR  or \fB.save [all] [output ...]\fRSave a set of outputs, discarding the rest. If a node has been mentionedin a \fBsave\fR command, it will appear in the working plot aftera run has completed, or in the rawfile if spice is run in batchmode. If a node is traced or plotted (see below) it willalso be saved. For backward compatibility, if there are \fBno\fR savecommands given, all outputs are saved..TP\fBstop [ after n] [ when something cond something ] ... \fRSet a breakpoint. The argument \fBafter n\fR means stop after \fBn\fRiteration number \fBn\fR, and the argument \fBwhen something cond something\fR meansstop when the first \fBsomething\fR is in the given relation withthe second \fBsomething\fR, the possible relations being\fBeq\fR or = (equal to),\fBne\fR or <> (not equal to),\fBgt\fR or > (greater than),\fBlt\fR or < (less than),\fBge\fR or >= (greater than or equal to), and\fBle\fR or <= (less than or equal to).IO redirection is disabled for the \fBstop\fR command, since the relationaloperations conflict with it (it doesn't produce any output anyway).The \fBsomething\fR\&s above may be node names inthe running circuit, or real values.If more than one condition is given, e.g.\fBstop after 4 when v(1) > 4 when v(2) < 2\fR, the conjunction ofthe conditions is implied..TP\fBtrace [ node ...]\fRTrace nodes. Every iteration the value of the node is printed to thestandard output..TP\fBiplot [ node ...]\fRIncrementally plot the values of the nodes while \*S runs..TP\fBstep [number]\fRIterate \fBnumber\fR times, or once, and then stop..TP\fBstatus\fRDisplay all of the traces and breakpoints currently in effect..TP\fBdelete [debug number ...]\fRDelete the specified breakpoints and traces. The \fBdebug numbers\fRare those shown by the \fBstatus\fR command. (Unless you do\fBstatus > file\fR, in which case the debug numbers aren't printed.).TP\fBreset\fRThrow out any intermediate data in the circuit (e.g, after a breakpointor after one or more analyses have been done already), and re-parsethe deck. The circuit can then be re-run. (\fBNote\fR: this commandused to be \fBend\fR in \s-2SPICE\s+2 3a5 and earlier versions -- \fBend\fRis now used for control structures.)  The \fBrun\fR command will takecare of this automatically, so this command should not be necessary....TP\fBrun [rawfile]\fRRun the simulation as specified in the input file. If there were anyof the control cards .ac, .op, .tran, or .dc, they are executed. The outputis put in \fBrawfile\fR if it was given, in addition to being availableinteractively..TP\fBsource file\fRRead the \*S input file \fBfile\fR. \fBNutmeg\fR and \*S commands may beincluded in the file, and must be enclosed between the lines\fI.control\fR and \fI.endc\fR.  These commandsare executed immediately after the circuit is loaded, so a control lineof \fIac ...\fR will work the same as the corresponding \fI.ac\fR card.The first line in any input file is considered a titleline and not parsed but kept as the name of the circuit. Theexception to this rule is the file \fI.spiceinit\fR.Thus, a \*S command script must begin with a blank line and then witha \fI.control\fR line.Also, any line beginning with the characters *# is considered a controlline.  This makes it possible to imbed commands in \*S input filesthat will be ignored by earlier versions of \s-2SPICE\s+2.\fINote:\fR in spice3a7 and before, the \fI.control\fR and \fI.endc\fRlines were not needed, and any line beginning with the name of a front-endcommand would be executed..TP\fBlinearize vec ...\fRCreate a new plot with all of the vectors in the current plot, oronly those mentioned if arguments are given.  The new vectorswill be interpolated onto a linear time scale, which is determinedby the values of \fBtstep, tstart,\fR and \fBtstop\fR in thecurrently active transient analysis.  The currently loaded deckmust include a transient analysis (a \fBtran\fR command may be runinteractively before the last \fBreset\fR, alternately), and thecurrent plot must be from this transient analysis.  This commandis needed because \s-2SPICE\s+2\&3 doesn't output the resultsfrom a transient analysis in the same manner that \s-2SPICE\s+2\&2 did..PPThere are several \fBset\fR variables that \*S uses but \fBnutmeg\fRdoes not. They are:.IP "" 16\fBeditor\fR.brThe editor to use for the \fBedit\fR command..IP\fBmodelcard\fR.brThe name of the model card (normally \fB.model\fR)..IP\fBnoaskquit\fR.brDo not check to make sure that there are no circuits suspended andno plots unsaved.  Normally \*S will warn the user when he tries toquit if this is the case..IP\fBnobjthack\fR.brAssume that BJT's have 4 nodes..IP\fBnoparse\fR.brDon't attempt to parse decks when they are read in (useful fordebugging). Of course, theycannot be run if they are not parsed..IP\fBnosubckt\fR.brDon't expand subcircuits..IP\fBrenumber\fR.brRenumber input lines when a deck has \fB.include\fR's..IP\fBsubend\fR.brThe card to end subcircuits (normally \fB.ends\fR)..IP\fBsubinvoke\fR.brThe prefix to invoke subcircuits (normally \fBx\fR)..IP\fBsubstart\fR.brThe card to begin subcircuits (normally \fB.subckt\fR)..PPThere are a number of \fBrusage\fR parameters available, in additionto the ones available in \fBnutmeg\fR:.IP "" 16.PPIf there are subcircuits in the input file, \*S expands instances of them.A subcircuit is delimited by the cards.B .subcktand.B .ends,or whatever the value of the variables.B substartand.B subendis, respectively. An instance of a subcircuit is created by specifyinga device with type 'x' \- the device line is written.IP\fBxname node1 node2 ... subcktname\fR.LPwhere the nodes are the node names that replace the formal parameterson the \fB.subckt\fR line. All nodes that are not formal parametersare prepended with the name given to the instance and a ':', as arethe names of the devices in the subcircuit. If there are several nestedsubcircuits, node and device names look like \fBsubckt1:subckt2:...:name\fR.If the variable \fBsubinvoke\fR is set, then it is used as the prefixthat specifies instances of subcircuits, instead of 'x'..SH "VMS NOTES"The standard suffix for rawspice files in VMS is ".raw"..PPYou may have to redefine the value EDITOR if you wish to use the \fBedit\fRcommand, since the default for VMS is "vi"..SH "SEE ALSO"nutmeg(1), sconvert(1), spice(1), mfb(3), writedata(3)\*S User's Guide.SH AUTHORS\*S:  Tom Quarles (quarles@cad.berkeley.edu).br\fBnutmeg\fR / User interface: Wayne Christopher (faustus@cad.berkeley.edu).SH BUGS.PP\*S will recognise all the notations used in \s-2SPICE\s+2\&2 \fB.plot\fRcards, and will translate \fBvp(1)\fR into \fBph(v(1))\fR, and soforth. However, if there are spaces in these names it won't work. Hence\fBv(1, 2)\fR and \fB(-.5, .5)\fR aren't recognised..PPBJT's can have either 3 or 4 nodes, which makes it difficult for the subcircuitexpansion routines to decide what to rename. If the fourth parameter hasbeen declared as a model name, then it is assumed that there are 3 nodes,otherwise it is considered a node. To disable this kludge, you can setthe variable "nobjthack", which will force BJT's to have 4 nodes (for thepurposes of subcircuit expansion, at least)..PPThe \fB@name[param]\fR notation might not work with \fBtrace, iplot,\fR etc.yet..PPThe first line of a command file (except for the \fI.spiceinit\fR file)should be a comment.  Otherwise \s-2SPICE\s+2 may create an empty circuitstructure..SH CAVEATS.PP\*S files specified on the command line are read in before the\fB .spiceinit\fRfile is read. Thus if you define aliases there that you call in a\*S source file mentioned on the command line, they won't be recognised.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -