Hspice Guide
Hspice Guide
HSPICE Input
input netlist
design configuration
initialization
Typical Invocations:
.sp
.cfg
hspice.ini
HSPICE Output
run status
.st0
output listing
.lis
initial condition
.ic
measure output .m*# (e.g. .mt0,mt1,.)
Analysis data, transient .tr# (e.g. .tr0,tr1,.)
Analysis data, dc .sw# (e.g. .sw0,sw1,.)
Analysis data, ac .ac# (e.g. .ac0,ac1,.)
Plot file .gr# (e.g. .gr0, gr1,..)
Insoo Kim
Sources
*
Voltage sources
v4 4 0 dc 0 ac 0 0 pulse 0 1 0 .15 .15 .4 2
vdata data 0 sin(1.0 1.0 1.0 0.0 1.0)
v6 6 0 exp(1 0 .1 .02 .6 .2)
Title
Components
*
Components
L6 6 16 .05
c6 16 0 .05
r16 16 0 40
c4 4 14 .1
L5 data 15 1
c5 15 0 .2
.model ...
.end
Insoo Kim
Input Control
.option
.param
.alter
.model
.Lib
.OPTION
.OPTION LIST
.OPTION NODE
.OPTION ACCT
Reports job accounting and run-time statistics at the end of the output
listing.
.OPTION NOMOD
Insoo Kim
.OPTION
.PROBE
Write directly to the Graph Data File (without writing to the .LIS file)
Limit data in Graph Data file to that specified in .PRINT, .PLOT,
.PROBE, .GRAPH
Insoo Kim
.OPTION
.OPTION SCALE
.OPTION SCALE=<value>
.OPTION SCALE=1e-6
Insoo Kim
.PARAM
Actual Value
Insoo Kim
.PARAM
HSPICE
Output
sixteenth(c)=fourth(c) * fourth(c)
2nd
4th
4.0000
16.0000
par(sixteenth(X))
param
sixteenth(x)
256.0000
Insoo Kim
.ALTER
.ALTER
Circuit Topology
Models
Library Components
.ALTER
.DELETE LIB
.LIB
Elements
Parameter Values
Options
Source stimulus
Analysis Variables
Print/Plot commands (must be parameterized)
1st Run - HSPICE reads input netlist file up to the first .ALTER
Subsequent - Reads input netlist to next .ALTER, etc
Insoo Kim
.ALTER
Limitations:
CAN include
CANNOT include
Insoo Kim
.ALTER
Example
Insoo Kim
.Model
.model Statement
mname
pname_I
pval_I
type
OPT
optimization model
PJF
PNP
resistor model
SP
S-Parameter
Examples
.model g nmos
level=49
***** Version Parameters
+ hspver = 98.40
version = 3.20
***** Geometry Range Parameters
+ wmin = 0.64u
wmax = 900.000u
+ lmin = 0.28u
lmax = 900.000u
Insoo Kim
.Lib
entryname
filename
filepath
entryname
filename
filepath
.Lib
*Netlist
R1 1 0 10k
.lib MyProcess.lib TT
M1 1 1 2 0 nchan
.end
*
MyProcess.lib file
.lib TT
$ typical process
.param TOX_8=230 ...
.include /usr/lib/cmos1.dat
.endl TT
* file:
/usr/lib/cmos1.dat
.model nchan
+ level=13 ...
+ tox=tox_8
.lib FF
$ fast process
.param TOX_8=200 ...
.include /usr/lib/cmos1.dat
.endl FF
Insoo Kim
Output Control
.print
.measure
syntax
Insoo Kim
.PRINT
*** ID-Vds curve temp=0 nmos w=50 l=0.4 dbp011 ***
.option nomod nopage acct wl scale=0.87u co=132
.temp 25
.inc '/home/users2/kyusun/model/model_typ'
.param pa_vgs=4.0v
.dc vds 0v 4.5v 0.5v
vds vds gnd
vgs vg gnd pa_vgs
vbb vbb gnd -1.0v
Input file
.PRINT
*** id-vds curve temp=0 nmos w=50 l=0.4 dbp011 ***
****** dc transfer curves
tnom= 25.000 temp= 25.000
******
x
volt
0.
500.00000m
1.00000
1.50000
2.00000
2.50000
3.00000
3.50000
4.00000
4.50000
y
current
mnmos
1.0000p
42.3973u
80.8944u
114.1583u
132.4595u
136.4053u
138.5470u
140.3573u
142.0558u
143.7045u
Output file
(.lis)
Insoo Kim
.MEASURE
.MEASURE
Find-When
Equation Evaluation
Derivative Evaluation
Integral Evaluation
Relative Error
Insoo Kim
.MEASURE
V(1)
V(2)
TDLAY
2.5v
...
2.5v
...
FALL=2
Insoo Kim
.MEASURE
Examples
Insoo Kim
.MEASURE
FIND-WHEN
Example - when
result - name given the measured value in the HSPICE output file.
measure the time of the 5th rise of node osc_out at 2.5v. Report as fifth in
listing.
Insoo Kim
.MEASURE
Equation Evaluation
result - name given the measured value in the HSPICE output file.
Example
Insoo Kim
Power Sources
Independent Sources
Syntax
or
DC Sources
AC Sources
Insoo Kim
pw
tr
0
10
tr
tf
pw
per
tf
td
td
15
20
25
30
35
Insoo Kim
Piece-Wise Linear
PWL t1 v1 <t2 v2 t3 v3...> <R <=repeat>> <TD=delay>
PWL (t1 v1 <options>)
PWL t1 I1 <t2 I2...> <options>
10
15
20
25
30
35
Insoo Kim
SIN
Composite (Mixed)
VH 3 6 DC=2 AC=1,90
VCC 10 0 VCC PWL 0 0 10n VCC 15n VCC 20n 0
VIN 13 2 0.001 AC 1 SIN (0 1 1Meg)
Insoo Kim
Analysis
DC analysis
AC analysis
Transient analysis
Temperature analysis
Analysis types
Temperature Analysis
.Temp
Insoo Kim
DC Analysis
.DC
.OP
.PZ
Pole/Zero Analysis
.SENS
DC small-signal sensitivities.
.TF
Insoo Kim
.DC
.DC var1 start1 stop1 incr1 <SWEEP var2 type np start2 stop2>
.DC DATA=datanm
var1
incr1
SWEEP
Insoo Kim
.DC
Examples
Insoo Kim
Insoo Kim
AC Analysis
AC Analysis Statements
Insoo Kim
.AC
AC Sweep
.AC DATA=datanm
fstart
fstop
var
Starting frequency
Final frequency
Name of an independent voltage or current source,
any element or model parameter, or the keyword TEMP.
start
Starting voltage, current, element, model parameter,
or temperature values.
stop
Final voltage, current, element, model parameter,
or temperature values.
incr
Voltage, current, element, model parameter,
or temperature increment values.
SWEEP Indicates a second sweep is specified in the .AC statement.
Insoo Kim
.AC
Examples
Mixed Command
AC analysis for each value of cload, with a linear sweep of cload between
1pf and 10pf (20 points). Sweeping frequency 10 points per decade from
1Hz to 10KHz. (41point freq.)
Insoo Kim
Transient Analysis
Transient Optimization
Insoo Kim
.TRAN
.TRAN Statement
.TRAN tincr1 tstop1 <tincr2 tstop2...> <START=val> <UIC>
+ <SWEEP..>
UIC
Insoo Kim
.TRAN
tincr1
tstop1
tincr1
var
Insoo Kim
.TRAN
Examples
Calculation is made every 10ns for 1us at three cload. (POI - Points
of Interests)
Insoo Kim
Examples
Transient Analysis
AC Analysis
Transient Analysis
*** HSPICE Netlist file for DIFF AMP Transient Analysis
*** Created by ikim
.option post
.option ACC=1 BRIEF=1
.param VDD=5.0v
.global VDD!
.temp 25
.op
.tans 0.1ns 100ns
.print i(M5)
.meas avgpow avg power from t1 to t2
.meas maxpow max power from t1 to t2
.param t1=10n
.param t2=90n
*** Source ****
VVDD! VDD! 0 VDD
VINn INn 0 pu 2.3v 2.7v 0n 0.1n 0.1ns 4.9ns 10ns
VINp INp 0 dc 2.5v
Vb Vb 0 1.15v
Cout out 1fF
*** Components ***
.inc ./diff_amp.net
.model /home/users2/kyusun/tool/model/libcmos050t22a.sp CMOS1
.end
Insoo Kim
AC Analysis
*** HSPICE Netlist file for DIFF AMP Frequency Analysis
*** Created by ikim
.option post
.option ACC=1 BRIEF=1
.param VDD=5.0v
.global vdd! Gnd
.temp 25
.dc
.pz v(out) vinn
.ac dec 10 1k 10giga
*** Source ****
VVDD! VDD! 0 VDD
VINn INn 0 dc 2.5v ac 1, 180
VINp INp 0 dc 2.5v ac 1
Vb Vb 0 1.15v
Cout out 1fF
*** Components ***
.inc ./diff_amp.net
.model /home/users2/kyusun/tool/model/libcmos050t22a.sp CMOS1
.end
Insoo Kim