Simulation With NEtlist PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

SImulating electricalcircuits

usingNetlist description
Seminar
Prof : Rogelio Palomera
Prof:RogelioPalomera
TA:AndresSalazarLlinas

What is a Netlist
WhatisaNetlist
Connectivity
Connectivitydescriptionofanelectronic
description of an electronic
design.
TheheartofanyCadence(Spice)file,whichis
The heart of any Cadence (Spice) file which is
simplya list ofcomponentsandthe nets (or
nodes) that connect them together
nodes)thatconnectthemtogether.

Circuit Simulation Process


CircuitSimulationProcess
CreateSchematic

GeneratetheNetlist File

Setupsimulation
parameters

R Si l ti
RunSimulation

GeneratetheNetlist File

RunSimulation

Example 1
Example1
*Example 1
VS10AC1SIN(0VOFF1VPEAK2KHZ)
R1121K
C1 2 0 0 032UF
C1200.032UF
*ANALYSIS
.ACDEC51010MEG
.TRAN5US500US
S 00 S
*VIEWRESULTS
.PRINTACVM(2)VP(2)
.PLOTACVM(2)VP(2)
.PLOTTRANV(1)V(2)
.PROBE
PROBE
.END

Commands

Devices:
Nameacomponent,designatethenodeswhereit'sconnected,andgiveitavalue.
RS 1 2 1000

VOLTAGE SOURCE
VOLTAGESOURCE
SINEWAVE,PULSE,AC,DC
SIN({voffset}{vpeak}{freq}{tdelay}{damp_factor}{phase})
PULSE({v1}{v2}{tdelay}{trise}{tfall}{width}{period})
AC AND TRANSIENT ANALYSIS
ACANDTRANSIENTANALYSIS

