HSPICE Tutorial
Introduction
HSPICE is Avant!'s version of SPICE, the
industry-standard circuit simulator. In this tutorial, you will
follow the steps to simulate a CMOS inverter using the AMI 0.5
micron process design rules, and then try simulating a NAND gate
on your own. Please refer to the online HSPICE and AvanWaves documentation
for clarification as needed.
Setting Up Your Environment
- Create a course directory called vlsi
for all work in this course, and under that another directory
called hspice_tut
- Copy the file /usr/local/courses/cse/cse462.01/hspice/ami05.md
to your hspice_tut directory
- At the unix prompt, type
source /usr/local/src/hspice/v2001.4/2001.4/bin/cshrc.meta
You should put this statement into your
.cshrc file so that you don't need enter it for each hspice session.
Editing the Input File
Spice files contain a number of sections:
- title line
- the first line of the file is always interpreted
as the title
- comments
- lines that begin with * or $
- netlist declaration
- a list of the devices in the circuit,
with each device specifying node connections at terminals
- subcircuit definitions
- a mechanism for expressing hierarchy in
the circuit; we won't use it here
- device model definitions
- we'll use AMI 0.5 micron models obtained
from MOSIS
- stimuli
- voltage and current sources and associated
waveforms
- pulses, piecewise linear waveforms, sinusoids
- simulation control commands
- what kind of simulation: DC, transient,
AC
- simulation output format commands
- which node voltages or branch currents
to print, and in what format
Using your favorite text editor, type in
the following lines and save the file in your hspice_tut
directory as inv.sp
Note: hspice seems to require that there
are no leading blank spaces on each line of the input file. Beware
of this if you cut-and-paste!
Inverter Tutorial (this is the title
line)
* enable post-processing by AvanWaves
.options post
* device model file
.include ami05.md
* transient analysis: step size =
50 psec, duration = 2 nsec
.tran 50p 2n
* specify nodes to print (hspice
will print them all, anyway)
.print tran v(in) v(out)
* here's the inverter netlist declaration
* mosfet: mxx drain gate source substrate model length width
m1 OUT IN VDD VDD CMOSP l=.5u w=10u
m2 OUT IN GND GND CMOSN l=.5u w=10u
* here's the load capacitor on the
inverter output
* capacitor: cxx node1 node2 capacitance
cload OUT GND 100f
* constant voltage source: vxx node1
node2 voltage
VDD VDD GND 5
* pulsed voltage source:
* vxx node1 node2 PULSE params
* params = vlow vhigh delay rise fall pulse_width period
VIN IN GND PULSE 0 5 .5n .1n .1n .5n 2n
.end
Running HSPICE
- At the unix prompt, type: hspice inv.sp
Viewing Results in AvanWaves
- At the unix prompt, type: awaves
- Open the design from the main menu with
Design > Open > inv.sp
- The Results Browser should pop-up. In
the Results Browser
- select Transient: Inverter Tutorial
- select Types: Voltages
- double-click Curves: in. The input waveform
should appear
- double-click Curves: out. The output waveform
should appear
- Measure propagation delay for a high-to-low
output transition. This is defined as the time between the point
where the rising input waveform is at its 50% level (2.5 volts)
and the point where the falling output reaches its 50% level.
- Measure > Label Options , , ,
- select X1, Y1, Current X, Current Y, Delta
X, Delta Y
- Zoom into area of interest using Window
> Zoom In X
- Measure using Measure > PointToPoint
- Next, we'll make a change to the design
and observe the effect. Back in the text editor, change the load
capacitance to 200f and save.
- Re-run hspice as above
- Update the plot with Panels > Update
On Your Own . . .
- Write an hspice input file to perform
a transient analysis on a two-input NOR gate. The stimuli should
consist of pulses on each of the two inputs, defined (using appropriate
delays, etc.) so that all four input combinations (00, 01, 10,
11) are exercised.
- Measure both the high-to-low and low-to-high
propagation delays. Are they equal?
- Turn in printouts of both the hspice input
file and the simulation results from AvanWaves.