HSPICE Quick Manual
1. Input File
HSPICE input is composed of (mainly) four part.
1.1. Title line
Title line is always the first line of the input file. HSPICE
simply neglects it. Since this line is echoed back in the outputfile for the
page header, it is a very good place to describe what this simulation is
for. This line is required, so make sure not to put an actual netlist element there, as it will be ignored by SPICE
1.2. Element description
Will be discussed in more detail later.
1.3. Control
lines
Command lines that you use to control the behavior of HSPICE.
1.4. .END
Anything after the .END line is ignored.
* Comment
Any line starting with * is considered as a comment.
* Line continuation
Any line that starts with + sign is considered as the
continuation of the previous line.
2. Element Description
2.1. Active device
2.1.1. MOS
Any line that starts with M is considered as the description
line for a MOS transistor.
MXX Node_D Node_G Node_S Node_B
MODEL_NAME
+ W=W_VALUE L=L_VALUE [AD=AD_VALUE] [AS=AS_VALUE]
+
[PD=PD_VALUE] [PS=PS_VALUE]
W, L : Width and Length of MOS
AS,
AD : the area of the source, drain region(optional)
PS, PD : the
peripheral length of source, drain region
You will need to specify
AD, AS, PD, and PS if you are concerned about the parasitic capacitances
of the drain and source area.
(Example)
M100 4 1 3 3 NCH
W=10u L=1u AD=30p AS=30P PD=16u PS=16U
defines a MOS transistor
named M100 with its drain connected to node 4, gate to 1, source and bulk
to node 3. Its width is 10, length 1 micron. Area for the source and drain
are 30*10E-12, and their peripherals. Now since the model is NCH, you need
to define its model. The simplest for of MOS model definition would be :
.MODEL NCH NMOS
The above line tells you that the mos type
NCH is a NMOS device. It doesn't say anything more than that, so you may
want to, at least, add its threshold voltage.
MODEL NCH NMOS
+
VT0 = 0.7 ...
For the model parameters, refer Textbook P. 185 ~ P.
187.
2.1.2. Bipolar transistor
QXX N_Collector N_Base N_Emitter MODEL
2.1.3 Diode
DXX N_anode N_cathode MODEL
2.2. Passive
Device
RXX N1 N2 Rvalue ---- Resistor
CXX N1 N2 Cvalue ----
Capacitor
LXX N1 N2 Lvalue ---- Inductor
2.3. Independent
source
There are two types of independent source, voltage source and
current source.
2.3.1. Pulse
Most frequently used time-varying waveform is a pulse. For
example, a line like the following:
V1 10 11 pulse 0 5 10n 1n 2n 4n 10n
says that
there's a voltage source connected between node 10 and node 11, which
toggles between 0V and 5V, with leading time (delay) of 10n, 1ns rising
time, 2ns falling time and 4ns high time, and period 10ns.
Be
careful, however, if you write
V1 10 11 pulse 5 0 10n 1n 2n 4n 10n
now the 1ns
is falling time, not rising time since V1 is originally 5v instead of 0V.
2.3.2. PWL
PWL is used for piecewise linear waveform. Most flexible, but
need many parameters to use.
VNAME n1 n2 pwl t0 v0 t1 v1 t2 v2 t3 v3 ...
The
value of VNAME is v0 at t=t0, v1 at t=t1, and so on.
2.3.3.
Sine
Sin is for sinusoidal waveform.
V1 10 0 sin v_off v_amp freq [phase]
v_off is
offset value, v_amp is the amplitude, freq is the frequency
2.4. Dependent source
Dependent sources are very useful elements in HSPICE. The four
kinds of inear dependent sources are :
VCCS : voltage-controlled current source (G element)
VCVS
: voltage-controlled voltage source (E element)
CCCS :
current-controlled current source (F element)
CCVS :
current-controlled voltage source (H element)
They are
described in the following form.
GXX N+ N- NC+ NC- Gain
EXX N+ N- NC+ NC- Gain
FXX N+
N- NC+ NC- Gain
HXX N+ N- NC+ NC- Gain
3. Analysis
3.1. DC analysis
When you want to perform a DC analysis, you use the .DC control
line. Its format is
.DC VARIABLE start_value stop_value increment_value
HSPICE will step throught the VARIABLE value start from the
start_value in increment of increment_value until the VARIABLE reaches the
stop_value.
Associated with any .DC control should be a .PRINT or
.PLOT control line which will cause an output to be written to the HSPICE
output.
3.2. AC analysis
.AC LIN n_point fstart fstop
.AC DEC n_point fstart fstop
.AC OCT n_point fstart fstop
HSPICE calculates the
operating condition, and form a small-signal equivalent circuit for the
given netlist. Then it performs ac analysis. You need to have at least one
AC independent source. The frequency of any AC source in the circuit is set
to fstart. The frequency increment value is defined by the increment option.
If LIN is used, frequency is sweeped from fstart, and ends when frequency =
fstop. Total number of frequency points used in this simation is n_point. If
DEC is used, there are going to be n_point points within one decade, and
there are n_point points within one octave if OCT is used.
Associated with any .AC statement should be a .PRINT or .PLOT or
.PROBE.
Suppose you have a simulation setup like the following :
Vin 1 0 DC=1 AC
.AC DEC 10 10 100MEG
.print ac vdb(10)
vp(10)
Then HSPICE will print out the voltage at node 10 with
various frequency from 10Hz to 100MegHz in decibel scale. It will print out
the phase of node 10, too.
If node 1 was the input for the circuit,
then the printed output Vdb(10) will be the gain of your circuit from node 1
to 10. Since 'DEC 10' is used, there will be 10 points (in log scale) within
each decade.
3.3. Transient analysis.
.TRAN t_increment t_stop
HSPICE will start
simulating the circuit from time 0 to t_stop. The internal timing step is
adjusted automatically to get the required accuracy. Parameter t_increment
is used for output printout. It is also used in the internal time-step
control algorithm, so when a accurate simulation is required, use a smaller
number.
3.4 TF analysis
....
VIN 1 0 3v
.TF v(10) vin
....
will
print out the transfer gain from the source specified as vin to the voltage
of node 10.
The value specified when vin is defined (3 volt in this
example) is used for bias calculation.
4. Misc and Notes
Please use .OP control. .OP will print out the operating point
information for each node, each voltage and current source, and each element.
The output from .OP is very useful in understanding the behavior of each
evices.
For example, if you have too little gain from simulation
result, most likely some transistors are biased in linear region(MOS case).
You can easily check this by looking at the gm of the transistors.
I hope this will cover most of the stuff you need to know
for the class. I will post later on if some more detailed information seems to
be neccesary.