In this tutorial, we will illustrate how to write a input netlist, the different modes available for the analysis , saving the results of analysis and using AWAVES to observe and measure various plots saved during simulation. we will illustrate all this with a simple CMOS inverter as shown in Fig.1 below.
In this figure, there are two transistors of the same dimensions, L = 1u and W = 20u and their gates are connected together at node IN.
nch is the n-channel or NMOS transistor. Its terminals, drain, gate and source are connected to nodes OUT, IN and 0 respectively.

setup hspice
Don't forget to execute
. .profile
Inverter Circuit
* example circuit
.OPTIONS LIST NODE POST
.TRAN 200P 20N SWEEP TEMP -55
75 10
.PRINT TRAN V(IN) V(OUT)
M1 OUT IN VCC VCC PCH L=1U W=20U
M2 OUT IN 0 0 NCH L=1U W=20U
VCC VCC 0 5
VIN IN 0 0 PULSE .2 4.8 2N 1N
1N 5N 20N
CLOAD OUT 0 .75P
$ this is the load capacitance
.MODEL PCH PMOS
.MODEL NCH NMOS
.ALTER CLOAD OUT 0 1.5P
.END
Statements in the input netlist file can be in any order, except that the first line is a title line, and the last .ALTER submodule must appear at the end of the file before the .END statement. If there is no .END statement at the end of the input netlist file or no carriage return after the .END statement, an error message is issued.
You can place comment statements anywhere in the circuit description. The * must be in the first space on the line. The $ must be used for comments that do not begin at the first space on a line (for example, for comments that follow Hspice input on the same line). The $ must be preceded by a space or comma if it is not the first nonblank character. The $ is allowed within node or element names.
Following conventions must be
followed in naming elements. The first letter for each of the elements
should be as in the table below.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Next the voltage sources are defined. VCC VCC 0 5, tell us that a DC source of 5V is applied accross node VCC and ground. Also, a voltage, VIN is applied at the gates of the transistors, node IN. The value of this source is then specified on the next line. VIN takes a pulse input as specified. the lines starting with .MODEL define the transistor models, PCH and NCH.
.ALTER statement is used to rerun
a simulation using different parameters and data, here value of load capacitance
is changed from initial value of 0.75 pico farad to 1.5 pico farad.
.TRAN statement causes Hspice
to perform a multipoint transient analysis for 20 ns for temperatures ranging
from -50¯C to 75¯C in steps of 10¯C.
$ hspice example.sp > example.lis &
Various output files that may be
generated are listed below:
| Output File Type | Extension |
| Output listing | .lis, or user-specified |
| Transient analysis results | .tr# * |
| Transient analysis measurement results | .mt# |
| DC analysis results | .sw# * |
| DC analysis measurement results | .ms# |
| AC analysis results | .ac# * |
| AC analysis measurement results | .ma# |
| Hardcopy graph data (from meta.cfg PRTDEFAULT) | .gr# ** |
| Digital output | .a2d |
| FFT analysis graph data | . ft#*** |
| Subcircuit cross-listing | . pa# |
| Output status | . st# |
| Operating point node voltages (initial conditions) | . ic |
# is either a sweep number or a hardcopy
file number.
* Only created if a .POST statement
is used to generate graphical data.
** Requires a .GRAPH statement or
a pointer to a file exists in the meta.cfg file.
This file
is not generated by the PC version of Star-Hspice.
*** Only created if a .FFT statement
is used.
Type,
$ hspice inverter.sp > inverter.lis &
to start hspice and load the example you have edited.
You will see following message on the screen
>info:
***** hspice job concluded
>info:
***** hspice job concluded
user
0.6
sys
0.4
Following files are generated as
a result:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Hspice output statements are contained
in the input netlist file and include .PRINT, .PLOT, .GRAPH, .PROBE, and
.MEASURE. Each statement specifies the output variables and type of simulation
result to be displayed. For example, .DC, .AC, or .TRAN. With the use of
.OPTION POST, all output variables referenced in .PRINT, .PLOT, .GRAPH,
.PROBE, and .MEASURE statements are put into the interface files for AvanWaves.
AvanWaves allows high resolution, post simulation, and interactive display
of waveforms.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
To observe the results of the simulation, invoke awaves by typing
$ awaves&
open the design inverter.sp . We can display input and output voltages for CLOAD value of 0.75pf as well as 1.5pf simultaneously or one at a time. Output voltage is plotted for the range of temperature as specified in the inverter.sp netlist.
We can select the curve to be displayed
in the result browser window.
Fig. 2 Result Browser
The actual waveforms for V(IN) and
V(OUT) for CLOAD = 1.5pf are displayed as below
Fig.3 V(IN) and V(OUT) with CLOAD = 1.5pf
To print the plot click on the Printbutton or select Print from the Tools.
We can either save the plot as a
postscript file or print it rightaway.
Fig.4 Print Menu