PerformbothAC(frequency)AnalysisandTransient(time)Analysis.Alsoperformanumberofotheranalyses
likeDC,Sensitivity,NoiseandDistortion.
.AC[LIN][OCT][DEC]{points}{start}{end}
.DC[LIN]{varname}{start}{end}{incr}
.DC[OCT][DEC]{varname}{start}{end}{points}
.FOUR{freq}{outputvar}
Examples:.FOUR10KHzv(5)v(6,7)
.IC{{vnode}={value}}*Initial Conditions
Examples:.ICV(2)=3.4V(102)=0
.TRAN{print step value}{finaltime}[{noprint time}
Examples:.TRAN5NS100NS

PLOTTINGRESULTS
.PLOT[DC][AC][NOISE][TRAN][[{outputvariable}*]
PLOT [DC][AC][NOISE][TRAN] [ [{
i bl }*]
Examples:.PLOTDCV(3)V(2,3)V(R1)I(VIN)
.PROBE[outputvariable]*

Commands II
CommandsII

CONTROLLEDSOURCES

Voltage Controlled Voltage Source VCVS.


E{name}{+node}{node}{+cntrl}{cntrl}{gain}
Examples:
EBUFF1210111.0

Current Controlled Current Source CCCS.


CCCS
F{name}{+node}{node}{vsource name}{gain}
Examples:
FSENSE12VSENSE10.0

Voltage Controlled Current Source VCCS.


VCCS
G{name}{+node}{node}{+control}{control}{gain}
Examples:
GBUFF1210111.0
Current Controlled Voltage Source CCVS.

H{name}{+node}{node}{vsource name}{gain}
Examples:
HSENSE12VSENSE10.0

HowtoobtainaVoltageCurrent
Characteristiccurve
h
*Currentsourcefortesting
I1 0 1 d 1A
I101dc1A
R1121k
d123mod1
Vsupply2 3 0 1
Vsupply2301
.modelmod1d
*Analysis
.dcI10.0010.0010.00005
.probeV(2)
.end

Netlist SimulationusingCadence
Simulation using Cadence

GotoAllProgramsCadenceSPBCAMSSimulator AMSSimulator

Open a New Text File


OpenaNewTextFile

IntroducetheNetlist Descriptionof
theCirctuit
h
andsaveitas.cirfile
d
fl

Go to FileOpen andopenthe.cirfile
GotoFileOpen
and open the .cir file

Go to Run Button
GotoRunButton

Check if the simulation is completed


Checkifthesimulationiscompleted

Go to the Add Trace Button


GototheAddTraceButton

Choose your Outputs


ChooseyourOutputs

IfyouwanttoseetheOutputfile.Go
toSimulationOutputfileButton
l
fl

Getallthedataaboutyoursimulation
results
l

Creating a Subcircuit
CreatingaSubcircuit
A
Asubcircuit
subcircuit issimilartoasubroutineinsoftware
is similar to a subroutine in software
programming.
Thissavesthetediumofcreatingmultipleblocks
This saves the tedium of creating multiple blocks
ofacircuitusedinmanyplaces.
Thesubcircuit
The subcircuit isdefinedbythestatements:
is defined by the statements:
.SUBCKT <subcircuit name> <node a><node b>...
S b i it definition.
Subcircuit
d fi iti
.ENDS

Example 2
Example2
WewanttocreateamodelforanOpAmp
We want to create a model for an OpAmp

*SINGLEPOLEOPERATIONALAMPLIFIERMACROMODEL*connections:
*
| inverting input
*
| | output
*
| | |
.SUBCKTOPAMP1 1 2 6
*INPUTIMPEDANCE
RIN 1
2
10MEG
*DCGAIN(100K)ANDPOLE1(100HZ)
EP13012100K
RP1341K
CP1401.5915UF
*OUTPUTBUFFERANDRESISTANCE
EOUT 5 0 4 0 1 ROUT 5 6 10
EOUT50401ROUT5610
.ENDS

noninverting input

NowIntroduceyoursubcircuit toyourdesign
Example2
VS 1
0
AC
1
R1 1
25K
R2 2
310K
XOP1 023
xOPAMP1
R3 4
010K
R4 4
510K
XOP2 345
345
xOPAMP1
*
*SINGLEPOLEOPERATIONALAMPLIFIERMACROMODEL
*connections:noninverting input
*|inverting input
*||output
*
*|||
| | |
.SUBCKTxOPAMP1126
*INPUTIMPEDANCE
RIN1210MEG
*DCGAIN(100K)ANDPOLE1(100HZ)
EP1 3012100K
RP1 341K
CP1 401.5915UF
*OUTPUTBUFFERANDRESISTANCE
EOUT 50401
ROUT 5610
.ENDS
*
*ANALYSIS
.TRAN
0.01MS0.2MS
.PLOTTRANV(1)V(5)
.PROBEV(1)V(5)
.END

SIN(0 1 10KHZ)
SIN(0110KHZ)

Homework
1) Page330.Book:MicroeLectronic circuits4th Edition.Sedra/Smith.Example4.18Fig4.76.
Getthesimulationresultsusingnetlist.ACanalysisandTRANanalysisforRe=100ohmsandRe=10ohms.

2)Page462.Book:MicroeLectronic circuits4th Edition.


Sedra/Smith.Example5.13.Fig5.76.
G t i l ti
GetsimulationresultsfortheCMOSinverter.
lt f th CMOS i
t

Exercise

GettherealmodelsfortherequiredcomponentsandobtainthesimulationresultsfortheOutputcurrentandOutput
Voltage. Use a resistor of 8Kohms to simulate the speaker. Input Voltage V1 . 10 mVpp at10KHz
Voltage.Usearesistorof8Kohmstosimulatethespeaker.InputVoltageV1.10mVpp
at 10 KHz

References

SPICE:AGuideto Circuit Simulation andAnalysis Using PSpice,PaulTuinenga,3rdEdition,PrenticeHall,1995,ISBN013


158775 7.
1587757.
The Spice Book,Andrei Vladimirescu,JohnWiley &Sons,Inc.,
1994,ISBN0471609269.
PSpice andCircuit Analysis,JohnKeown,Third Edition,Merrill(Macmillan PublishingCompany),1997,ISBN0132354586.

You might also like