Professional Documents
Culture Documents
INTRODUCTION TO HSPICE
For simulating digital circuits we use HDL's and Simulation tools like
VCS,CVER,MODELSIM,XILINKs etc.
HISTORY
WHAT IS HSPICE?
INDUCTOR:
L{name} {node+} {node-} [{model}] {value} [{IC=initial}]
Examples :L 1 2 20mH
LVALUE 2 3 2uH IC=1.2mA
RESISTER:
R{name} {node+} {node-} [{model}] {value}
Example: R 2 3 10k
BJT:
B{name} {collector} {base} {emitter} [{sub}] {model} [{area}]
Examples :M1 4 6 8 PNPNOM
M2 5 7 9 1 NPNSTRONG 1.5
JFET:
J{name} {drain} {gate} {source} {model} [{area}]
Examples :JI 2 5 0 JFAST
MOSFET:
M{name} {drain} {gate} {source} {substrate} {model} [L={}] [w={}]
Examples :M1 14 2 13 0 PNOM L=25u w=12u
M2 15 3 24 0 PSTRONG
DECLARATION OF SOURCES
CURRENT SOURCE:
I{name} {node+} {node-} [[dc] {value}] [ac {mag} [{phase}]]
Examples :IBIAS 13 0 2.3mA
IAC 2 3 AC .001mA
IPULSE 1 0 PULSE(-1mA 1mA 2ns 2ns 2ns 50ns 100ns)
I3 26 77 AC 1 SIN(.002 .002 1.5MEG)
VOLTAGE SOURCES:
V{name} {node+} {node-} [[dc] {value}] [ac {mag} [{phase}]]
Examples :VBIAS 13 0 2.3mV
VAC 2 3 AC .001mV
VPULSE 1 0 PULSE(-1mV 1mV 2ns 2ns 2ns 50ns 100ns)
SINWAVE:
SIN( {voffset} {vpeak} {freq} {tdelay} {damp_factor} {phase} )
PULSE:
PULSE( {v1} {v2} {tdelay} {trise} {tfall} {width} {period} )
EXPONENTIAL:
EXP( {v1} {v2} {trise_delay} {tau_rise} {tfall_delay} {tau_fall) )
DC ANAYSIS:
DC [LIN] {varname} {start} {end} {incr}
.DC [OCT][DEC] {varname} {start} {end} {points}
Examples:
.DC VIN -.25 .25 .05
.DC LIN I2 5mA -2mA 0.1mA VCE 10V 15V 1V
TRANSIENT ANALYSIS:
.TRAN {print step value} {final time} [{no print time} [{step ceiling
value}]] [UIC]
Examples:
PRINT OUTPUT:
PROBE :probe command is used to save the simulation output what you
specified in the statement.
AC ANALYSIS OF RC CIRCUIT
1 EE105 SPICE Tutorial Example 4 - Simple RC High-Pass Filter
2 vs vs gnd ac 1V
3 c1 vs vo 1nF
4 r1 vo gnd 1k
5 .ac dec 500 100 1G
6 .option post=2
7 .end
DC ANALYSIS OF A DIODE
1 EE105 SPICE Tutorial Example 3 - Simple Diode Circuit
2.model tut_diode d (is=1e-14 vj=0.6 rs=10)
3 vs vs gnd 5V
4 rs vs vd 5k
5 d1 vd gnd tut_diode
6.dc vs 0V 5V 0.01V
7 .option post=2
8 .end
For a given resistive circuit we can find the transfer function by using .tf
command.
you can hand-calculate the answer and compare it to the result you get in
HSPICE
.tf v(v0) vs
From this output we can know how many active , passive ,unilateral ,
bilateral elements the circuit have and it also shows calculated outputs.
To see the outputs graphically we need to invoke COSMOSCOPE tool.
To invoke this type cscope and press enter.
After this cscope window is opened. In that window click on File
openplotfiles
It will give Voltages and Currents at all nodes..
THANK YOU..