Declarations and control statements



CHAPTER 4

Declarations

and Command

Statements

|* |Comment line | |

|; |Comment in a statement |PSPICE only |

|.AC |ac Analysis | |

|.CONTROL |Beginning of the control script |SPICE3 only |

|.DC |dc sweep analysis | |

|.DISTO |Distortion analysis |PSPICE, SPICE3 only |

|.END |End of the circuit definition | |

|.ENDC |End of the control script |SPICE3 only |

|.ENDS |End of the subcircuit declaration | |

|.EXTERNAL |External port |PSPICE only |

|.FOUR |Fourier analysis | |

|.FUNC |Function definition |PSPICE only |

|.IC |Initial bias-point condition | |

|.INC |Include file |PSPICE only |

|.LIB |Include data from a library |PSPICE only |

|.LOADBIAS |Load bias-point file |PSPICE only |

|.MC |Monte Carlo analysis |PSPICE only |

|.MODEL |Model declaration | |

|.NODESET |Set node parameters | |

|.NOISE |Noise analysis | |

|.OP |Operating point statement | |

|.OPTIONS |Option line | |

|.PARAM |Parameter line |PSPICE only |

|.PLOT |Plot line | |

|.PRINT |Print table | |

|.PROBE |Save data for the Probe program |PSPICE only |

|.SAVE |Save data for the Nutmeg program |SPICE3 only |

|.SAVEBIAS |Save bias-point data |PSPICE only |

|.SENS |Sensitivity analysis | |

|.STEP |Parametric analysis |PSPICE only |

|.SUBCKT |Subcircuit definition | |

|.TEMP |Temperature statement | |

|.TEXT |Text parameter definition |PSPICE only |

|.TF |Transfer function | |

|.TRAN |Transient analysis | |

|.WATCH |Watch analysis results |PSPICE only |

|.WCASE |Worst case analysis |PSPICE only |

|.WIDTH |Width statement | |

In statement descriptions and examples in this book, SPICE keywords and letters are written using bold characters. Names that can be chosen by the user start with a capital letter, and italic characters are used.

|* - Comment Line | |

| | | |

|General form |Restrictions |

|* [comments] | |

| | |

|Example | |

|* this is an example | |

A line starting with an asterisk ‘*’ is ignored by the program, and the line can be used to write comments describing circuits and the function of a circuit element. One good example is to label the node names of a subcircuit:

* Flip-flop

* inp1 inp2 out1 out2 power

.SUBCIRCUIT FLIP_FLOP 1 2 9 8 10

|; - Comment in a Statement |PSPICE |

| | | |

|General form |Restrictions |

|[line text] ; [comments] |PSPICE |

| | |

|Examples | |

|C4 2 5 10U ; coupling capacitor |PSPICE |

|R5 3 4 2.2K ; load resistor |PSPICE |

The semicolon is treated by the program as the end of the line. This way, useful comments can be placed in each line after a statement or element declaration.

|.AC- ac Analysis | |

| | | |

|General forms |Restrictions |

|.AC LIN Np F_start F_stop | |

|.AC DEC Nd F_start F_stop | |

|.AC OCT No F_start F_stop | |

| | |

|Examples | |

|.AC LIN 51 10kHz 50kHz | |

|.AC DEC 5 10 10k | |

|.AC OCT 10 500 8kHz | |

The .AC statement is used for small-signal frequency analysis. In order to be meaningful, at least one independent source must have the AC option specified (see independent sources declarations). During ac analysis, the only independent sources which have nonzero amplitudes are those with ac specifications. The frequency response is calculated by linearizing the circuit around the bias point. F_start and F_stop specify the frequency range. The .AC statement can use one of the following keywords:

LIN - linear sweep, Np - total number of frequency points

DEC- logarithmic sweep by decades, Nd - number of frequency points per decade

OCT- logarithmic sweep by octaves, No - number of frequency points per octave

|.CONTROL - Beginning of the Control Script |SPICE3 |

| | | |

|General form |Restrictions |

|.CONTROL |SPICE3 |

| | |

|Example | |

|.CONTROL | SPICE3 |

The .CONTROL statement informs the program that this is the beginning of the control script for the SPICE3 program. This control script ends with the .ENDC statement. See the following section for a description of the control script commands.

|.DC - dc Sweep Analysis | |

| | | |

|General forms |Restrictions |

|.DC Source_name Start Stop Increment [Nested sweep] | |

|.DC LIN Sweep_variable Start Stop Increment [Nested sweep] |PSPICE |

|.DC DEC Sweep_variable Start Stop Nr_points [Nested sweep] |PSPICE |

|.DC OCT Sweep_variable Start Stop Nr_points [Nested sweep] |PSPICE |

|.DC Sweep_variable LIST Values [Nested sweep] |PSPICE |

| | |

|Examples | |

|.DC VIN 0 5 0.1 | |

|.DC VDS 0V 10V 0.1V VGS -2V 6V 1V | |

|.DC VCE 0 10 .5 IB 0 10U 1U | |

|.DC V6 LIST 1 2 3 5 10 20 30 50 |PSPICE |

|.DC LIN IS 10mA -5mA 0.5mA |PSPICE |

|.DC DEC V3 1mV 1V 10 |PSPICE |

|.DC OCT I3 1mA 16mA 5 |PSPICE |

|.DC RES RMOD 0.2 2 .1 ;stepping value of resistor |PSPICE |

|.DC NPN Q5(BF) 50 300 10 ;stepping value of beta |PSPICE |

|.DC TEMP LIST -20 -10 0 10 20 30 50 100 150 |PSPICE |

|.DC PARAM VDIF 0 20mV 0.5mV |PSPICE |

The .DC statement is used for a dc sweep analysis which calculates the circuit’s bias point over a range of values. Source_name is an independent voltage or current source. Start, Stop, and Increment specify the voltage or current range with a given increment. Nr_points is the number of points per decade or octave in the DEC and OCT cases. Nested sweep is the second set of sweep parameters. For each point of Nested sweep, the SPICE program will perform an entire sweep of the first set of sweep parameters. The Sweep_variable can be:

• The name of an independent voltage or current source

• Temperature - in this case, the keyword TEMP must be used

• Model parameter - in this case a model type and model name are followed by a model parameter name in parentheses.

• Global parameter - in this case the keyword PARM followed by the parameter name should be used.

|.DISTO - Distortion Analysis |PSPICE-pro, SPICE3 |

| | | |

|General forms |Restrictions |

|.DISTO Rload [Interval [Skw2 [Ref_power [Spw2]]]] |PSPICE-pro |

|.DISTO LIN Np F_start F_stop [F2over] |SPICE3 |

|.DISTO DEC Nd F_start F_stop [F2over] |SPICE3 |

|.DISTO OCT No F_start F_stop [F2over] |SPICE3 |

| | |

|Examples | |

|.DISTO R175 2 0.9 1m 0.8 |PSPICE-pro |

|.DISTO LIN 101 1kHz 5kHz |SPICE3 |

|.DISTO OCT 5 1kHz 8kHz |SPICE3 |

|.DISTO DEC 10 100 10k 0.9 |SPICE3 |

The .DISTO statement invokes the distortion analysis. A multidimensional Taylor’s series is used to analyze nonlinearities. Terms up to third order are used in the series expansion. If the optional parameter F2over is not specified, then the distortion is analyzed assuming only one frequency is present in the circuit at a time. This single frequency may be generated by several different sources. The distortion analysis is implemented differently in SPICE3 and newer versions of PSPICE.

In PSPICE, distortion is computed as a part of the ac small-signal sinusoidal steady-state analysis. The sweeping frequency range is declared in the .AC statement. The analysis is performed assuming that one or two signal frequencies are imposed at the input. Let the two frequencies be f1 (the nominal analysis frequency) and f2 = Skw2*f1. The program then computes the following distortion measures:

