Sei sulla pagina 1di 22

Welcome to HSPICE

Tutorial Session
In this session we will learn:
What is HSPICE simulator
What can we do with this software
How to install
How to implement and simulate circuits
Simulate an example
1 University of Tehran Electronics II
Electroncs III - Fall 2014 - Dr. Shoaei ==> Email your questions to {jamal.kazazi@gmail.com}
Hspice Simulator
At first look you may think Hspice is not a user
friendly program. That is true!!
But Hspice is such a powerful simulator that
keeps it in competition with other simulators
like ADS .
Almost Every electronic engineer use this
simulator to evaluate operation of circuits.
Electronics II University of Tehran 2
Electroncs III - Fall 2014 - Dr. Shoaei ==> Email your questions to {jamal.kazazi@gmail.com}
Hspice Simulator
We use Hspice in electronics II, electronics III
and digital electronics.
Any simulation can be done with Hspice,
analogue and also digital.
Electronics II University of Tehran 3
Electroncs III - Fall 2014 - Dr. Shoaei ==> Email your questions to {jamal.kazazi@gmail.com}
What can we do with this software
The analysis types of the circuit may be consist
of:
DC analysis
AC analysis
Noise analysis
Transient analysis
Fourier analysis
Electronics II University of Tehran 4
Electroncs III - Fall 2014 - Dr. Shoaei ==> Email your questions to {jamal.kazazi@gmail.com}
How to install
Hspice source and some manuals are available in a
folder named HSPICE on Temp in BS computer site.
To install on Windows xp follow the instructions in
source folder.
To install on Windows Vista & 7 remember to change
compatibility mode of setup.exe to Windows xp
service pack 2. Otherwise setup process wont be
completed.
Electronics II University of Tehran 5
Electroncs III - Fall 2014 - Dr. Shoaei ==> Email your questions to {jamal.kazazi@gmail.com}
How to install
Electronics II University of Tehran 6
Electroncs III - Fall 2014 - Dr. Shoaei ==> Email your questions to {jamal.kazazi@gmail.com}
Hspice
If your setup completed successfully, run
Hspice by clicking on Hspui.exe.
Electronics II University of Tehran 7
Electroncs III - Fall 2014 - Dr. Shoaei ==> Email your questions to {jamal.kazazi@gmail.com}
Hspice
Notepad ++ is easier to use. So change your
default editor to Notepad ++ as follow:
Click on configuration menu, select options
and write the path of Notepad ++.exe in
default editor section.
Electronics II University of Tehran 8
Electroncs III - Fall 2014 - Dr. Shoaei ==> Email your questions to {jamal.kazazi@gmail.com}
Hspice
Open : Delivers existing .sp file to Hspice.
Edit NL: To edit your code.
Simulate: Starts simulation process.
Edit LL: To view simulations results, but not
graphically.
Avanwaves: To graphically view simulations
wave forms.
Electronics II University of Tehran 9
Electroncs III - Fall 2014 - Dr. Shoaei ==> Email your questions to {jamal.kazazi@gmail.com}
Hspice
In Hspice simulator we dont have any
schematic plan to select an element such as
transistor by mouse or draw a wire to connect
two elements! We have to write codes.
To create new code open a blank page in
Notepad++ and write your code there.
Remember to save your code as .sp file.
Electronics II University of Tehran 10
Electroncs III - Fall 2014 - Dr. Shoaei ==> Email your questions to {jamal.kazazi@gmail.com}
Hspice
But this file, is not enough for simulation.
Any simulation in Hspice needs two files:
1- The written codes that we prepare it.
2- The file that describes the characteristics of
the circuit elements such as transistors which
we use.
Electronics II University of Tehran 11
Electroncs III - Fall 2014 - Dr. Shoaei ==> Email your questions to {jamal.kazazi@gmail.com}
Library file
Each circuit in electronics have to design and
simulate (and finally produce as ICs ) in a
particular technology.
These technologies are known with the
minimum channel length of the transistors
such as 0.35m , 0.18m , 65nm.
These files are ready and given by the special
companies and laboratories.
Electronics II University of Tehran 12
Electroncs III - Fall 2014 - Dr. Shoaei ==> Email your questions to {jamal.kazazi@gmail.com}
Library file
Each library gives us a lot of information
about the device parameters of the transistors
such as:
Minimum channel length L
Oxide capacitance C
ox
Oxide thickness Tox
Threshold voltage Vth
Fermi voltage
Lambda
Gamma
Electronics II University of Tehran 13
Electroncs III - Fall 2014 - Dr. Shoaei ==> Email your questions to {jamal.kazazi@gmail.com}
Hspice simulation
Electronics II University of Tehran 14
Our written file library
Full spice file
spice
simulate
Electroncs III - Fall 2014 - Dr. Shoaei ==> Email your questions to {jamal.kazazi@gmail.com}
How to create netlist
Electronics II University of Tehran 15
Electroncs III - Fall 2014 - Dr. Shoaei ==> Email your questions to {jamal.kazazi@gmail.com}
16
How to implement and simulate circuits
draw the circuit at a piece of paper.
label each node of the circuit with numbers or alphabets.
Use instruction and write your text file
Electronics II University of Tehran
Electroncs III - Fall 2014 - Dr. Shoaei ==> Email your questions to {jamal.kazazi@gmail.com}
17
Some instructions
Defining a DC voltage source:
a b
VB a b 2v
Defining an AC voltage source:
out
Vin out 0 SIN (V0 VA FREQ DELAY THETA PHASE)
Defining a current source:
I1 1 2 1mA
1
2
Electronics II University of Tehran
Electroncs III - Fall 2014 - Dr. Shoaei ==> Email your questions to {jamal.kazazi@gmail.com}
18
Defining a resistor:
RL a b 2K
Defining a capacitor:
a
b
a1 b2
C1 a1 b2 3nf
Defining a BJT transistor:
Q1 C B E npn
Electronics II University of Tehran
Some instructions
Electroncs III - Fall 2014 - Dr. Shoaei ==> Email your questions to {jamal.kazazi@gmail.com}
Electronics II University of Tehran 19 19 Electronics II University of Tehran
Some instructions
Defining a MOS transistor:
M D G S B nmos width length
M1 a b 0 0 nmos w =11*lmin' l ='lmin'
a
b
That lmin defined as 0.18
GND
Bulk
Example:
Electroncs III - Fall 2014 - Dr. Shoaei ==> Email your questions to {jamal.kazazi@gmail.com}
a sample netlist
Electronics II University of Tehran 20
.prot
.lib 'cmos35.l' nominal
.unprot
.param lmin=.35u
Calling the library
Defining the L of
transistor as a
parameter
M1 out vb 0 0 nmos w =' 30*lmin' l ='1*lmin'
M2 out vin vdd vdd pmos w ='100*lmin' l ='1*lmin'
vi vi 0 sin(1.65 .000015 5k 0 0 0)
vdd vdd 0 dc 3.3
vb vb 0 dc 0.7
Electroncs III - Fall 2014 - Dr. Shoaei ==> Email your questions to {jamal.kazazi@gmail.com}
a sample netlist
Electronics II University of Tehran 21
.op for finding operation point
.tran 100n 400u
where 100n indicates the increments (time steps)
that SPICE must use in calculating the response,
and 400n the total time of interest
.alter case 2
.alter command use whenever we want to change a
parameter in our circuit by remaining the last changes
.ac dec 10 1 10g
dec10, tells SPICE to simulate the circuit at 10
frequency values in every decade of frequency
Electroncs III - Fall 2014 - Dr. Shoaei ==> Email your questions to {jamal.kazazi@gmail.com}
a sample netlist
Electronics II University of Tehran 22
vi vi 1.65 ac .5 0
.measure ac gain find vdb(out)at=15
.measure ac unity-gain when v(out)=1
.measure ac phase_margin find Vp(0,out) when vdb(out)=0
.pz v(out,0) vi
.tf v(4,0) vi
.four 5k v(out)
.end
.measure command use
whenever we want to
measure a parameter such
as voltage gain
This command give us the pole and zeros from
the output node to the input
End of simulation
Electroncs III - Fall 2014 - Dr. Shoaei ==> Email your questions to {jamal.kazazi@gmail.com}

Potrebbero piacerti anche