Circuit Simulation Using SPICE Prof. A. Mason

1: Circuit Description

2: Semiconductor Models

3. MOSFET Model Parameters

4: Analysis Methods

5: General Spice Notes

6: Using B2Spice

 

1. Circuit Description

Although most SPICE simulators today use a graphical interface, an understanding of SPICE netlist concepts is very useful. A netlist is a complete text description of the circuit which includes the element lines, analysis statement(s), and a list of model parameters for semiconductor devices. Whether using a graphical interface or a text netlist, all of the parameters discussed below are necessary to describe the circuit and desired simulation. This section explains the element lines, and model and analysis statements are covered below.

Circuits for SPICE simulation are described the elements of the circuit and a list of the nets (nodes) each element is connected to. Elements include sources (voltage, current, etc.) and devices (resistors, capacitors, transistors, etc.). Elements must be assigned unique names starting with a designated letter as shown below. The element name is the first part of the element line which also contains a list of the nets each terminal of the element is connected to and key data describing the device. Nets, or nodes, can be assigned names or numbers depending on the specific software used. Data in the element line describes the element, e.g. the DC voltage of a voltage source or the resistance of a resistor. Because semiconductor elements are more complex to model than linear elements, modeling parameters for semiconductor devices are contained in a separate part of the netlist called a .model statement. To indicate which .model statement should be used for each element, semiconductor element lines must contain a model name (which also appears in the .model statement). Although most of the parameters for semiconductors are in the model statement, the parameters that can be changed by designers (i.e. non-process specific parameters) are assigned in the element line. In general, element line parameters for semiconductor devices relate to the size of the device, e.g. the length and width of an MOS transistor.

Although graphical SPICE programs do not use element lines, the data entered in the element line of a netlist must also be specified. For example, in many SPICE programs you can double-click a device and then assign the appropriate parameters. For semiconductor devices, you may have to open the model description to alter those parameters.

An example showing many of the most common circuit elements is shown in the netlist below. Note, this circuit is for illustration only and may not be functional.

Vdd 1 0 5

R1 1 2 1K

R2 2 0 2K

Mn1 2 3 0 0 cmosn L=2e-6 W=4e-6

Mp1 2 3 1 1 cmosp L=2e-6 W=4e-6

C1 3 0 1n

Note: some (but not all) units are implied and do not need to be specifically written. For example, Vxx is assumed to be in volts, Rxx is assumed to be in ohms, etc.

Element Line Descriptions (for some common elements –others are available)

Voltage Source

Vxx +node -node DC value

Current Source

Vxx +node -node DC value

Resistor

Rxx node1 node2 value

Capacitor

Cxx node1 node2 value

Diode

Dxx +node -node model_name <area>

plus other optional parameters

Bipolar Transistor

Qxx collector base emitter <bulk> model_name <area>

plus other optional parameters

MOS Transistor

Mxx drain gate source bulk model_name <L=value> <W=value> <AD=value> <AS=value>

plus other optional parameters

Note: parameters in <> are optional and not required for simulation.

2. Semiconductor Models

Semiconductor devices are nonlinear, and as a result several parameters are required to model there operation is circuit simulators such as SPICE. The required parameters are specific to each device type and to the equations that are used to model the performance of each device. For example, there are a wide range of equation-models used to describe MOSFETs, and the equations we learn in class are for the most basic model.

Semiconductor Device .model Statements

The .model statements for all devices contain the name of the model (referred to by the element line), the device type (D for diode, etc.) and a list of parameters specific to each device type. Parameters not provided in the .model statement are assigned default values. Note the parameters are enclosed in parentheses.

PN Junction Diodes

.MODEL Model_Name D <(parameter 1=value1 parameter 2=value2 . . . )>

Bipolar Junction Transistors

.MODEL Model_Name NPN <(parameter 1=value1 parameter 2=value2 . . . )>

.MODEL Model_Name PNP <(parameter 1=value1 parameter 2=value2 . . . )>

MOS Field Effect Transistors