HD2 - the magnitude of the frequency component 2 f1 assuming that f2 is not present.

HD3 - the magnitude of the frequency component 3 f1 assuming that f2 is not present.

SIM2 - the magnitude of the frequency component f1 + f2.

DIM2 - the magnitude of the frequency component f1 - f2.

DIM3 - the magnitude of the frequency component 2 f1 - f2.

Rload is the name of the output load resistor into which all distortion power products are to be computed. Interval is the interval at which the summary printout of the contributions of all nonlinear devices to the total distortion is to be printed. If Interval is omitted or set to zero, no summary printout will be made. Ref_power is the reference power level used in computing the distortion products; if it is omitted, a value of 1 mW (i.e., dBm) is used. Skw2 is the ratio of f2 to f1. If Skw2 is omitted, a value of 0.9 is used (f2 = 0.9 f1). Spw2 is the amplitude of f2. If Spw2 is omitted, a value of 1.0 is assumed. The distortion measures HD2, HD3, SIM2, DIM2, and DIM3 may be printed and/or plotted using .PRINT and .PLOT statements.

In SPICE3, the optional parameter F2over must satisfy 0 < F2over < 1.0. Note that F2over must not be equal to either 0 or 1.0. When F2over is specified, then analysis is done with the presence of two frequencies. One is fixed with frequency equal to F_start*F2over, and the second is a sweeping frequency defined by sweeping parameters:

• LIN - linear sweep, Np - total number of frequency points

• DEC- logarithmic sweep by decades, Nd - number of frequency points per decade

• OCT- logarithmic sweep by octaves, No - number of frequency points per octave

• F_start and F_stop specify the frequency range.

The .DISTO statement can be used only when dedicated parameters DISTOF1 and DISTOF2 are specified for at least one voltage or current source. To generate output, the .DISTO statement must be accompanied by a .PRINT DISTO statement.

|.END - End of the Circuit Definition | |

| | | |

|General form |Restrictions |

|.END | |

| | |

|Example | |

|.END | |

The .END statement informs the program that this is the end of one circuit description. After the .END statement, the program proceeds to analysis. Many .END statements can be included in one input file. In this case each part of the input file is treated as a separate circuit, and all circuits are analyzed in the sequence as written.

|.ENDC - End of the Control Script |SPICE3 |

| | | |

|General form |Restrictions |

|.ENDC |SPICE3 |

| | |

|Example | |

|.ENDC | SPICE3 |

The .ENDC statement informs the program that this is the end of the control script for the SPICE3 program. This control script starts with the .CONTROL statement.

|.ENDS - End of the Subcircuit Declaration | |

| | | |

|General form |Restrictions |

|.ENDS [Sub_name] | |

| | |

|Examples | |

|.ENDS | |

|.ENDS LM101 | |

The .ENDS statement informs the program that this is end of a subcircuit description. The subcircuit description starts with a .SUBCKT line. It is a good habit to write the subcircuit name Sub_name after the .ENDS statement.

|.EXTERNAL - External Port |PSPICE |

| | | |

|General forms |restrictions |

|.EXTERNAL INPUT node1 node2… |PSPICE |

|.EXTERNAL OUTPUT node1 node2… |PSPICE |

|.EXTERNAL BIDIRECTIONAL node1 node2… |PSPICE |

| | |

|Examples | |

| .EXTERNAL INPUT NodeA NodeB |PSPICE |

|.EXTERNAL OUTPUT Out |PSPICE |

|.EXTERNAL BIDIRECTIONAL Port1 Port2 Port5 |PSPICE |

| | |

The .EXTERNAL statement is used to identify “external ports” for use by PSPICE A/D and Plogic digital simulations.

|.FOUR - Fourier Analysis | |

| | | |

|General forms |Restrictions |

|.FOUR Frequency Out_var1 [Out_var2 Out_var3 ...] | |

|.FOUR Frequency [Last_harmonic] Out_var1 [Out_var2 Out_var3 ...] |PSPICE |

| | |

|Examples | |

|.FOUR 100kHz V(5) V(3,7) I(V12) | |

|.FOUR 1MEG V(3) | |

|.FOUR 60Hz 10 V(3) V(3,7) |PSPICE |

The .FOUR statement controls whether the program performs a Fourier analysis as part of the transient analysis. Frequency is the fundamental frequency, and Out_var1 [Out_var2 Out_var3 ...] are the output variables for which the analysis is desired. The output variables are listed in the same format as in the .PRINT statement. The time-domain signals specified by the output variables are decomposed into a trigonometric Fourier series. The Fourier analysis is performed over the interval where Tstop is the final time specified for the transient analysis and Period is one period of the fundamental frequency: Period = 1/Frequency. The dc component and the first nine components are computed. In the case of PSPICE, any desired number of harmonics can be specified using the Last_harmonic parameter.

For maximum accuracy, Mstep in the .TRAN statement should be set to Period/100.0 or less for higher accuracy.

| .FUNC - Function Definition | |

| |PSPICE |

| | | |

|General form |Restrictions |

|.FUNC Name [Argum…] {Function} |PSPICE |

| | |

|Examples | |

