HSPICE Commands

Introduction ] Files ] Source File ] Devices ] [ Commands ] Notes ]

This page is a slightly edited version of material published by the EE department at University of Pennsylvania.  

Commands or Control Statements to Specify the Type of Analysis

a) .OP Statement

This statement instructs Spice to compute the DC operating points:
In HSpice it is usually not necessary to specify .OP as it gives you automatically the DC node voltages. However, HSpice does not give the DC voltages unless you have specified a certain analysis type, such as for instance .TRAN, or .AC analysis (Spice automatically does a DC analysis before doing a transient or AC analysis). Thus, if you are only interested in the DC voltages in HSpice, you should specify the .OP option, or the .DC option (see further).

b) .DC Statement

This statement allows you to increment (sweep) an independent source over a certain range with a specified step. The format is as follows:
 
.DC SRCname START STOP STEP in which SRC name is the name of the source you want to vary; START and STOP are the starting and ending value, respectively; and STEP is the size of the increment.
 
  Example: .DC V1 0 20 2 When the Start and Stop values are identical (and the Step is non-zero), the .DC command produces only one value. This may be useful in HSpice when you do not want all the DC voltages and currents to be printed (with the .OP option), but are interested in a limited number of DC voltages and currents. In the .PRINT statement (see further) you would then also specify the node voltages you like to know (ex. .DC Vs 3 3 1 and .PRINT DC V(2), V(3), I(Vmeas) ).

You can nest the DC sweep command which is often used to plot transistor characteristics, such as the Drain current ids versus the Drain-source voltage Vds for different gate voltages Vgs. This can be done as follows:
 
  .DC SRCname1 START STOP STEP SRCname2 START STOP STEP

Example: .DC Vds 0 5 0.5 Vgs 0 5 1

In the example above, the voltage Vds will be swept from 0 to 5V in steps of 1V for every value of Vgs.

c) .TF Statement

The .TF statement instructs HSpice to calculate the following small signal characteristics:
 
 
  1. the ratio of output variable to input variable (gain or tranfer gain)
  2. the resistance with respect to the input source
  3. the resistance with respect to the output terminals
.TF OUTVAR INSRC in which OUTVAR is the name of the output variable and INSRC is the input source.
 
  Example: .TF V(3,0) VIN The .TF statement can be used to find the Thevenin small signal equivalent resistance. (The Thevenin voltage is given by the node voltage at the open circuit terminal, as a result of the .OP statement). See also Output Statements later on.
 
 

d) .SENS Statement

This instructs HSpice to calculate the DC small-signal sensitivities of each specified output variable with respect to every circuit parameter.
 
  .SENS VARIABLE

Example: .SENS V(3,0)

e) .TRAN Statement

This statement specifies the time interval over which the transient analysis takes place, and the time increments. The format is as follows:
 
  .TRAN TSTEP TSTOP <TSTART <TMAX>> <UIC>
 
 
TSTEP is the printing increment.
TSTOP is the final time
TSTART is the starting time (if omitted, TSTART is assumed to be zero)
TMAX is the maximum step size.
UIC stands for Use Initial Condition and instructs HSpice not to do the quiescent operating point before beginning the transient analysis. If UIC is specified, HSpice will use the initial conditions specified in the element statements (see data statement) IC = value.
See also Output Statements later on.

f) .IC Statement

This statement provides an alternative way to specify initial conditions of nodes (and thus over capacitors).
 
  .IC Vnode1 = value Vnode2 = value etc.

g) .AC Statement

This statement is used to specify the frequency (AC) analysis. The format is as follows:
 
 
.AC LIN NP FSTART FSTOP
.AC DEC ND FSTART FSTOP
.AC OCT NO FSTART FSTOP
in which LIN stands for a linear frequency variation, DEC and OCT for a decade and octave variation respectively. NP stands for the number of points and ND and NO for the number of frequency points per decade and octave. FSTART and FSTOP are the start and stopping frequencies in Herz
 
  Example: .AC DEC 10 1000 1E6 See also Output Statements later on. For an example circuit see under the section Examples.
 
 

h) For .NOISE, .DISTO, and .FOUR statements

Please consult the manual.
 
 

Output Statements

These statements will instruct HSpice what output to generate. If you do not specify an output statement, HSpice will always calculate the DC operating points. The two types of outputs are the prints and plots. A print is a table of data points and a plot is a graphical representation. The format is as follows:
 
  .PRINT TYPE OV1 OV2 OV3 ...

.PLOT TYPE OV1 OV2 OV3 ...

in which TYPE specifies the type of analysis to be printed or plotted and can be:
 
  The output variables are OV1, OV2 and can be voltage or currents in voltage sources. Node voltages and device currents can be specified as magnitude (M), phase (P), real (R) or imaginary (I) parts by adding the suffix to V or I as follows:
 
  Examples:
 
  .PLOT DC V(1,2) V(3) I(Vmeas)

.PRINT TRAN V(3,1) I(Vmeas)

.PLOT AC VM(3,0) VDB(4,2) VM(2,1) VP(3,1) IR(V2)

The material in this website is an expanded version of material presented by Dr. J. Steensgaard. This website is maintained by Shouri Chatterjee.  This page was last updated on 02/11/2003