.MODEL Model_Name NMOS <(parameter 1=value1 parameter 2=value2 . . . )>

.MODEL Model_Name PMOS <(parameter 1=value1 parameter 2=value2 . . . )>

Semiconductor Device Parameters

For each device type there is a list of parameters that define the device. In general, these parameters are the same as those seen in the equations used to model the device. However, there are additional parameters that model effects not described by the simple large signal models covered in class. Device parameters are determined by the processes used to fabricate the device, and accurate model parameters can generally be obtained from manufacturer datasheets or from integrated circuit foundries. The following is a brief list of the parameters you will need to consider for each device type.

PN Junction Diodes

Name Parameter Units Default

IS saturation current A 1.0E-14

N emission coefficient - 1

BV reverse breakdown voltage V infinite

CJO zero-bias junction capacitance F 0

VJ junction potential V 1

M grading coefficient - 0.5

Bipolar Junction Transistors

Name Parameter Units Default

IS saturation current A 1.0E-16

BF ideal max. forward beta - 100

VAF forward Early voltage V infinite

(there are many other parameters for BJT that are beyond the scope of this class)

MOS Field Effect Transistors

Name Parameter Units

LEVEL model identification -

TPG type of gate (poly doping type) -

+1 = opposite of substrate

-1 = same as substrate)

TOX gate oxide thickness meter

NSUB substrate impurity concentration cm-3

XJ source/drain junction depth meter

UO surface mobility cm2/Vs

VTO equilibrium threshold voltage V

LAMBDA channel length modulation (level 1 only) V-1

PHI surface potential at strong inversion V

KP transconductance parameter A/V2

GAMMA bulk threshold parameter V

LD lateral diffusion meter

CGDO gate-drain overlap capacitance/channel width F/m

CGSO gate-source overlap capacitance/channel width F/m

CGBO gate-bulk capacitance/channel length F/m

CJ zero bias s/d junction (bottom) capacitance/area F/m2

CJSW zero bias s/d sidewall capacitance/length F/m

MJ bulk junction bottom grading coef.

MJSW bulk junction sidewall grading coef.

PB bulk junction potential

Because the parameters used for modeling MOSFETs in SPICE are more complex than other devices, they will be discussed in the next section.

Example Model Statements

.MODEL pn D (IS=10E-15 N=1 BV=50)

.MODEL npnbjt NPN (IS=10E-15 BF=150 VAF=200)

.MODEL pnpbjt PNP (IS=10E-15 BF=150 VAF=200)

.MODEL cmosn NMOS (LEVEL=1 UO=669.5 TOX=2.92E-08 NSUB=1.8050E+16

+ PHI=0.7 VTO=0.5940 KP=7.9174E-05 GAMMA=0.6546 LAMBDA=0.0134

+ XJ=0.2U TPG=1 LD=1.0530E-07

+ CGDO=1.8679E-10 CGSO=1.8679E-10 CGBO=4.3907E-10 CJ=2.8446E-04 MJ=5.2989E-01

+ CJSW=1.4208E-10 MJSW=1.0000E-01 PB=9.8338E-01)

.MODEL cmosp PMOS (LEVEL=1 UO=181.5 TOX=2.9200E-08 NSUB=4.4510E+15

+ PHI=0.7 VTO=-0.8135 KP=2.1464E-05 GAMMA=0.3250 LAMBDA=0.02

+ XJ=0.2U TPG=-1 LD=1.11E-09

+ CGDO=5.0000E-11 CGSO=5.0000E-11 CGBO=4.0071E-10 CJ=3.0160E-04 MJ=4.4794E-01

+ CJSW=1.8785E-10 MJSW=1.0476E-01 PB=7.6778E-01)

3. MOSFET Model Parameters

Model Level for MOSFETs:

The equation-models used for MOSFETs range from the simple models (cutoff, triode and saturation) that we learn in class to very elaborate models that required ~50 parameters to fully describe the operation of the device. Because more than one set of equation-models are available for MOSFETs, we must specify which set we want SPICE to use. The modeling set of equations is identified by the level parameter in the .model statement. The following describes the parameters required to describe the level 1 model for a MOSFET. We will always use level 1 models for simulation of MOS circuits.

Base Parameters

Parameter

Equation

Variable

SPICE

Variable

Units

Substrate Impurity Conc.

ND, NA

NSUB

cm-3

Surface Mobility

m n, m p

UO

cm2/V-sec

Gate Oxide Thickness

tOX

TOX

meters

Oxide Charge Density

Nss

NSS

cm-2

Lateral Diffusion under Gate

Ld

LD

meters

NOTE: some parameters are specific to nMOS or pMOS, e.g. m n and m p.

Derived Parameters

The following parameters are calculated based on the ‘base parameters’ listed above.

Parameter

Equation

Variable

SPICE

Variable

Units

Intrinsic Transconductance

m COX

KP

A/V2

Bulk Threshold Parameter

(Body Effect Parameter)

g

GAMMA

V

Channel Length Modulation Factor

l

LAMBDA

V-1

Surface Potential

2j F

PHI

V

Zero Bias Threshold Voltage (VSB = 0)

VT0

VTO

V

The equations for calculating the derived parameters are:

NOTE: Any parameter given in the .model statement will override parameters SPICE might calculate using these equations.

Using these parameters, the equation for a MOSFET in saturation is written

iD = KP W/Leff (VGS – VTR)2 (1 + LAMBDA VDS)

where VTR = VTO + GAMMA{ (|PHI| + VSB) - |PHI| }

 

 

 

 

4. Analysis Description

SPICE can perform a variety of types of analysis on a circuit. Some of these are briefly described below.

Transient Analysis

Most of the simulation we will do will involve transient analysis which will tell us what our circuit is doing as a function of time. A transient analysis has the following properties which must be defined.

.TRAN TSTEP TSTOP <TSTART> <TMAX>

TSTEP is the time step used between analysis points, and the smaller the value is, the more resolution you will get in your simulation. A typical value is 1nsec.

TSTOP is the time when you want your transient analysis to stop. This value will depend on the frequency of your input signal(s) and the time it takes for your circuit to produce its final output.

TSTART is used if you want the analysis to start at some time other than Time=0.

TMAX is used to set the largest step time that will be used. This parameter is typically not needed.

Operating Point Analysis

.OP is the operating point command and it will produce a list of the initial operation conditions including node voltages and device currents. It is useful to view bias values without doing a full simulation.

DC Analysis

Use a DC analysis if you want to view the response of the circuit when a source (voltage or current) sweeps between two DC values. The command and parameters are:

.DC Source_name START STOP STEP

Source_name is the name of the source that will be swept.

START and STOP are the beginning and ending values of the sweep.

STEP is the increment value used during the sweep.

AC Analysis

To sweep all AC sources across a range of frequencies, use the .AC command.

.AC Lin/Dec/Oct N FSTART FSTOP

FSTART and FSTOP are the beginning and ending frequencies of the AC analysis.

Select either Lin, Dec, or Oct for a linear, decade, or octave scaled sweep with N points analyzed.

 

See SPICE manuals for more information and additional analysis types.

 

5. General Spice Notes

Component Values and Scientific Notation