|.FUNC TANH(x) {2/(1+exp(-2**x)-1} |PSPICE |

|.FUNC SINH(x) {(exp(x)-exp(-x))/2} |PSPICE |

|.FUNC E(x) {exp(x)} |PSPICE |

|.FUNC COSH(x) {0.5*(E(x)+E(x))} |PSPICE |

|.FUNC MIN(A,B) {(A+B-0.5*ABS(A-B))} |PSPICE |

|.FUNC MAX(A,B) {(A+B+0.5*ABS(A-B))} |PSPICE |

The .FUNC statement is used to define “functions” which can be used in expressions. The functions must not be redefined, but previously defined functions can be used. The basic functions which are built into the PSPICE program are listed in the table below.

|Basic function |Meaning |

|ABS(x) |absolute value |

|SQRT(x) |square root |

|EXP(x) |ex - exponential function |

|LOG(x) |ln(x) - natural logarithm |

|LOG10(x) |logarithm with base 10 |

|PWR(x,y) ||x|y - power |

|PWRS(x,y) |xy - signed power |

|SIN(x) |sin(x) - sine (x in radians) |

|COS(x) |cos(x) - cosine (x in radians) |

|TAN(x) |tan(x) - tangent (x in radians) |

|ASIN(x) |sin-1(x) - arc sine (result in radians) |

|ACOS(x) |cos-1(x) - arc cosine (result in radians) |

|ATAN(x) |tan-1(x) - arc tangent (result in radians) |

|LIMIT(x,min,max) |min if x < min |

| |max if x > max |

| |limit results to (min,max) range; otherwise x |

|TABLE(x, y1, x1,…) |lookup table and interpolate points between listed values |

|.IC - Initial Bias-Point Condition | |

| | | |

|General form |Restrictions |

|.IC V(Node1[, Node2])=Value1 V(Node3 [, Node4])= = Value2 … | |

| | |

|Examples | |

|.IC V(1)=0 V(8)=3.4V V(11)=-1.2V | |

|.IC V(3)=3.3V V(5)=2.8V V(3,8)=2V | |

|.IC V(1,2)=0 V(5)=2 | |

| | |

The .IC statement sets initial conditions for transient analysis. It has two different interpretations depending on whether the UIC parameter is specified in the .TRAN line:

• When UIC is specified, the initial node voltages are used from the .IC line. Zero values are assumed for nodes that are not specified.

• When the UIC parameter is not specified, the dc bias point is computed using the voltages from the .IC line as initial voltages for the bias-point calculations. During transient analysis, the constraint on these node voltages is removed.

If the circuit contains both .IC and .NODESET statements, the .NODESET statement is ignored.

|.INC- Include File | |

| |PSPICE |

| | | |

|General form |Restrictions |

|.INC “File_name” |PSPICE |

| | |

|Examples | |

|.INC “CMOS.MOD” |PSPICE |

|.INC “2N3904.CIR” |PSPICE |

| | |

The .INC statements permits inclusion of another file. The entire “File_name” is included.

|.LIB- Include Data From a Library | |

| |PSPICE |

| | | |

|General form |Restrictions |

|.LIB “File_name” |PSPICE |

| | |

|Examples | |

|.LIB |PSPICE |

|.LIB “OPAMP.LIB” |PSPICE |

|.LIB “CMOS.LIB” |PSPICE |

|.LIB “BIPOLAR.LIB” |PSPICE |

The .LIB statement causes inclusion of subcircuits or models from a library file. In contrast to the .INC statement, only description models or subcircuits used by the circuit are included. If a file name is not specified, the default name NOM.LIB is used.

|.LOADBIAS- Load Bias-Point File | |

| |PSPICE |

| | | |

|General form |restrictions |

|.LOADBIAS “File_name” |PSPICE |

| | |

|Examples | |

|.LOADBIAS “FLIPFLOP.INI” |PSPICE |

|.LOADBIAS “C:\CIR\AMPL.DAT” |PSPICE |

| | |

The .LOADBIAS statement causes a text file with .NODESET or .IC statements to be included. Often this text file is created by a .SAVEBIAS statement of the previous circuit simulation. To echo the .LOADBIAS file contents to the output file, use the EXPAND option on the .OPTIONS statement.

|.MC - Monte Carlo Analysis | |

| |PSPICE |

| | | |

|General forms |restrictions |

|.MC Nr_runs AC Output Function [Option] [SEED=Value] |PSPICE |

|.MC Nr_runs DC Output Function [Option] [SEED=Value] |PSPICE |

|.MC Nr_runs TRAN Output Function [Option] [SEED=Value] |PSPICE |

| | |

|Examples | |

|.MC 5 DC V(4) |PSPICE |

|.MC 10 TRAN V(3) YMAX |PSPICE |

|.MC 12 AC V(8) YMAX LIST OUTPUT(ALL) |PSPICE |

|.MC 20 TRAN I(M3) YMAX LIST |PSPICE |

|.MC 10 AC VM(5,3) YMAX LIST OUTPUT ALL |PSPICE |

|.MC 20 DC ID(M3) YMAX LIST |PSPICE |

|.MC 10 AC VP(13) YMAX LIST OUTPUT ALL |PSPICE |

|.MC 10 TRAN V(3) YMAX SEED=9321 |PSPICE |

| | |

• Statistical Monte Carlo analysis can be carried out for ac, dc, and transient analysis. The parameter Nr_runs specifies how many times the analysis is to be repeated with randomly chosen parameters of circuit elements. The first run is done with nominal values of all components. Subsequent runs are done with random variations of the model parameters. In each case the parameters indicated by keywords DEV and LOT in the .MODEL statement will be changed. Values specified in the Output field will be monitored. The Output field uses the same format as the .PRINT statement. The Function must be one of the following:

• YMAX - finds the greatest difference in each waveform from the nominal run.

• MAX - finds the maximum value of each waveform

• MIN - finds the minimum value of each waveform

• RISE_EDGE (Value) finds the first occurrence of the waveform crossing above the threshold specified by Value.

• FALL_EDGE (Value) finds the first occurrence of the waveform crossing below the threshold specified by Value.

In older versions of PSPICE only the YMAX parameter was implemented.

The optional Option can be a list of the keywords:

• LIST - causes printing of model parameters for each run.

• OUTPUT (Type) - specifies type of the output (in older versions brackets for Type are not used):

◊ ALL - generates output for all runs including nominal.

◊ FIRST n - generates output for the first n runs.

◊ EVERY nth - generates output for every nth run.

◊ RUNS n1, n2, n3, … - generates output for listed runs. Up to 25 runs may be specified.

• RANGE (Low, High) - restricts the range over which Function is evaluated. Parameters low and high specify minimum and maximum values. If asterisk “*” is used instead Low or High then restrictions for lower or higher ranges are eliminated.

An optional SEED=Value defines the seed for the random-number generator within the Monte Carlo analysis. Value must be an odd integer ranging from 1 to 32,767. If the seed value is not explicitly set, it will default to 17,533. For almost all analyses, you will want to use the default seed value in order to achieve a constant set of results. But it is possible to modify the seed value when desired.

|.MODEL - Model Declaration | |

| | | |

|General forms |Restrictions |

|.MODEL Name Type [List_of_parameters] | |

|.MODEL Name [AKO:reference_model] Type [List_of_parameters] |PSPICE |

|+[T_MEASURED = Value ] | |

|+[T_ABS = Value ] or [T_REL_GLOBAL = Value ] or +[T_REL_LOCAL = Value ] | |

| | |

|Examples | |

|.MODEL DPOWER D IS=1E-8 | |

|.MODEL BIPMOD NPN BF=200 IS=1E-13 VBF=100 | |

|.MODEL CMOD CAP C=1uF DEV=10% LOT=2% | |

|.MODEL RMOD RES (R=1k TC=0.005 TC2=0.001) |PSPICE, SPICE3 |

|.MODEL QMOD AKO:QDR NPN (BF=100 BR=5 IS=1E-14) |newer PSPICE |

| | |

The .MODEL statement specifies parameters of circuit elements used in SPICE. The Name is an arbitrarily chosen name for the model. The same name must be used when an element is declared as a part of a circuit. The Name must start with a letter, and it is common practice to start it with the same letter as the model Type. The field Type identifies the type of circuit element. In the Type field the following keywords can be used:

|Symbol |Name |Restrictions |

|CAP |capacitor | |

|CORE |nonlinear magnetic core (transformer) |PSPICE |

|CSW |current-controlled switch |SPICE3 |

|D |diode | |

|DINPUT |digital input device |newer PSPICE |

|DOUTPUT |digital output device |newer PSPICE |

|GASFET |GaAs field effect transistor with n-type channel |PSPICE |

|IND |inductor | |

|ISWITCH |current-controlled switch |PSPICE |

|LPNP |lateral pnp transistor |PSPICE |

|LTRA |lossy transmission line |SPICE3 |

|NJF |JFET with n-type channel | |

|NMF |n-channel MESFET |SPICE3 |

|NMOS |MOS transistor with n-type channel | |

|NPN |NPN bipolar transistor | |

|PJF |JFET with p-type channel | |

|PMF |p-channel MESFET |SPICE3 |

|PMOS |MOS transistor with p-type channel | |

|PNP |PNP bipolar transistor | |

|RES |resistor | |

|SW |voltage-controlled switch |SPICE3 |

|VSWITCH |voltage-controlled switch |PSPICE |

|UADC |multi-bit analog-to-digital converter |newer PSPICE |

|UBTG |bi-directional transfer gate |newer PSPICE |

|UDAC |multi-bit digital-to-analog converter |newer PSPICE |

|UDLY |digital delay line |newer PSPICE |

|UIO |digital IO model |newer PSPICE |

|UEFF |edge-triggered flip-flop |newer PSPICE |

|UGATE |standard gate |newer PSPICE |

|UGFF |gated flip-flop |newer PSPICE |

|UPLD |programmable logic array |newer PSPICE |

|URAM |random-access (read/write) memory |newer PSPICE |

|URC |uniform distributed RC line |SPICE3 |

|UROM |read-only memory |newer PSPICE |

|UTGATE |tri-state gate |newer PSPICE |

Devices can reference models only of the correct type. There can be more than one model of the same type in a circuit, although they must have different names. The optional parameter AKO: (a kind of) uses parameters from Reference_model with the exception of the new parameters declared in this statement. The model types of the current model and the AKO model must be the same.

The [List_of_parameters] defines model parameters and tolerances for Monte Carlo and worst case analyses. None, any, or all parameters may be assigned values. Default values are used for all unassigned parameters. The lists of parameter names, meanings, and default values are located in the individual device descriptions.

For purposes of Monte Carlo and worst case analyses, some parameters may have a tolerance specification. The tolerance specification may be appended to each parameter, with the formats:

DEV Value [%] [LOT Value [%]] - older program versions

DEV [Track & Dist] Value [%] [LOT [Track & Dist] Value [%]]

If DEV is used as a keyword, then each individual element has its own randomly chosen value. In the case of the LOT keyword, all devices use the same randomly chosen fluctuation. For one parameter, both keywords DEV and LOT can be specified. For example, in the case of semiconductor resistors, the resistance parameter can be specified as R=1K DEV=0.5% LOT=10%. In this case the sheet resistance can vary by 10% (due to implantation and diffusion processes), but the relative tolerance between elements is 0.5% (due to precisely controlled mask patterns). The "%" indicates a relative (percentage) tolerance. If it is omitted, Value is in the same units as the parameter. Optional Track & Dist parameters specify tracking and non-default distribution, with the format [/lot #][/distribution_name]

These specifications must immediately follow the keywords DEV and LOT (without spaces) and are separated by "/". The parameter lot # specifies which of ten random-number generators, numbered 0 through 9, are used to calculate parameter value deviations. This allows deviations to be correlated between parameters in the same model, as well as between models. Tolerances without lot # get individually generated random numbers.

Distribution_name and the default distribution (set using the .OPTIONS statement DISTRIBUTION parameter) are one of the following:

• UNIFORM - generates uniformly distributed deviations over the range Value.

• GAUSS - generates deviations with a Gaussian distribution over the range 3s and Value specifies the 1s deviation (i.e., this will generate deviations greater than Value).

In PSPICE there is an option to overwrite the TNOM parameter for each individual model using the T_MEASURED keyword and assign as Value the actual temperature at which parameters were measured. Also, the relative model temperature can be specified using T_ABS, T_REL_GLOBAL and T_REL_LOCAL parameters. See the PSPICE reference manual for details.

|.NODESET - Set Node Parameters | |

| | | |

|General form |Restrictions |

|.NODESET V(Node1 [, Node2])=Val1 V(Node3 [, Node4])=Val2… | |

| | |

|Examples | |

|.NODESET V(12)=4.5 V(4)=2.23 | |

|.NODESET V(4,7)=2.5 V(5)=12 | |

| | |

The .NODESET statement sets initial values for node voltages. It is often used when the bias-point calculation does not converge. In the PSPICE program, node voltages can be specified, and so can the voltage between two nodes. This line is very helpful especially when bistable, multistable, or astable circuits are analyzed. It has no effect during the rest of the dc sweep, or during transient analysis. The bias-point calculation is usually done before transient analysis. The bias-point calculation before transient analysis can be skipped if the keyword UIC is used in the .TRAN statement. Also, the .OP statement enforces the bias-point calculation.

Unlike the .IC statement, .NODESET provides only an initial guess for some node voltages. It does not clamp those nodes to the specified voltages. However, by providing an initial guess, .NODESET may be used to "break the tie" in a flip-flop, for example, and to make it start in a desired state. If both .IC and .NODESET commands are present, the .NODESET commands are ignored for the bias-point calculations.

|.NOISE - Noise Analysis | |

| | | |

|General form |Restrictions |

|.NOISE V(Node1 [,Node2]) Source [Interval value] | |

| | |

|Examples | |

|.NOISE V(3) VIN 8 | |

|.NOISE V(4) VIN | |

|.NOISE V(15) VS 10 | |

|.NOISE V(2,3) INP | |

Noise analysis is performed during the ac analysis. The noise-generating elements in a circuit are the resistors and the semiconductor devices. SPICE will compute the equivalent output noise at the specified output as well as the equivalent input noise at the specified input. For each frequency of the ac analysis, every noise generator's contribution is calculated and propagated to the output nodes. There, all the propagated noise values are RMS-summed. The gain from the input source to the output voltage is also computed, and from it the total output noise and equivalent input noise are calculated. V(Node) is the voltage node that defines the summing point. Units are always V/Hz1/2. . V(Node [,Node]) is an output voltage across two nodes. The Source is the name of an independent voltage or current source at which the equivalent input noise will be calculated. Source is not itself a noise generator, but only a place at which to calculate the equivalent input noise. Units are V/Hz1/2 for voltage sources and A/Hz1/2 for current sources. Interval_value is the print interval. The contribution of every noise generator in the circuit will be printed at every Interval_value frequency point (the summary interval). If Interval_value is zero, no printout will be made.

|.OP - Operating Point Statement | |

| | | |

|General form |Restrictions |

|.OP | |

| | |

|Example | |

|.OP | |

The .OP statement causes the bias-point (Q-point) to be calculated. During this computation, all inductors are shorted and all capacitors are opened. The following results are printed in output file:

• Node voltages

• Currents through independent voltage sources

• Small-signal (linearized) parameters of all the nonlinear controlled sources and all the semiconductor devices

• Power dissipated by the circuit

|.OPTIONS - Option statement | |

| | | |

|General form |Restrictions |

|.OPTIONS Option1 Option2... (or Option3 = x ...) | |

| | |

|Example | |

|.OPTION NOPAGE NOMOD LIMPTS=501 | |

|.OPTIONS ACCT LIST NODE | |

|.OPTIONS ACCT RELTOL=.02 | |

|.OPTIONS NOECHO NOMOD DEFL=8u DEFW=6u DEFAD=100p | |

|+ DEFAS=100p | |

|.OPTIONS DISTRIBUTION=GAUSS |PSPICE |

|.OPTIONS DISTRIBUTION=USERDEF1 |PSPICE |

| | |

The .OPTION statement allows the user to reset program control and user options for specific simulation purposes. Many option lines are allowed in one SPICE input file. Any combination of the options in Tables 4.1 through 4.3 may be included, in any order. The x parameter represents any positive number.

Table 4.1 .OPTIONS parameters for SPICE2 standard

|option |Meaning |Default |

|ABSTOL=x |absolute current error tolerance. |1 pA. |

|ACCT |print the run time statistics | |

|CHGTOL= x |charge tolerance. |0.01 pC |

|CPTIME= x |maximum cpu-time in seconds allowed for this job. |no limit |

|DEFAD= x |MOS drain diffusion area (AD). |0.0 |

|DEFAS= x |MOS source diffusion area (AS). |0.0 |

|DEFL= x |MOS channel length (L). |100 (m |

|DEFW= x |MOS channel width (W). |100 (m. |

|GMIN= x |the minimum conductance allowed. |10-12 (-1 |

|ITL1= x |maximum number of dc iterations. |100 |

|ITL2= x |dc transfer-curve iteration limit. |50 |

|ITL3= x |minimum number of iterations at any point of a transient analysis. |4 |

|ITL4= x |maximum number of iterations at any point of a transient analysis. |10 |

|ITL5= x |maximum number of iterations for entire transient analysis. Set ITL5=0 to omit this test. |5000 |

|LIMTIM= x |amount of cpu time reserved by SPICE for generating plots should a cpu time-limit cause job |2 s |

| |termination. | |

|LIMPTS= x |total number of points that can be printed or plotted in a dc, ac, or transient analysis. |201 |

|LIST |causes the summary listing of the input data to be printed | |

|LVLTIM= x |if x = 1, the iteration time step control is used. if x = 2 the truncation-error time step is |2 |

| |used. If method = Gear and MAXORD>2 then LVLTIM is set to 2 by SPICE. | |

|MAXORD= x |sets the maximum order for the integration method if Gear's variable-order method is used The |2 |

| |x must be between 2 and 6. | |

|METHOD=x |sets the numerical integration method used by SPICE. Possible names are GEAR or trapezoidal. |trap |

|NOMOD |suppresses the printout of the model parameters. | |

|NOPAGE |suppresses page ejects. | |

|NODE |prints the node table. | |

|NUMDGT= x |number of significant digits printed for output variable values. |4 |

| |x must satisfy the relation 0 < x < 8. (Note: this option is independent of the error | |

| |tolerance used by SPICE2.) | |

|OPTS |causes the option values to be printed. | |

|PIVREL= x |resets the relative ratio between the largest column entry and an acceptable pivot value. In |0.001 |

| |the numerical pivoting algorithm the allowed minimum pivot value is determined by: | |

| |EPSREL=AMAX1(PIVREL*MAXVAL,PIVTOL) | |

| |where MAXVAL is the maximum element in the column in which a pivot is sought (partial | |

| |pivoting). | |

|PIVTOL= x |resets the absolute minimum value for a matrix entry to be accepted as a pivot. |10-13 |

|RELTOL= x |resets the relative error tolerance of the program. |0.001 |

|TNOM= x |Resets the nominal temperature. |27oC |

|TRTOL= x |resets the transient error tolerance. This parameter is an estimate of the factor by which |7.0 |

| |SPICE overestimates the actual truncation error. | |

|VNTOL= x |resets the absolute voltage error tolerance of the program. |1 (V |

Table 4.2 PSPICE extensions

|Option |Meaning |Default |

|DIGDRVF= x |minimum drive resistance (UIO type model, DRVH and DRVL parameter values). |2 ( |

|DIGDRVZ= x |maximum drive resistance (UIO type model, DRVH and DRVL parameter values). |20 k( |

|DIGERRDEFAULT= x |Default error limit for digital constraint devices. | |

|DIGERRLIMIT= x |Maximum digital error message limit. |0 |

|DIGFREQ= x |minimum digital time step is 1/DIGFREQ. |10 GHz |

|DIGINITSTATE= x |sets initial state of all flip-flops and latches in circuit: 0=clear, 1=set, 2=X. |2 |

|DIGIOLVL= x |Default digital I/O level: 1-4; see UIO model. |1 |

|DIGMNTYMX= x |Default delay selector: 1=min, 2=typical, 3=max, 4=min/max. Setting the |2 |

| |DIGMNTYMX=4 (min/max) directs the simulator to perform digital worst-case timing | |

| |simulation. | |

|DIGMNTYSCALE= x |Scale factor used to derive minimum delays from the typical delay |0.4 |

|DIGOVRDRV= x |Ratio of drive resistance required to allow one output to override another driving|3 |

| |the same node. | |

|DIGTYMXSCALE= x |Scale factor used to derive maximum delays from typical delays. |1.6 |

|DISTRIBUTION= x |Default distribution for Monte Carlo deviations |UNIFORM |

| |(x can be UNIFORM or GAUSS). | |

|EXPAND |lists devices created by subcircuit expansion and lists contents of the bias point| |

| |file. | |

|ITL1= x |dc and bias point "blind" iteration limit. |40 |

|ITL2= x |dc and bias point "educated guess" iteration limit. |20 |

|ITL3= x |not used. | |

|LIBRARY |list lines from library file. | |

|LIMTIM= x |not used. | |

|LIMPTS= x |total number of points that can be printed or plotted in a dc, ac, or transient |0 |

| |analysis. | |

|NOBIAS |suppresses the printing of the bias-point node voltages | |

|NOECHO |Suppresses listing of the input file. | |

|NOMOD |suppresses the printout of the model parameters and temperature updated values. | |

|NOOUTMSG |Suppresses simulation error message in the output file. | |

|NOPRBMSG |Suppresses simulation error message in the Probe data file. | |

|NOREUSE |Suppresses the automatic saving and restoring of bias-point information between | |

| |different temperatures, Monte Carlo runs, worst case runs, and parametric analyses| |

| |(.STEP). | |

|NUMDGT= x |Number of digits in print tables (maximum of 8 useful digits). |4 |

|VNTOL= x |Required accuracy of voltages. |1 (V |

|WIDTH= x |Same as the statement .WIDTH OUT=value. Can be set to either 80 or 132. PSPICE |80 |

| |always reads entire line so the IN keyword has no effect. | |

The default distribution is used for all of the deviations throughout the Monte Carlo analyses, unless specifically overridden for a particular tolerance. The default value is always UNIFORM, but it can also be set to GAUSS or a user-defined distribution. If a user-defined distribution is selected (as illustrated in the last example above), a .DISTRIBUTION statement must be included in the circuit file to define the user distribution for the tolerances. An example would be:

.DISTRIBUTION USERDEF1 (-1,1) (.5,1) (.5,0) (1,0)

Table 4.3 SPICE3 extensions

|Option |Meaning |

|BADMOS3 |use the old version of MOS3 model with “kappa” discontinuity |

|KEEPOPINFO |retain the operating point information when either an ac, distortion, or pole-zero analysis is run. |

|TRYTOCOMPACT |Applicable only to LTRA model. When specified, the simulator tries to condense LTRA transmission lines’ |

| |past history of input voltages and currents. |

| | |

| | |

|.PARAM - Parameter Statement | |

| |PSPICE |

| | | |

|General form |Restrictions |

|.PARAM [Name = Value] [Name = {Expression}] … |PSPICE |

| | |

|Examples | |

|.PARAM VBIAS = 15V |PSPICE |

|.PARAM VCC = 12V VEE = -12V |PSPICE |

|.PARAM PI = 3.14159, SHIFT={PI/4} |PSPICE |

|.PARAM RAD = 57.2957 PHASE1 = {0.1*RAD} PHASE2={0.2*RAD} |PSPICE |

|.PARAM BANDWIDTH = {1MEG/8} |PSPICE |

| | |

The keyword .PARAM is followed by a list of names with values or expressions. After Name, a Value or an Expression can be specified. If Expression is used, then it should be written in {} braces. The parameters need not be previously defined. The .PARAM statement can be used inside a subcircuit definition to create local subcircuit parameters. Once defined, a parameter can be used in place of most numeric values in the circuit description. There are several predefined parameters:

• TEMP temperature

• VT thermal voltage

• GMIN shunt conductance for semiconductor p-n junctions

|.PLOT - Plot Statement | |

| | | |

|General form |Restrictions |

|.PLOT DC [List_parameters] [Min, Max] | |

|.PLOT AC [List_parameters] [Min, Max] | |

|.PLOT TRAN [List_parameters] [Min, Max] | |

|.PLOT NOISE [List_parameters] [Min, Max] | |

|.PLOT DISTO [List_parameters] [Min, Max] | |

| | |

|Examples | |

|.PLOT DC I(VIN) I(VDD) (-1mA,4mA) I(V3) | |

|.PLOT AC V(2) V(3) V(5,4) | |

|.PLOT TRAN V(7) V(3,4) | |

|.PLOT TRAN V(2,3) (2mV,8mV) V(1,2) (-1V,12V) | |

|.PLOT DC V(1) V(4) V(7) | |

|.PLOT TRAN V(4,3) (2,5) I(VIN) (0,1mA) V(6) (1,9) | |

|.PLOT AC VM(3) VM(11,2) VDB(3) VP(3) | |

|.PLOT TRAN V(5,3) V(4) (0,10) V(7) (0,2) | |

|.PLOT NOISE INOISE ONOISE DB(INOISE) DB(ONOISE) | |

|.PLOT DISTO HD2 HD3(R) SIM2 | |

|.PLOT DC V(4) VGS(M7) VBE(Q8) |PSPICE |

|.PLOT DC IB(Q2) IC(Q3) ID(M5) |PSPICE |

The .PLOT statement causes generation of a graph to the output file. Curves are plotted by printing text characters on the graph. The characters # $ % * & o @ + = are usually used for plotting, and the “x” character is reserved for points where two or more points overlap. In the original SPICE2 version the number of plots was limited to eight for one .PLOT line. There is no limit on the number of .PLOT statements in the input file.

The syntax of the List_parameters is identical to the syntax in the .PRINT statement with one exception. In the .PLOT statement, optional scaling parameters can be added after the variable by specifying minimum and maximum values in brackets. For example, PLOT DC V(3) (-2,7) will cause plotting the voltage on the third node using -2 V to 7 V as scale. If the plot limits are not specified, the SPICE program will automatically scale the plot.

| .PRINT - Print Table | |

| | | |

|General forms |restrictions |

|.PRINT DC [List_parameters] | |

|.PRINT AC [List_parameters] | |

|.PRINT TRAN [List_parameters] | |

|.PRINT NOISE [List_parameters] | |

|.PRINT DISTO [List_parameters] | |

| | |

|Examples | |

|.PRINT AC V(2) V(3) V(5,7) | |

|.PRINT TRAN V(1) V(3,5) | |

|.PRINT TRAN V(2,3) (-1mV,2mV) V(4,6) | |

|.PRINT AC VM(2) VP(2) VM(3,4) VDB(5) VR(5) VI(5) | |

|.PRINT TRAN V(2) V(4,3) | |

|.PRINT NOISE INOISE ONOISE DB(INOISE) DB(ONOISE) | |

|.PRINT DISTO HD2 HD3R SIM2 | |

|.PRINT TRAN V(5) V(R7) IB(Q12) |PSPICE |

|.PRINT DC V(2) V(3) VBE(Q2) |PSPICE |

|.PRINT DC I(VIN) I(VCC) I(R4) |PSPICE |

|.PRINT DC V(2) V(7,3) V(R8) I(VIN) I(R6) IB(Q12) VBE(Q13) |PSPICE |

|.PRINT TRAN V(2) V(3,7) ID(M6) I(VDD) |PSPICE |

The .PRINT statement defines the table of one to eight (in SPICE2) output variables to be printed to the output file. The List_parameters is the list of desired voltage or current output variables separated by blank spaces or commas.

Voltages could be specified as:

V(Node_number) - node voltage

examples: V(2), V(12), V(4)

V(Node1,Node2) - voltage difference between Node1 and Node2

examples: V(1,2), V(7,9), V(14,3)

V(element_name) - voltage across element_name using the positive sign convention

examples: V(R7), V(C3), V(14,3)

PSPICE also accepts the following forms:

VBE(Q-name), VCE(Q-name) - voltage across bipolar transistor terminals

examples: VBE(Q7), VCE(Q3)

VGS(M-name), VDS(M-name) - voltage across MOSFET transistor terminals

examples: VGS(M7), VDS(M3)

Currents could be specified as:

I(voltage_source) - current through independent voltage source with the name

voltage_source

examples: I(VIN), I(VSENS), I(VCC)

I(device_name) - current through device with the name device_name

examples: I(R3), I(L7), I(R5)

PSPICE also accepts the following forms:

ID(M_name) - the drain current of MOSFET or JFET transistors

examples: ID(M7), ID(M3), ID(M2)

IC(Q_name) - the collector current of a bipolar transistor

examples: IC(Q7), IC(Q3), IC(Q2)

IB(Q_name) - the base current of bipolar transistors

examples: IB(Q7), IB(Q3), IB(Q2)

In the case of ac analysis (keyword .AC) additional letters behind V or I may specify the type of data:

I - imaginary part

R - real part

M - magnitude of the complex number

P - phase of the complex number

DB - magnitude of the complex number expressed in dB - 20*log10(magnitude)

In case of the noise analysis (keyword .NOISE), the following additional keywords can be used:

ONOISE - total noise on the output

INOISE - equivalent noise on the input

DB(ONOISE - total noise on the output in dB with 1 V/Hz1/2 as the reference

DB(INOISE - equivalent noise on the input in dB with 1 A/Hz1/2 as reference

Square brackets force the interpretation of names to mean node names as it is shown in the last example (PSPICE only). An analysis may have any number of .PRINT statements.

| .PROBE - Save Data for the Probe Program | |

| |PSPICE |

| | | |

|General form |Restrictions |

|PROBE [/CSDF] [List_parameters] |PSPICE |

| | |

|Examples | |

|.PROBE |PSPICE |

|.PROBE V(3) V(2,3) V(R1) I(VIN) I(R2) IB(Q13) VBE(Q13) |PSPICE |

|.PROBE/CSDF |PSPICE |

|.PROBE/CSDF V(12) V(2) V(3,5) |PSPICE |

| | |

The .PROBE statement saves results of computations in a file using a binary format or ASCII format for the /CSDF switch. The default name of this file is PROBE.DAT. The probe program reads this data file and plots the desired characteristic in a graph. When the .PROBE statement is used without parameters, all results are saved. This is practical only for relatively small circuits.

The List_parameters is similar to that for in the .PRINT statement. Unlike the .PRINT and .PLOT statements, however, there is no analysis name before the output variables. Also, the number of output variables is not restricted to 8.

| .SAVE - Save Data for Nutmeg Program | |

| |SPICE3 |

| | | |

|General form |Restrictions |

| .SAVE List_parameters |SPICE3 |

| | |

|Examples | |

|.SAVE V(7) V(2,3) I(VIN) |SPICE3 |

|.SAVE V(3) I(V7) I(V12) |SPICE3 |

| | |

The SPICE3 program usually saves all node voltages and branch currents for later use by SPICE3 or by nutmeg (data analysis program for SPICE3). The .SAVE statement saves only listed parameters. The List_parameters is the same as for the .PRINT statement.

|.SAVEBIAS - Save Bias Point Data | |

| |PSPICE |

| | | |

|General form |Restrictions |

|.SAVEBIAS "File_name" OP [NOSUBCKT] [Parameters] |PSPICE |

|.SAVEBIAS "File_name" TRAN [NOSUBCKT] [Parameters] |PSPICE |

|.SAVEBIAS "File_name" DC [NOSUBCKT] [Parameters] |PSPICE |

| | |

|Examples | |

|.SAVEBIAS "OPPOINT" OP |PSPICE |

|.SAVEBIAS "BIAS.DAT" DC |PSPICE |

|.SAVEBIAS "TDATA.BSP" TRAN NOSUBCKT TIME=1u |PSPICE |

|.SAVEBIAS "CIR.SAV" DC MCRUN=3 DC1=3.5 DC2=100 |PSPICE |

|.SAVEBIAS "SAVE2.DAT" TRAN TIME=10n REPEAT TEMP=20.0 |PSPICE |

| | |

The .SAVEBIAS statement is used to save the bias-point node voltages to File_name for the specified analysis. File_name can be any character string which is a legal file name for the computer system and must be enclosed in quotation marks. The .SAVEBIAS and .LOADBIAS statements can be used to shorten the simulation time of large circuits, and also to aid in convergence. When NOSUBCKT is used, the node voltages for subcircuits are not saved.

The following Parameters can be optionally used:

• TIME=Value [REPEAT] is used to define the transient analysis time at which the bias-point is to be saved. If REPEAT is not used, then the next bias-point greater than or equal to TIME=Value is saved. If REPEAT is used, then TIME=Value is the interval at which the bias-point is saved. However, only the latest bias-point is saved; any previous times are overwritten. TIME=Value [REPEAT] can only be used with a transient analysis.

• TEMP=Value defines the temperature at which the bias- point is to be saved.

• STEP=Value is the step value at which the bias-point is to be saved.

• MCRUN=Value is the number of the Monte Carlo or worst-case analysis run for which the bias-point is to be saved.

• DC=Value is used to specify the DC sweep value at which the bias point is to be saved. It should be used if there is only one sweep variable.

• DC1=Value, and DC2=Value are used to specify the dc sweep value at which the bias point is to be saved. They are used for two sweep variables. DC1=Value should be used to specify the first sweep value, and DC2=Value should be used to specify the second sweep value.

The saved bias-point information is in the following format: one or more comment lines indicating the circuit name, title, date and time of run, analysis, temperature, etc., and a single .NODESET statement containing the bias-point voltage values. Only one bias-point is saved to the file during any particular analysis. At the specified time, the bias point information and the operating point data for the active devices and controlled sources are written to the output file. When the supplied specifications on the command line match the "state" of the simulator during execution, the bias-point is written out.

Use of the REPEAT keyword in the last example causes the bias-point to be written out every 10 ns when the temperature of the run is 20 degrees. Only one set of bias-point information resides in the file at any time. The REPEAT keyword may only be used with the transient analysis. To repetitively save the most recent bias-point, set TIME=0 and use the REPEAT keyword.

|.SENS - Sensitivity Analysis | |

| | | |

|General form |Restrictions |

|.SENS Out_var1 [Out_var2 Out_var3 …] | |

| | |

|Examples | |

|.SENS V(2) V(3,5) V(7) I(VIN) | |

|.SENS V(7) I(VDD) | |

| | |

The .SENS statement causes dc small-signal sensitivity analysis. The analysis is performed for each specified output variable. The output variables have a format similar to that of the .PRINT statement for dc and transient analyses. For the case of a current, the output variable is restricted to a current through a voltage source. By linearizing the circuit about the bias point, the sensitivity of each of the output variables to all the element values and model parameters will be calculated, and saved in the output file. For large circuits, very large amounts of output data can be generated.

|.STEP - Parametric Analysis | |

| |PSPICE |

| | | |

|General form |Restrictions |

|.STEP Var_name LIST [Value1 Value2…] |PSPICE |

|.STEP LIN Var_name Start Stop Increment |PSPICE |

|.STEP DEC Var_name Start Stop Increment Nr_points |PSPICE |

|.STEP OCT Var_name Start Stop Increment Nr_points |PSPICE |

| | |

|Examples | |

|.STEP RES RMOD(R) 10,15,1 |PSPICE |

|.STEP DEC NPN QMOD(BF) 30 300 20 |PSPICE |

|.STEP OCT D DMOD(IS) 1pA 32pA 10 |PSPICE |

|.STEP PARAM PAR12 0 5 1 |PSPICE |

| | |

The .STEP statement causes a parametric sweep to be performed on Var_name for all of the analyses of the circuit. .STEP is at the same "level" as the .TEMP command; all of the ordinary analyses (.DC, .AC, .TRAN, etc.) are done for each step. Once all the runs are completed, an entire .PRINT table or .PLOT plot for each value of the sweep will be output, just as for the .TEMP or .MC commands.

Start may be greater or less than Stop that is, the sweep may go in either direction. Increment and Nr_points must be greater than zero.

The sweep can be linear, logarithmic, or a list of values. The sweep types are:

• LIN - Linear sweep. The sweep variable is swept linearly from the starting to the ending value. Increment is the step size.

• OCT - Sweep by octaves. The sweep variable is swept logarithmically by octaves. Nr_points is the number of steps per octave.

• DEC - Sweep by decades. The sweep variable is swept logarithmically by decades. Nr_points is the number of steps per decade.

• LIST - Use a list of values. In this case there are no start and end values. Instead, the numbers that follow the keyword LIST are the values that the sweep variable will use.

(Note: The values must be in either ascending or descending order.)

Var_name can be one of the following types:

• Source: The name of an independent voltage or current source. During the sweep, the source's voltage or current is set to the sweep value.

• Model parameter: A model type and model name followed by a model parameter name in parentheses. The parameter in the model is set to the sweep value.

• Temperature: Use the keyword TEMP for Var_name. The temperature is set to the sweep value. For each value in the sweep, all the circuit components have their model parameters updated to the specified temperature.

• Global parameter: Use the keyword PARAM, followed by the parameter name, for Var_name. During the sweep, the global parameter's value is set to the sweep value and all expressions are reevaluated.

The .STEP statement is similar to the .DC statement and immediately raises the question of what happens if both .STEP and .DC try to set the same value. The same question can come up with Monte Carlo analysis. The answer is that this is disallowed: no two analyses (.STEP, .TEMP, .MC, .WCASE, and .DC) can try to set the same value. This is flagged as an error and no analyses are done. The .STEP command provides the capability to look at the response of a circuit as a parameter varies. For example, how does the center frequency of a filter shift as a capacitor varies? With .STEP you can vary the capacitor value and then see a family of frequency response waveforms that show the variation. Similar comments apply to looking at the propagation delay in transient simulation.

|.SUBCKT - Subcircuit Definition | |

| | | |

|General forms |Restrictions |

|.SUBCKT Sub_name Node1 [ Node2 Node3 ….] | |

|.SUBCKT Sub_name Node1 [ Node2 Node3 ….] |PSPICE |

|+ [OPTIONAL: [ [Interface_node] = [Default_value] ] …] | |

|+ [PARAMS: [ [Name] = [Value] ] … ] | |

|+ [TEXT: [ [Name] = [Text] ] … ] | |

| | |

|Examples | |

|.SUBCKT LM101 1 2 4 5 | |

|.SUBCKT NAND3 1 2 3 6 12 | |

|.SUBCKT OPAMP 3 4 5 9 | |

A subcircuit definition starts with a .SUBCKT line. The sub_name is the name of the subcircuit and Node1 [ Node2 Node3 ….] specify nodes which are connected to external circuits. The group of element lines that immediately follow the .SUBCKT line define the subcircuit. Node, device, and model names are local to the subcircuit in which they are defined. The subcircuit description is terminated by the .ENDS statement. The following statements are allowed in a subcircuit description:

• Element declarations including calls to other subcircuits (start with letter X)

• Model declarations

Another subcircuit declaration is not allowed within a subcircuit description. The subcircuit definition can call another subcircuit using the subcircuit element line which begins with X. Special care must be taken to avoid recurrent calling loops. A subcircuit must not call itself even indirectly.

The keyword OPTIONAL: allows specification of one or more optional nodes (pins) in the subcircuit definition. The optional nodes are stated as a pair consisting of an interface node and its default value. If an optional node is not specified in a subcircuit call (X statement), its default value is used inside the subcircuit; otherwise, the value specified in the subcircuit call is used. This feature is particularly useful when specifying power supply nodes, because the same nodes are normally used in every device. This makes the subcircuits easier to use because the two nodes do not have to be specified in each subcircuit call. This method is used in the PSPICE libraries provided with the Digital Simulation feature.

The keyword PARAMS: permits values to be passed into subcircuits as arguments and used in expressions inside the subcircuit. The keyword TEXT: allows text values to be passed into subcircuits as arguments and used as expressions inside the subcircuit. Once defined, a text parameter can be used in the following places:

• To specify a JEDEC file name for a PLD device

• To specify an Intel Hex file name to program a ROM device or initialize a RAM device

• To specify a stimulus file name or signal name on a FSTIM device

• To specify a text parameter to a subcircuit

• As part of a text expression used in one of the above

The text parameters and expressions are currently used only by the Digital Simulation feature of PSPICE.

|.TEMP - Temperature Statement | |

| |SPICE2, PSPICE |

| | | |

|General forms |Restrictions |

|.TEMP T1 T2 T3 ... |SPICE2, PSPICE |

| | |

|Examples | |

|.TEMP -55.0 25.0 125.0 | SPICE2, PSPICE |

|.TEMP 20 30 50 |SPICE2, PSPICE |

The .TEMP statement specifies the temperatures in oC at which the circuit is to be simulated. T1, T2, ... are the different temperatures. If the .TEMP line is omitted, the simulation will be performed at a temperature equal to TNOM, the default nominal temperature. The TNOM parameter can be changed using the .OPTION statement.

|.TEXT - Text Parameter Definition | |

| |PSPICE |

| | | |

|General forms |Restrictions |

|.TEXT Name =“Text” |PSPICE |

|.TEXT Name =| Text_expression | |PSPICE |

| | |

|Examples | |

|.TEXT INFILE = “CIR.DAT” | PSPICE |

|.TEXT DATA = “OUT.TXT” |PSPICE |

|.TEXT DATA1 = “DAT1.TXT”, DATA2 = “DAT2.TXT” |PSPICE |

The .TEXT statement defines a text variable. The name cannot be a .PARAM name.

|.TF - Transfer Function | |

| | | |

|General form |Restrictions |

|.TF Output_variable Source_name | |

| | |

|Examples | |

|.TF V(6,7) VIN | |

|.TF I(V12) VIN | |

|.TF V(4) VSOURCE | |

The .TF statement defines the output and input variables for a dc small-signal analysis. The .TF statement causes the small-signal dc gain to be calculated by linearizing the circuit around the bias point. The gain from Source_name to Output_variable will be calculated along with the input and output resistances. The results of the .TF statement are available only in the output file.

Output_variable is the output variable and Source_name is the input source.

|.TRAN - Transient Analysis | |

| | | |

|General forms |Restrictions |

|.TRAN[/OP] Tstep Tstop [Tstart [ Mstep]] [UIC] | |

| | |

|Examples | |

|.TRAN 1US 100US | |

|.TRAN 10ns 1000ns 200ns | |

|.TRAN 10ns 1000ns 200ns 10ns | |

|.TRAN 20ns 1us UIC | |

|.TRAN/OP 1us 100us 20us UIC | |

|.TRAN 0.1ns 100ns 20ns 1ns | |

The .TRAN statement causes a transient analysis to be performed. The transient analysis calculates the circuit's response over time, starting at t=0 and going to t=Tstop. Tstep determines how often data are printed or plotted. All computations start with t=0; the data are sent to the output for t ( Tstart. The default value for Tstart is zero. The internal time step used during the transient analysis is chosen automatically, and it is usually small. However, if the internal time step is large, then the output data are interpolated between points. The parameter Tstart determines the lowest value of time t for which data are sent to the output file. Results between t=0 and Tstart are ignored. The internal default time step in transient analysis is always smaller than Tstop/50. This means that at least 50 time steps must be performed. The default value can be changed by specifying the optional Mstep parameter. Changing the default value can be useful for improving the accuracy of Fourier analysis using the .FOUR statement.

The dc bias point is usually calculated before transient analysis. The switch /OP causes the initial values to be printed to the output file. This bias-point calculation can be skipped if the keyword UIC is used. In this case, all initial values will be set to zero unless other values are specified by the .IC statement.

|.WATCH - Watch Analysis Results | |

| |PSPICE |

| | | |

|General forms |Restrictions |

|.WATCH DC Out_var [(Lower_limit Upper_limit)] …. |PSPICE |

|.WATCH AC Out_var [(Lower_limit Upper_limit)] …. |PSPICE |

|.WATCH TRAN Out_var [(Lower_limit Upper_limit)] …. |PSPICE |

| | |

|Examples | |

|.WATCH DC V(3) (-2V,2V) V(3,6) V(R2) |PSPICE |

|.WATCH AC VM(7) VP(7) |PSPICE |

|.WATCH TRAN VBE(Q3) (0,1V) ID(M2) I(VBB) (0,5mA) |PSPICE |

The .WATCH statement causes results from an analysis to be displayed on the screen while the simulation is running. The .WATCH statement can be used for dc, ac, and transient analyses. Three to eight output variables can be printed on the screen depending on the program version. The Out_var has a format similar to the .PRINT statement. In addition to the format of the .PRINT statement, the range of each parameter can be set. Two additional parameters may be specified after the name of each variable: Lower_limit and Upper_limit. When an output value exceeds the specified limits, the program beeps and pauses, prompting the user for its continuation or abortion.

|.WCASE - Worst Case Analysis | |

| |PSPICE |

| | | |

|General forms |Restrictions |

|.WCASE DC Out_var Function [Option] |PSPICE |

|.WCASE AC Out_var Function [Option] |PSPICE |

|.WCASE TRAN Out_var Function [Option] |PSPICE |

| | |

|Examples | |

|.WCASE TRAN V(2) YMAX |PSPICE |

|.WCASE DC IC(Q3) YMAX VARY DEV |PSPICE |

|.WCASE AC VP(3,12) YMAX DEVICES RQ OUTPUT ALL |PSPICE |

The .WCASE statement causes a sensitivity and worst-case analysis. Unlike .MC, .WCASE varies only one parameter per run. This allows the simulator to calculate the sensitivity of the output waveform to each parameter. Once all the sensitivities are known, a final run is done with all parameters varied so as to produce the worst-case waveform. The sensitivity and worst-case runs are done with variations of model parameters as specified by the DEV and LOT tolerances on each .MODEL parameter in a manner similar to .MC analysis. You can run either .MC or .WCASE, but not both, in the same circuit. Exactly one of DC, AC, or TRAN must be specified. The analysis will be repeated in subsequent passes of the analysis.

Out_var is identical in format to a .PRINT output variable. Function specifies the operation to be performed on the values of the Out_var to reduce these to a single value. This value is the basis for the comparisons between the nominal and subsequent runs. Function must be one of:

• YMAX - finds the absolute value of the greatest difference in each waveform from the nominal run

• MAX - finds the maximum value of each waveform

• MIN - finds the minimum value of each waveform

• RISE_EDGE (Value) - finds the first occurrence of the waveform crossing above the threshold specified by Value

• FALL_EDGE (Value) finds the first occurrence of the waveform crossing below the threshold specified by Value

[Option] is an optional list of the parameters:

• LIST - Prints the updated model parameters for the sensitivity analysis

• OUTPUT ALL - requests output from the sensitivity runs, after the nominal (first) run. If OUTPUT ALL is omitted, then only the nominal and worst-case runs produce output.

• RANGE (Low, High) - restricts the range over which Function is evaluated. Parameters low and high specify minimum and maximum values. The asterisk “*” can be used to eliminate the lower or upper restriction. If RANGE is omitted, then Function is evaluated over the whole sweep range. This is equivalent to RANGE(*,*).

• HI or LOW - specifies which direction the worst-case run is to go (relative to the nominal). If Function is YMAX or MAX, the default is HI; otherwise the default is LOW.

• VARY DEV VARY LOT VARY BOTH - By default, any device which has a model parameter specifying either a DEV tolerance or a LOT tolerance will be included in the analysis. You may limit the analysis to only those devices which have DEV or LOT tolerances by specifying the appropriate option. The default is VARY BOTH. When VARY BOTH is used, sensitivity to parameters with both DEV and LOT specifications is checked only with respect to LOT variations. The parameter is then maximized utilizing both DEV and LOT tolerances. All devices referencing the model will have the same parameter value for the worst-case simulation.

• DEVICES (list of device types) By default, all devices are included in the sensitivity and worst-case analyses. You may limit the devices considered by listing the device types after the keyword DEVICES. Do not have any spaces or tabs in the list. For example, to only perform the analysis on resistors, diodes, and bipolar transistors, enter: DEVICES RDQ

|.WIDTH - Width Statement | |

| | | |

|General form |Restrictions |

|.WIDTH IN=In_columns OUT=Out_columns | |

| | |

|Example | |

|.WIDTH IN=72 OUT=132 | |

The .WIDTH statement sets number of columns in the input and output files. In_columns is the last character read from each line of the input file; the statement takes effect with the next line read. Out_columns is the maximum number of columns in the output file. The default value for both In_columns and Out_columns is 80. Only print widths 80 and 132 were allowed in the original SPICE2 version. In some newer versions of SPICE program, this statement is obsolete and it is ignored.

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download