circuit simulation using spice
TRANSCRIPT
8/13/2019 Circuit Simulation Using SPICE
http://slidepdf.com/reader/full/circuit-simulation-using-spice 1/18
Circuit simulation using SPICE
Neuromorphic Engineering II
Institute of Neuroinformatics
University | ETH Zurich
Spring Semester 2008
8/13/2019 Circuit Simulation Using SPICE
http://slidepdf.com/reader/full/circuit-simulation-using-spice 2/18
Outline
What is SPICE?
How does SPICE work?
Tanner Tools TSPICE
S-Edit
8/13/2019 Circuit Simulation Using SPICE
http://slidepdf.com/reader/full/circuit-simulation-using-spice 3/18
SPICE Origins
SPICE is a computer program designed to simulate analog electronic
circuits.
It original intent was for the development of integrated circuits , from
which it derived its name: Simulation Program with Integrated Circuit
Emphasis.
1967 Prof. Ronald Rohrer of U.C. Berkeley develop ComputerAnalysis of Nonlinear Circuits, Excluding Radiation
(CANCER)
1972 CANCER was re-written and re-named to SPICE
(Version 1) and released to the public domain.
1975 Version 2 of SPICE was released (Version 2g6)
1985 Version 3 of SPICE was rewritten in C (rather than
FORTRAN) and released to the public domain.
8/13/2019 Circuit Simulation Using SPICE
http://slidepdf.com/reader/full/circuit-simulation-using-spice 4/18
SPICE Avaliable Packages
The SPICE home page:
http://bwrc.eecs.berkeley.edu/Classes/IcBook/SPICE/
Public Domain
Original Berkeley SPICE3f4 code:
ftp://ic.eecs.berkeley.edu/pub/Spice3/
NGSpice
http://sourceforge.net/projects/ngspice
Commercial
HSPICE (Synopsis)
PSCPICE (OrCAD)
SYMETRIX
TSpice (Tanner Tools)
8/13/2019 Circuit Simulation Using SPICE
http://slidepdf.com/reader/full/circuit-simulation-using-spice 5/18
SPICE Programming
SPICE is an interpreted language: In order for a computer to
understand the SPICE instructions you type, it must have the SPICEprogram (interpreter) installed. SPICE source files are commonly
referred to as netlists (or "decks") with each line in the file being called
a "card."
Writing a SPICE deck is like writing a good program
Plan: sketch schematic on paper or in editor.
Modify existing decks whenever possible.
Code: strive for clarity.
Start with name, email, date, purpose.
Generously comment.Test: Predict what results should be.
Compare with actual.
Garbage In, Garbage Out!
8/13/2019 Circuit Simulation Using SPICE
http://slidepdf.com/reader/full/circuit-simulation-using-spice 6/18
Solving differential equations
SPICE uses numerical techniques to solve nodal analysis of circuit.
The nature of SPICE’s iterative process allows it to simulate many
types of systems that can be modelled through standard equations
and differential equations.
Hodgkin and Huxley model of a neuron’s spike generating
mechanism.
Chaotic and Dynamical Systems
Diffusion equations
8/13/2019 Circuit Simulation Using SPICE
http://slidepdf.com/reader/full/circuit-simulation-using-spice 7/18
Spice components and analysis types
You can use SPICE to specify these circuit components: Resistors, Capacitors, Inductors
Independent sources (V, I), Dependent sources (V, I)
Transmission lines
Active devices (diodes, BJTs, JFETS, MOSFETS)
You can use SPICE to perform the following types circuit analysis:
Non-linear d.c.
Non-linear transient
Linear a.c.
Noise and temperature
8/13/2019 Circuit Simulation Using SPICE
http://slidepdf.com/reader/full/circuit-simulation-using-spice 8/18
SPICE common elemenets
Letter Element
R ResistorC Capacitor
L Inductor
V Independent Voltage Source
I Independent Current Source
M MOSFET
D Diode
Q Bipolar transistor
X Subcircuitr
E Voltage controlled Voltage SourceG Voltage controlled Current Source
H Current controlled Voltage Source
F Current controlled Current Source
8/13/2019 Circuit Simulation Using SPICE
http://slidepdf.com/reader/full/circuit-simulation-using-spice 9/18
Active components: the MOSFET device models
All Mosfet devices in SPICE reference a model by its instance name.
Each Mosfet model in SPICE has a keyword NMOS or PMOS , as well
as a Level parameter.
MOSFET TRANSISTOR MODELS:General form: .model [modelname] [nmos or pmos] [parmtr1=x] . . .
.model mod1 pmos
.model mod2 nmos level=2 phi=0.65 rd=1.5
8/13/2019 Circuit Simulation Using SPICE
http://slidepdf.com/reader/full/circuit-simulation-using-spice 10/18
MOSFET device model levels
Levels 1,2,3 (Berkeley SPICE 2g6): basic transistor equations.
Not very accurate, but fast.
Level 4 (BSIM1): accurate, based on the Berkeley short-channel
IGFET model.
Level 5 (Tanner, Maher-Mead): accurate physically based model,
continuous over all regions of operation, including subthreshold.
Levels 13, 28, 39, and 47: Based on Berkeley IGFET models
(BSIM, BSIM2, and BSIM3 models).
Levels 49 and 53 (BSIM3 Revision 3): most accurate models.Supported by most foundries and SPICE simulation engines.
8/13/2019 Circuit Simulation Using SPICE
http://slidepdf.com/reader/full/circuit-simulation-using-spice 11/18
SPICE Analysis Types
DC Operating Point Analysis .op: Computes circuit’s DC operating
point values.
DC Transfer Analysis .dc: Sweeps signals and computes operating
point values for all range of swept signals.
Transient Analysis .tran: Provides information on how circuit elements
vary with time.
Transient Powerup Analysis .tran/powerup: Sets the entire circuit to
zero for t = 0s. As the simulation proceeds, the voltage
sources are allowed to ramp up to their specified values.
Useful to define the initial state of a circuit which has no
definite DC steady-state condition.
AC Analysis .ac: Characterizes the circuits behavior dependence on
small-signal input frequency.
8/13/2019 Circuit Simulation Using SPICE
http://slidepdf.com/reader/full/circuit-simulation-using-spice 12/18
Why Tanner-Tools TSPICE
Integrated with L-Edit and S-Edit
Affordable (<2K, low maintenance fees)
Optimized for subthreshold circuits simulations
Table-based mode
8/13/2019 Circuit Simulation Using SPICE
http://slidepdf.com/reader/full/circuit-simulation-using-spice 13/18
8/13/2019 Circuit Simulation Using SPICE
http://slidepdf.com/reader/full/circuit-simulation-using-spice 14/18
TSPICE netlist example
Vdd
in Vout
Simulation commands (inverter_c.sp)
.options scale=0.8u deftables=0
.options maxmsg=1 modelmode=direct
.options abstol=1e-17 reltol=1e-7 chargetol=1e-19
.options absdv=0.01 accurate=1
.options js=1e-5
.include "inverter.sp"
vdd Vdd gnd 5
vin in gnd pwl( 0 0 5u 5 10u 0)
.tran/powerup 1u 10u
.print tran in out
options
circuitelements
commands
8/13/2019 Circuit Simulation Using SPICE
http://slidepdf.com/reader/full/circuit-simulation-using-spice 15/18
How does (T)SPICE work?
Not very well! Don’t ever believe it completely models reality.
Problems:
Very computer intensive.
Doesn’t model transistor mismatch. Doesn’t model Early effects well.
Doesn’t model distributed characteristics like resistance and
capacitance.
Makes you lazy about thinking.
8/13/2019 Circuit Simulation Using SPICE
http://slidepdf.com/reader/full/circuit-simulation-using-spice 16/18
T-SPICE and S-Edit
8/13/2019 Circuit Simulation Using SPICE
http://slidepdf.com/reader/full/circuit-simulation-using-spice 17/18
T-SPICE and S-Edit
8/13/2019 Circuit Simulation Using SPICE
http://slidepdf.com/reader/full/circuit-simulation-using-spice 18/18
T-SPICE and S-Edit