SPICE supports scientific notation where "e" (for "exponent) denotes the power of ten to be applied. SPICE also supports the abbreviations listed below. For example:

0.0123 = 1.23e-2 = 12.3e-3 = 12.3m (where m is for milli)

1230000 = 1.23E6 = 1.23MEG = 1.23E3K = 0.00123G

Note that SPICE is not case sensitive so "m" or "e" is the same as "M" or "E".

The following metric abbreviations are supported by SPICE

m milli 10-3 k kilo 103
u micro 10-6 meg mega 106
n nano 10-9 g giga 109
p pico 10-12 t tera 1012
f femto 10-15      

 

6. Using B2Spice

Starting B2 Spice:

You should be able to access the B2 Spice folder from the Start Menu on PCs in student labs in the Civil Engineering building as well as Young Library. Look in

Programs => Instructional Software => B^2 Spice

Once in the B2 Spice folder, start the program by clicking on an icon called Workshop. The program will respond with the workshop window and you can either draw a new circuit, type up a new netlist, or open an old circuit (graphic/CAD format) or netlist. These options are accessible from the FILE menu option. Be sure to open a file from the File menu rather than double-clicking the file –this won’t work if your file is on a floppy disk or a drive other than the one the application is on.

Entering your circuit as a netlist:

If you choose new netlist under the file menu, a text window will open up. There may be two lines already in there to act as a template. One would be a dummy title (Circuit), which you can change to something more descriptive (your program title). The other will be a .END statement. You can type in your SPICE program between these lines.

Entering your circuit graphically:

With the circuit window active, select a source or device from the DEVICES or DEVICES2 menu. For this class we may need to get components from both DEVICE and DEVICE2 menus. The selected component will appear attached to your cursor and you can place it where you want on the sheet. Select the line tool (next to the pointer/select tool) to add wires to your circuit. A single click with the line tool will set a node and a double click with end the line.

To modify element parameters (such as Voltage of a voltage source or Length and Width of a MOSFET), double click the element to open the Simulation Model Properties window and set the values. For semiconductor devices you will also need to set the model parameters, which you can do by clicking on either the Edit from table or Edit as Text buttons. You can save your models in a process file that you can name by clicking Make Unique and assigning a new name to the parameters you define. Once all the parameters are set, click OK and return to the circuit window. You can right-click on any element and copy it. Once you have set the parameters (including model parameters), copying a device will copy all the model parameters with it. You can still change the parameters (e.g. Length and Width) of the copied transistors, but you won’t have to enter all the model data again if you copy the first device. However, you will need to enter different model parameters for both an nMOS and a pMOS FETs, or npn and pnp BJTs.

For more information, see the notes above, and use the Online Help functions of this program.

Running the simulation:

When finished drawing the circuit or writing the netlist, with the circuit/netlist window active, go to the SIMULATION menu and select RUN SIMULATION. For simple programs, 3 new windows will be created. The LOG window is a report on how your program ran. If there were warnings or errors, this window will detail the problems with your SPICE program. If the errors are fatal, the other windows will open blank. You will then need to debug your program.

Displaying simulation data:

If the program runs successfully, you can then define the variables you want to appear in the table and graph windows. If you make your table window active and go to the EDIT menu options, you should see an option for EDIT TABLE SETTINGS. Click on this to pop up a window that will allow you to change to format of the table window. There will be a button in this window labeled EDIT SIGNAL LIST. Click on this option to get another window (called Edit Plots) that will allow you to select circuit values you want listed in the table. If you want to perform mathematical operation on them you (like compute magnitude or phase), you can select the ADD NEW PLOT option. You can give this new value a name in the title Plot Name box. This is the way the quantity will be identified on plots and tables in the table and graph windows. Then you can move down into the Plot Expression box and either type in the expression (i.e. mag(V(2)) for magnitude or ph(V(2)) for phase), or click the variable and function operations in the menu below. Then enter the units in the Units box and click OK. These new values will appear in the table window. If your SPICE analysis did a sweep through a series of values (AC or DC), then you will also see this in the plot. You can skip the table window and go directly to the EDIT menu and select the EDIT PLOT option if you want. You can select ADD NEW PLOT to put additional traces in or delete old ones. Obviously, if you only analyzed the circuit at one point, no graph will appear in the window.

The old commands like .PRINT and .PLOT are no longer applicable. You have to select the variables you want displayed from the edit menu options in B2 SPICE.

rdlarrl.gif (191 bytes)  Back to 461g Page


Professor Mason's: HOME | RESEARCH | AMSaC LAB | EE COURSES
University of Kentucky | UK College of Engineering | UK Electrical Engineering | UK EE Faculty