Docsity

Using Simulators for Circuit Analysis: A Comparison of WinSPICE and HSPICE, Study notes of Electrical and Electronics Engineering

Partial preview of the text

Download Using Simulators for Circuit Analysis: A Comparison of WinSPICE and HSPICE and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

Integrated Circuit Simulation

Using SPICE^ David W. Graham Lane Department of Computer Science and Electrical Engineering^ West Virginia University^ ©^ David W. Graham 2008

Why Simulation?

•^ Theoretical calculations only go so far… •^ Find out the circuit behavior in a variety ofoperating conditions •^ It is currently the best way of designing acircuit (industry standard) •^ Provides intuitive “feel”

for circuit operation

(without requiring expensive equipment)

SPICE Options Available at WVU • PSPICE^ –^ Schematic capture^ –^ Node limitation (9 nodes maximum) • HSPICE^ –^ Good^ –^ Expensive^ –^ In departmental computer labs with linux

machines

(e.g. 756 ESB and 813 ESB) • WinSPICE – Free! (Plus, it is good in many other ways) – In departmental computer labs with Windowsmachines (e.g. 813 ESB)

WinSPICE

Pros •^ Free •^ Small Size •^ Can run it from MATLAB •^ Works well •^ No node limitations •^ Can use the EKV model (good for subthreshold

simulations)

-^ Works in Windows Cons •^ No schematic capture (However, XCircuit

can perform schematic capture) • Only works in Windows • (Occasional convergence problems –

but improving)

HSPICE

Pros •^ Industry standard •^ Very, very good numerical solver •^ Many extra features^ –^ Incorporation into layout editors (like Cadence)^ –^ Parameterized sweeps^ –^ Solid functionality when using libraries^ –^ Many, many more •^ Effectively no node limitations (limitation on the order of 100k

nodes)

-^ Can use the EKV model (good for subthreshold

simulations)

-^ Works in Windows/Linux/Unix Cons •^ No schematic capture (However, XCircuit

and Cadence can perform schematic capture) • Expensive • Only in Linux machines in CSEE department

HSPICE –

How to Use in CSEE Department

-^ Location^ –^ Shell server (complete instructions for loggingin can be found on the CAD page of the classwebsite)^ –^ Linux computer labs (756 and 813 ESB) •^ Cosmos Scope^ –^ Waveform viewer^ –^ Type^

cscope &

at the prompt

Basic Circuit Elements • Resistor^ R

node1^ node

value

•^ Capacitor

C

node1^ node

value

•^ Inductor

L

node1^ node

value

Examples R1^1 2

CIN^ IN^ OUT^

0.1u

R= 100Ω^1

C= 0.1μFin^ out in

Resistor “name” Signifies resistor

Signifies “micro”

(1e-6) Nodes can be signified by words instead of numbers

11

Independent Voltage and Current Sources •^ Voltage Source

V^ n+

n-^ DC^ dcvalue

AC^ acvalue

-^ Current Source

I^ n+

n-^ DC^ dcvalue

AC^ acvalue

Examples^10 VDD^1 0 DC

V= 3.3Vdd^ Ground is always^ node 0^ 3.3^ AC^0

1 I^1 I1^1 0 DC^ 1n 0 0.005^ 0.01^ 0.015^ 0.02^ 0.025^ AC^ 0.5e-

-9x 101.6 AC Value = 0.5nA1.4 1.2 DC Value = 1nA (^1) Current (A)0.8 0.6 0.4 Time (s) Direction of current flow n = 1e-9 (equivalent forms)

-^ Voltage-controlled voltage source (VCVS)^ E

n-^ nref+^ nref-

gain

-^ Current-controlled current source (CCCS)^ F

n-^ voltagesourceref gain

-^ Voltage-controlled current source (VCCS)^ G

n-^ nref+^ nref-

transconductance

-^ Current-controlled voltage source (CCVS)^ H

n-^ voltagesourceref transconductance

-^ Voltage-controlled sources reference the voltage across two nodes •^ Current-controlled sources reference the current flowing through avoltage source^ –^ Can be a “dummy”

voltage source Dependent Voltage and Current Sources^ –^ A voltage source with no voltage supplied^ –^ VDUMMY 3 4 DC 0 AC 0^ •^ Current sources flow from n+ to n-

Transistors

•^ nFETs^ M drain gate source bulk modelname W=value L=value •^ pFETs^ M drain gate source well modelname W=value L=value Examples^ (Assume models “NFET”

and “PFET”^ are defined elsewhere) 2 Assume the bulk connection 1 is tied to ground (^0) M1 2 1 0 0 NFET W=100u L=4.8u

(^2310) M2 0 1 2 3 PFET W=100u L=4.8u

EKV Model

-^ Enz, Krummenacher, and Vittoz

Model

-^ (3 Swiss engineers who wanted a better MOSFET model, specificallyfor low-current applications) • Model is a “single expression”

that preserves continuity of the operation • Based on the physics of the MOS device (not just empirical fits) • We will be using the 0.

μm model available at the EKV website

-^ http://legwww.epfl.ch/ekv/ekv26_0u5.par • More information can be found at –^ http://legwww.epfl.ch/ekv/ –^ Liu, et al. pg 86-89 • Level –^ Level = 5 in PSPICE –^ Level = 44 in WinSPICE –^ Level = 55 in HSPICE

Analysis

Several types of analyses can be performed •^ Operating point •^ DC sweep •^ AC sweep •^ Transient analysis •^ Additional useful analyses –

distortion,

noise, pole-zero, sensitivity, temperature,transfer function

We will be making use of theseanalyses extensively

Analysis

-^ AC analysis (.AC)^ –^ Can sweep an AC voltage or current over a specified frequencyrange to determine the transfer function / frequency response^ –^ Does not

take distortion and nonlinearities into account – .AC {DEC,OCT,LIN}^

numpoints^ freqstart

freqstop

-^ DEC^ –^ numpoints

per decade

-^ OCT^ –^ numpoints

per octave

-^ LIN^ –^ linear spacing of points,

numpoints^ = total number of points

-^ e.g.^ Æ^ .AC DEC 10 10 1E5^ •^ AC sweep from 10Hz to 100kHz, points spaced logarithmically, 10simulation points per decade –^ Must have a source with an AC component in the circuit

Analysis

-^ Transient analysis (.TRAN)^ –^ Determines the response of a circuit to a transient signal / source(sine wave, PWL function, etc.)^ –^ Allows you to achieve the most results with a simulation (distortion,nonlinearity, operation, etc.)^ –^ .TRAN timestep timestop {timestart {maxstepsize}} {UIC}^ –^ Optional arguments^ •^ timestart

= start time (default is 0) • maxstepsize^ = maximum time increment between simulation points • UIC – “Use Initial Conditions”

-^ allows the user to define initial conditions for start of simulation, e.g. initial voltage on a capacitor – e.g.^ Æ^ .TRAN^ 1n

100n

-^ Perform a transient analysis for 100nsec (100e-9 seconds) with a stepincrement of 1nsec