Home
Writing Simple Spice Netlists
Contents
1. T 561 long 561 long 561 long 561 long Page lt 15 gt default scale The loaded data is now the current plot data as well Now let s say you need to get the steady state operating conditions of the devices in the circuit You can use show If you type show by itself it displays all of the devices with their values You can also type show followed by the device s you want to look at if you don t want to see all of them Type show now WinSpice3 31 gt show Level 2 MOSfet model with Meyer capacitance model Mos2 device model id ibd ibs is ig ib vgs vds vbs von vd Vsourc device ac sat rs ro gm gds gmb cbd cbs cgs cgd cgb e dc mag m1 nm 0 000136 1 93e 12 0 0 000136 0 1 93e 12 239 Independent voltage source vin ZS 0 vdd 5 0 i 1 73e 18 0 000136 P 4 34e 18 0 000682 You may want to save this displayed data in a text file instead of seeing it scroll on the text entry display This can be done using the gt symbol the same one used in UN Xs To save this data in a file now type show gt testdv out WinSpice3 31 gt show gt testdv out By Joshua Cantrell Page lt 16 gt jjc icslL ucla edu WinSpice3 Quick Reference source lt filename gt loads the given circuit netlist and commands into the simulator run runs the simulation as specified in the circuit input file show devices parameters Output
2. lt TSTART lt TMAX gt gt The parameters are TSTEP the time between each sample in the simulation TSTOP the stop time in the simulation which starts at 0 seconds TSTART the start time to save data for later analysis useful when memory is limited TMAX the maximum step size that WinSpice3 uses End of Simulation END This tells Spice to ignore all commands and lines after this point and to do the simulation It usually goes at the end of the file Make sure there is at least one blank line after it end By Joshua Cantrell Page lt 12 gt jjc icslL ucla edu Using WinSpice3 Download and Installation A free it still says free at the top of the page and useful version of Spice is WinSpice which can be found at http www willingham2 freeserve co uk winspice html This spice uses a command interpreter known to UNIX as Nutmeg and can display graphical plots which can be printed by window capturing in Windows using the ALT PrintScreen key combination This is the version of Spice I describe for showing graphical plots because it is absolutely free At the website go to Spice3F4 and click on the link here which should start the download Once the file is downloaded create a directory for the program run the executible and carefully make sure the program is installed in the created directory You are done Creating a Test Spice Netlist Learning how to display plots in Nutmeg is easy once you know how to navigate
3. gt gt lt DISTOF2 lt F2MAG lt F2PHASE gt gt gt The parameters are N I the name of the positive terminal N the name of the negative terminal lt lt DC gt DC TRAN VALUE gt the DC offset of the voltage source lt lt AC gt ACMAG lt ACPHASE gt gt gt the AC magnitude and phase applied in an AC analysis lt DISTOF1 lt F1MAG lt F1PHASE gt gt gt a distortion factor at frequency F1 lt DISTOF2 lt F2MAG lt F2PHASE gt gt gt a distortion factor at frequency F2 The DC value can be changed in time by using functions such as pulse sin exp and pwl The distortion factors only operate with a disto command By Joshua Cantrell Page lt 5 gt jjc icslL ucla edu Current Source Component A current source is described by IXXXXXXX N N lt lt DC gt DC TRAN VALUE gt lt AC lt ACMAG lt ACPHASE gt gt gt lt DISTOF1 lt FIMAG lt F1IPHASE gt gt gt lt DISTOF2 lt F2MAG lt F2PHASE gt gt gt The parameters are N I the name of the positive terminal N the name of the negative terminal lt lt DC gt DC TRAN VALUE gt the DC offset of the current source lt lt AC gt ACMAG lt ACPHASE gt gt gt the AC magnitude and phase applied in an AC analysis lt DISTOF1 lt F1MAG lt F1PHASE gt gt gt a distortion factor at frequency F1 lt DISTOF2 lt F2MAG lt F2PHASE gt gt gt a distortion factor at frequency F2 The DC value can be change
4. it First in a text editor like notepad make a sample circuit as follows Spice Simulation 1 1 x x MODEL Descriptions model nm NMOS level 2 VTO 0 7 KP 80e 6 LAMBDA 0 01 xxx NETLIST Description yag M1 vdd ng 0 0 nm W 3u L 3u R1 in ng 50 R1 M1 Vdd vdd 0 5 MVh 3 13u 5V Vdd Vin in 0 2 5 502 ng Bet H xxx SIMULATION Commands OP Vin 2 5V dc Vin 0 5 0 1 Vdd 0 5 0 5 0 nd end Figure 1 Schematic of Spice Simulation 1 1 Netlist Using Nutmeg to View and Store Data First run wspice3 exe Using the menubar option file open open the file with the above netlist Note that most netlists have the extension cir The netlist and simulation commands have now been loaded into WinSpice3 WinSpice3 1 gt cd current directory D Program Files WinSpice3 WinSpice3 2 gt source test cir Reading test cir Circuit Spice Simulation 1 1 To actually run the simulation the run command must be typed at the command prompt WinSpice3 3 gt run DC Operating Point By Joshua Cantrell Page lt 13 gt jjc icslL ucla edu Now the simulation data is resident in memory and can be manipulated within Nutmeg Mathematical operations can be used on the vector data and it can be plotted and written to files To see what type of data is available type display WinSpice3 4 gt display Here are the vectors currently active Title Spice Simulation 1 1 Name opl Operating
5. the operating point device summary dc srcnam vstart vstop viner src2 start2 stop2 incr2 Like the DC simulation command this runs a dc simulation at the command prompt listing shows the circuit listing with line numbers display shows vector status reset terminate a simulation after a breakpoint like a end plot expr vs expr x1 xlo xhi y1 ylo yhi plot simulation results setplot plotname select which plot data to be made current write file expr write data to a file of the currently active plot data let varname expr assign vector variables set option option value seta variable name param pi e c 1 kelvin echarge boltz planck Bibliography Most of the Spice information was taken in someway from 1 Mike Smith WinSpice3 User s Manual 25 October 1999
6. By Joshua Cantrell Page lt I gt jjc icslLucla edu Writing Simple Spice Netlists Introduction Spice is used extensively in education and research to simulate analog circuits This powerful tool can help you avoid assembling circuits which have very little hope of operating in practice through prior computer simulation The circuits are described using a simple circuit description language which is composed of components with terminals attached to particular nodes These groups of components attached to nodes are called netlists Parts of a Spice Netlist A Spice netlist is usually organized into different parts The very first line is ignored by the Spice simulator and becomes the title of the simulation The rest of the lines can be somewhat scattered assuming the correct conventions are used For commands each line must start with a period For components each line must start with a letter which represents the component type eg M for MOSFET When a command or component description is continued on multiple lines a plus begins each following line so that Spice knows it belongs to whatever is on the previous line Any line to be ignored is either left blank or starts with a asterik A simple Spice netlist is shown below Spice Simulation 1 1 xxx MODEL Descriptions model nm NMOS level 2 VTO 0 7 KP 80e 6 LAMBDA 0 01 vdd ee 3 NETLIST Description R1 M1 M1 vdd n
7. Point Date Wed Apr 25 08 09 25 2001 in voltage real 1 long ng voltage real 1 long vdd voltage real 1 long default scale vdd branch current real 1 long vin branch current real 1 long Notice that the only data available right now is from the op command line Nutmeg separates the different data from different simulations so they must be selected using setplot Type setplot to view the different data groups available to us WinSpice3 5 gt setplot Type the name of the desired plot new New plot Current opl Spice Simulation 1 1 Operating Point del Spice Simulation 1 1 DC transfer characteristic const Constant values constants Notice that both the op and dc data are listed To choose the dc data by typing dc at the prompt Now type display again to see the names of the data vectors WinSpice3 6 gt display Here are the vectors currently active Title Spice Simulation 1 1 Name dcl DC transfer characteristic Date Wed Apr 25 08 09 25 2001 in voltage real 561 long ng voltage real 561 long sweep voltage real 561 long default scale vdd voltage real 561 long vdd branch current real 561 long vin tbranch current real 561 long Notice that certain values are current and others are voltage To plot IDS of the MOSFET versus VGS with the plots for all values of VDS type the command plot
8. d in time by using functions such as pulse sin exp and pwl The distortion factors only operate with a disto command Current and Voltage Source DC Functions Pulse Function The pulse function is described by PULSE V1 V2 lt TD gt lt TR gt lt TF gt lt PW gt lt PER gt The parameters are V1 the initial value volts or amps V2 the pulsed value volts or amps lt TD gt the seconds before the first pulsed value lt TR gt the seconds it takes the pulse to rise from V1 to V2 lt TF gt the seconds it takes the pulse to fall from V2 to V1 lt PW gt the number of seconds the signal stays at V2 lt PER gt the time between each rising edge of the pulse after the first initial pulse Sinusoidal Function The sinusoidal function is described by SIN VO VA FREQ lt TD gt lt THETA gt The parameters are VO the offset value volts or amps VA the peak amplitude value volts or amps the peak to peak value is twice this FREQ the frequency in Hz of the sinusoid lt TD gt the seconds before the start of the sinusoid lt THETA gt the damping factor of the sinusoid in 1 second By Joshua Cantrell Page lt 6 gt jjc icslL ucla edu Exponential Function The exponential function is described by EXP V1 V2 lt TD1 gt lt TAU1 gt lt TD gt lt TAU2 gt The parameters are V1 the initial value volts or amps V2 the pulsed value volts or amps lt TD1 gt the s
9. econds before the pulsed value lt TAU1 gt the rise time constant for the pulse to rise from V1 to V2 lt TD gt the seconds before the falling of the pulsed value lt TAU2 gt the fall time constant for the pulse to fall from V2 to V1 Piece Wise Linear Function The piece wise linear function is described by PWL T1 V1 lt T2 V2 lt T3 V3 lt T4 V4 gt gt gt The parameters are Tn the time where the nth voltage is at the desired voltage Vn the nth voltage Model Definition Commands Generic Model Command The generic model command is described by MODEL MNAME TYPE PNAME1 PVAL1 PNAME2 PVAL2 The parameters are MNAME the name to give the model TYPE the type of model eg D NPN PNP NMOS PMOS PNAMEn the name of the parameter to be set PV ALn the parameter s value Diode Model D The diode model command is described by model MNAME D PNAME1 PVAL1 PNAME2 PVAL2 e CO e eee e e By Joshua Cantrell Page lt 7 gt jjc icslL ucla edu co zero bias junction capacitance TT CJO VJ FC BV BV sec grading coefficient V C 0 69 Sbd S R i coefficient for forward bias depletion 0 capacitance formula a a rz current at breakdown voltage toes f mo ee e a BJT Model NPN PNP The NPN model command is described by 5 11 5 activation energy model MNAME NPN PNAME1 PVAL1 PNAME2 PVAL2 The PNP model com
10. ed inductor LZZZZZZZ the name of the second coupled inductor VALUE the coefficient of coupling K where 0 lt K lt 1 The orientation of the inductors is determined by the first node which is considered to be the doted node Junction Diode Component A diode is described by DXXXXXXX N N MNAME lt AREA gt lt OFF gt lt IC VD gt lt TEMP T gt The parameters are N the name of the positive terminal N the name of the negative terminal MNAME name of the model used lt AREA gt the scaling factor of the diode determines how much current can flow through it lt OFF gt an optional starting condition for DC analysis lt IC VD gt starting voltage in a simulation lt TEMP T gt temperature of the diode in Kelvin Bipolar Junction Transistor BJT Component A bipolar junction transistor is described by OXXXXXXX NC NB NE lt NS gt MNAME lt AREA gt lt OFF gt lt IC VB E VCE gt lt TEMP T gt The parameters are NC I the name of the collector terminal NB the name of the base terminal NE the name of the emitter terminal lt NS gt the name of the substrate terminal optional MNAME name of the model used lt AREA gt the scaling factor of the BJT determines how much current can flow through it lt OFF gt an optional starting condition for DC analysis lt IC VBE VCE gt starting voltage in a simulation lt TEMP T gt temperature of the tran
11. g 0 0 nm W 3u L 3u in Rl in ng 50 bm Saat J3w3u SV C Vdd Vdd vdd 0 5 502 A Vin in 0 2 5 SIMULATION Commands Vin 2 5V S Op T end Figure 1 Schematic of Spice Simulation 1 1 Netlist The first line is the title of the simulation It s unimportant for the simulation except for identification The Spice commands under MODEL Descriptions are used to define the electrical properties of particular devices In this example the MOSFET is defined by the given parameters in the model In the NETLIST Description the components are listed with the nodes they are connected to Notice that each one starts with a letter The MOSFET starts with an M the resistor starts with an R and the voltage sources start with V s A common error when simulating is to place a component definition or operation on this first line and the Spice simulator will appear to not function properly It will either complain about missing components models or not do what you think By Joshua Cantrell Page lt 2 gt jjc icslL ucla edu Simple Netlist Components Resistor Component The register is described by RXXXXXXX N1 N2 lt VALUE gt lt MNAME gt lt L LENGTH gt lt W WIDTH gt lt TEMP T gt The parameters are N1 the first terminal N2 the second terminal lt VALUE gt resistance in ohms lt MNAME gt name of the model used useful for semiconductor resistors lt L LENGTH gt
12. ias bulk junction bottom cap per sq meter of junction area gt n bulk junction bottom grading coefficient ete zero bias bulk junction sidewall cap per meter of junction perimeter levell 0 33 level2 3 bulk junction saturation current per sq meter of junction area substrate doping o ae 4 0e15 By Joshua Cantrell Page lt 10 gt jjc icslL ucla edu coefficient for forward bias depletion capacitance formula TNOM parameter measurement temperature Basic Simulation Commands Set Initial Conditions IC In circuits with memory or with nodes that need to be set to initial values IC is helpful When there are problems with convergence IC can be used to help the simulator find a region of convergence The command is described by ic V NODNUM VAL V NODNUM VAL The parameters are NODNUM the name of the node to be set VAL the value of voltage to set it at Operating Point Analysis OP This finds the steady state operating conditions of devices and nodes The command is described by op Small Signal Gain Analysis TF This returns the gain computed using op steady state values given output and input variables The command is described by tf OUTVAR INSRC The parameters are OUTVAR the output variable ie V NODE1 NODE2 or I VLOAD INSRC the voltage or current source at the input ie Vin or Tin Steady State DC Analysis DC This calculates the conditi
13. length of the resistor useful for semiconductor resistors lt W WIDTH gt width of the resistor useful for semiconductor resistors lt TEMP T gt temperature of the resistor in Kelvin useful in noise analysis and semiconductor resistors Notice that the parameters given with in their definitions must be written with the symbol followed by followed by the value For example to set a resistor to 500 Kelvin you d write RHOT nl n2 10k TEMP 500 All of the parameters surrounded by lt and gt can be left out and will be replaced by default values All of them must appear in order except for the parameters with in their definitions Capacitor Component The capacitor is described by CXXXXXXX N N VALUE lt IC INCOND gt The parameters are N the positive terminal N the negative terminal VALUE capacitance in farads lt IC INCOND gt starting voltage in a simulation Inductor Component The inductor is described by LYYYYYYY N N VALUE lt IC INCOND gt The parameters are N the positive terminal N the negative terminal VALUE capacitance in farads lt IC INCOND gt starting voltage in a simulation By Joshua Cantrell Page lt 3 gt jjc icslL ucla edu Coupled Inductors Component Two coupled inductors are described by KXXXXXXX LYYYYYYY LZZZZZZZ VALUE The parameters are LYYYYYYY the name of the first coupl
14. mand is described by model MNAME PNP PNAME1 PVAL1 PNAME2 PVAL2 units default example A 1 0e 16 1 0e 15 V 200 Vv 200 parameter transport saturation current wW ligo p ideal maximum forward beta N taal forward current emission coefficient VAF forward Early voltage ideal maximum reverse beta Z izo reverse current emission coefficient VAR reverse Early voltage By Joshua Cantrell jjc icslL ucla edu Err OO e Too F er CC s osm fon cine O Se o Feman aa O fe o pema lv pemanan fs E area 0 1ns fraction of B C depletion capacitance connected to internal base node PUINE coefficient for forward bias depletion er li capacitance formula na pee ef e 10ns FC MOSFET Model NMOS PMOS The NMOS model command is described by model MNAME NMOS PNAME1 PVAL1 PNAME2 PVAL2 The PMOS model command is described by model MNAME PMOS PNAME1 PVAL1 PNAME2 PVAL2 Page lt 8 gt By Joshua Cantrell es jjc icslL ucla edu fav fois fro farce f foe Ee cece h channel length modulation MOS1 and MOS2 only A ae pes bulk junction saturation current IS a 1 0e 14 1 0e 15 3 le 5 0 37 0 65 0 02 1 0 4 0e 11 gate source overlap capacitance per meter channel width gate drain overlap capacitance per meter channel width gate bulk overlap capacitance per meter 2 0e 10 channel length zero b
15. ons of devices and nodes at a series of input conditions The command is described by dc SRCNAM VSTART VSTOP VINCR SRC2 START2 STOP2 INCR2 By Joshua Cantrell Page lt 11 gt jjc icslL ucla edu The parameters are SRCNAM the name of the input current or voltage source to vary VSTART the initial voltage of the input source VSTOP the final voltage of the input source VINCR the voltage between each input source voltage tested SRCNAM2 the name of a second input current or voltage source to vary VSTART2 the initial voltage of the second input source VSTOP 2 the final voltage of the second input source VINCR2 the voltage between each second input source voltage tested By specifying two sources plots can be generated to see how both voltage sources effect each other Small Signal AC Analysis AC This calculates how the devices operate in the frequency domain with the small signal characteristics at a given DC operating point The command is described by ac STYPE ND FSTART FSTOP The parameters are STYPE a DECade OCTave or LINear step ND the name of the oscillating input current or voltage source F START the initial frequency of the input source F STOP the final frequency of the input source Transient Analysis TRAN This monitors the state of a circuit in time given a particular input The output resembles what can be seen with oscilloscopes The command is described by tran TSTEP TSTOP
16. sistor in Kelvin By Joshua Cantrell Page lt 4 gt jjc icslL ucla edu MOSFET Component A MOSFET transistor is described by MXXXXXXX ND NG NS NB MNAME lt L VAL gt lt W VAL gt lt AD VAL gt lt AS VAL gt lt PD VAL gt lt PS VAL gt lt NRD VAL gt lt NRS VAL gt lt OFF gt lt IC VDS VGS VBS gt lt TEMP T gt The parameters are ND I the name of the drain terminal NG the name of the gate terminal NS the name of the source terminal NB the name of the bulk backgate terminal MNAME name of the model used lt L VAL gt length of the gate in meters lt W VAL gt width of the gate in meters lt AD VAL gt area of the drain contact in sqare meters lt AS VAL gt area of the source contact in sqare meters lt PD VAL gt perimeter of the drain contact in meters lt PS VAL gt perimeter of the source contact in meters lt NRD VAL gt equivalent squares that make up the drain to determine the drain resistance lt NRS VAL gt equivalent squares that make up the source to determine the source resistance lt OFF gt an optional starting condition for DC analysis lt IC VDS VGS VBS gt starting voltage in a simulation lt TEMP T gt temperature of the transistor in Kelvin Voltage Source Component A voltage source is described by VXXXXXXX N N lt lt DC gt DC TRAN VALUE gt lt AC lt ACMAG lt ACPHASE gt gt gt lt DISTOF1 lt FIMAG lt F1IPHASE gt
17. vdd branch vs ng WinSpice3 8 gt plot vddi branch vs ng By Joshua Cantrell Page lt 14 gt jjc icslL ucla edu u vdd branch 800 0p a ae a ealaleietci a T aaa Paneer lala adel oP ee eee ee ec oe or ee es on oo or ee Ze To oo en oe ene a a a nee ee ee 1 een ee ee ae ee d i 1 4 i i i i i i i 0 0 0 5 1 0 1 5 2 0 2 5 3 0 3 5 4 0 4 5 5 0 Let s say you want to save this data in case you need to plot it later you can use write By typing write followed by the filename to save the data in you can save the selected plot data for later use Type write testdc data to save the current DC plot data WinSpice3 9 gt write testdc data Now if you have to load this data you simply need to use the load command followed by the filename the data is saved in Type load testdc data to load the saved DC plot data WinSpice3 10 gt load testdc data Loading raw data file testdc data done Title Spice Simulation 1 1 Name DC transfer characteristic Date Thu Aug 16 12 53 27 2001 Here are the vectors currently active Title Spice Simulation 1 1 ame dc2 DC transfer characteristic Date Thu Aug 16 12 53 27 2001 in voltage real 561 long ng voltage real 561 long ng voltage real 561 long By Joshua Cantrell jjc icslL ucla edu sweep vdd vdd vin branch branch voltage voltage current current real real real real r r
Download Pdf Manuals
Related Search
Related Contents
information Guía de referencia rápida para OD-610/OD-620 JVC SP-THS1S User's Manual biggest s1s Manual USER'S GUIDE - Success By 6 FLUX-MIG 100 - pdf.lowes.com PLC Lab Manual Sentra VE Series Product Service Manual Manual do usuário Tobii Studio 1.2 User Manual Copyright © All rights reserved.
Failed to retrieve file