Copyright: Copyright ®1993 AIM-Software
Citation: Copyright ®1993 AIM-Software


Contents

What is AIM-Spice

Conventions Used in the Documentation

Using AIM-Spice Online Help

The AIM-Spice Toolbars

Editing your Circuit Description

Typing and Formatting Text

Moving the Insertion Point

Formatting Text

Scrolling

Editing Text

Selecting Text

Replacing Text

Cutting Text

Deleting Text

Moving Text

Copying Text

Undoing an Edit

Working with AIM-Spice Circuit Files

Opening Circuit Files

Creating a new Circuit File

Opening an Existing Circuit File

Viewing a Circuit File in Another Directory

Opening Existing Standard Text Files

Importing Files

Saving a Circuit File

Saving a New Circuit File

Saving Changes

Circuit description in AIM-Spice

A Circuit Example

Names

Nodes

Values

Circuit Elements or Devices

Passive Devices

Semiconductor Devices

Voltage and Current Sources

Controlled Sources

Independent Sources

Switches

Models

Subcircuits

Circuit Analysis with AIM-Spice

Operating Point

DC Transfer Curve

AC Small Signal Analysis

Transient Analysis

Pole-Zero Analysis

Transfer Function Analysis

Noise Analysis

Setting Initial Conditions

.IC

.NODESET

IC=

Options

Interactive Simulation Control

DC Operating Point

Pole-Zero Analysis

Transfer Function Analysis

Noise Analysis

AC, DC Sweep, Transient, and Distortion Analysis

Selection of Variables to Plot

Selection of Variables to Save

Formatting Axes and Labels

Arranging Plot Windows

Starting a Simulation

Stopping a Simulation

Resetting the Plot Limits during a Simulation

Saving Results after Completing a Simulation

Exiting after Completing a Simulation

Simulation Shortcuts

Error Reporting


What is AIM-Spice

Automatic Integrated Circuit Modeling Spice (AIM-Spice) is based on Berkeley Spice version 3.E1, the popular analog circuit simulator developed at the University of California, at Berkeley.

The AIM-Spice simulation package consists of two applications running under Microsoft Windows version 3.1 or laterAIM-Spice itself and a graphic postprocessor called AIM-Postprocessor.

AIM-Spice features:

Runs under the Microsoft Windows Graphical Environment which gives you a simple and user friendly interface.

Allows for Interactive Simulation Control. AIM-Spice displays simulation results in progress by plotting the output during the run with the option to cancel a simulation at any time.

Incorporates advanced and intermediate level device models described elsewhere in this book and in  Semiconductor Device Modeling for VLSI by K. LEE, M. SHUR, T. A. FJELDLY and T. YTTERDAL (Prentice Hall 1993).  These models can be used not only for device and circuit simulation but also for straightforward parameter extraction.

Some updated features of Berkeley SPICE version 3.E1:

Analyses supported: DC, AC, Transient, Transfer Function, Pole-Zero, and Noise Analysis.

New models from Berkeley: BSIM2, BSIM3, lossy transmission lines, and MOS level 6.

Improved DC Operating Point Analysis with gmin and source stepping.

AIM-Spice is a full blown Microsoft Windows application and takes full advantage of all Microsoft Windows extensions to DOS such as: a user friendly interface, available memory beyond the 640 KB DOS limit, and multitasking that allows the user to switch to other applications to do meaningful work while a lengthy simulation runs in the background.


Conventions Used in the Documentation

Before you start using the AIM-Spice help facilities, it's important to understand the terms and notational conventions used.

General conventions

The word "choose" is used for carrying out a menu command or a command button in a dialog box.

The word "select" is used for selecting a specific dialog option.

Commands you choose are given with the menu name preceding the command name. For example, the phrase "Choose File Open" tells you to choose the Open command from the File menu.

The phrase "Choose OK" means that you either can click the OK button with the mouse or press the ENTER key on the keyboard to carry out the action you want.

Mouse Conventions

AIM-Spice requires a mouse with two buttons. Most mouse operations are performed with the left mouse button, but this can be changed with the Control Panel. The phrase "mouse button" means the left mouse button while "right" is given explicit when we want you to use the right mouse button.

"Point" means to position the mouse cursor until the tip of the pointer rests on what you want to point at.

"Click" means to press a mouse button and immediately release it without moving the mouse.

"Double Click" means to press and release the mouse button twice in rapid succession.

"Drag" means to press and hold the mouse button while you move the mouse.


Using AIM-Spice online help

The AIM-Spice online help system is divided into two categories. You select the category by choosing the corresponding command from the AIM-Spice Help menu. To learn about how to use AIM-Spice to prepare a circuit description, setting simulation options and performing a simulation, choose the Contents command. To look up the SPICE syntax for a certain device or model, choose the SPICE Reference command. The SPICE reference for a certain device can also be obtained using a hot-key combination. Place the cursor on the line where the device is defined and press Shift+F1.

You can also open the Contents Help window by clicking the following toolbar button:


The AIM-Spice Toolbars

AIM-Spice displays a toolbar right below the menu that gives you instant access to the most frequently used commands. If you are running the Windows 95/NT version of AIM-Spice, tool tips are shown whenever you move the cursor over one of the buttons in the toolbar. The tool tip explain which command each button performs if it is clicked. Unfortunately, the Windows 3.1 version of AIM-Postprocessor does not have this nice tool tip feature. Therefore, in the figure below the toolbar button commands are shown.

Toolbar Button Commands for Edit Mode

Toolbar Button Commands for Analysis Mode


Editing your Circuit Description
Editing the Circuit Description

The circuit topology is defined in terms of a list of circuit elements called the netlist. This description is made in a simple text editor integrated into AIM-Spice. In this topic, we take a closer look at the text editor.

Typing and Formatting Text

The insertion point moves to the right when you start typing. If your typing goes beyond the right margin, the text automatically scrolls to the left so that the insertion point is always visible.

Moving the Insertion Point

As already mentioned, the insertion point appears in the upper left corner of the window when AIM-Spice is finished loading. You can move the insertion point anywhere you want to insert or edit text by moving the mouse cursor to the point where you want to place the insertion point and click the mouse button.

To move the insertion point with the keyboard, use the following keys or key combinations:

To move the insertion point:	Press:
to the right in a line of text	Right arrow key
to the left in a line of text	Left arrow key
up in a body of text	Up arrow key
down in a body of text	Down arrow key
to the beginning of a line of text	Home
to the end of a line of text	End
to the beginning of the circuit description	Ctrl+Home
to the end of the circuit description	Ctrl+End
Formatting Text

The keys in the table below gives you the necessary operations to type in the text exactly as you want it.

To:	Press:
insert a space	Spacebar
delete a character to the left	Backspace
delete a character to the right	Del
end a line	Enter
indent a line	Tab
insert a tab stop	Tab
To split a line, move the insertion point to the position where you want the break, and press Enter.

To join two lines, move the insertion point to the beginning of the line you want to move, and press Backspace. The editor joins the line with the line above.

Scrolling

If the circuit description is longer or wider that can be shown at one time, you can scroll through the circuit description.

Editing Text

You edit text using commands from the Edit-menu. You can delete text, move or copy text to new locations. If you change your mind after editing the text, you can use the Undo command to cancel your last edit.

Transferring text to and from other applications can be done via the clipboard. When you delete or copy text with the commands Cut or Copy, the text is placed in the Clipboard. The Paste command copies text from the Clipboard to the editor.

Selecting Text

Before you use a command from the Edit-menu to edit text, you must first select the text you want the command to operate on.

Selecting text with the keyboard:

1)	Use the arrow keys to move the insertion point to the beginning of the text you want to select.

2)	Press and hold the Shift-key while moving the insertion point to the end of the text you want to select. Release the Shift-key.

To cancel the selection, press one of the arrow keys.

Selecting text with the mouse:

1)	Move the mouse cursor to the beginning of the text you want to select.

2)	Drag the cursor to the end of the text you want to select. Release the mouse button.

3)	To cancel the selection, press the mouse button.

Replacing Text

When you have selected the text you want to change, you can immediately replace it by typing new text. The selected text is deleted when you type the first new character.

Replacing text:

1)	Select the text you want to replace.

2)	Type the new text.

Cutting Text

1)	Select the text you want to delete.

2)	Choose Edit Cut or click the following toolbar button:

The selected text is removed from the editor and copied to the clipboard.

Deleting Text

1)	Select the text you want to delete.

2)	Choose Edit Delete.

To restore deleted text, choose Edit Undo immediately after deleting the text.

Moving Text

You can move text from one location in the editor by first copy the text to the Clipboard with the Cut command, and then pasting it to its new location using the Paste command.

To move text:

1)	Select the text you want to move.

2)	Choose Edit Cut or click the following toolbar button:

The text is placed in the Clipboard.

3)	Move the insertion point to the new location.

4)	Choose Edit Paste or click the following toolbar button:

Copying Text

If you want to use a text more than once, you don't need to type it over each time. You can copy the text to the Clipboard with Copy, and then you can paste the text in as many places as you want by using the Paste command.

To copy text:

1)	Select the text you want to copy.

2)	Choose Edit Copy or click the following toolbar button:

The text is placed in the Clipboard.

3)	Move the insertion point to the location where you want to place the text.

4)	Choose Edit Paste or click the following toolbar button:

Undoing an Edit

The Undo command can be used to cancel the last edit you made. For example, you may have deleted text you wanted to keep, or you have copied text to a wrong location. If you choose the Undo command immediately after you did the mistake, the text will be restored to the way it was before you made the mistake.

To undo the last edit:

Choose Edit Undo.


Working with AIM-Spice Circuit Files

In AIM-Spice, a circuit is defined in terms of three main parts: the circuit description which is placed in the text editor in a document window (also called a circuit window), analysis parameters and options, and information about the last run on the circuit. These pieces of information are stored in a text file with a special formatthe so-called circuit file. To work with circuit files, use commands in the File-menu. These commands are used to create, open, and save circuit files in the AIM-Spice format.

Opening Circuit Files

You can open new or existing circuit files in AIM-Spice. Theoretically, there is no limit to how many circuit files you can have open at one time. A new circuit window is created for every circuit file you open and the circuit description is placed in that window.

When you want to close a circuit window after having made changes to the circuit description or to other circuit information since opening the file, AIM-Spice will ask if you want to save the changes. Use the following table to determine your response:

To:	Choose:
save changes	Yes
discard changes	No
continue working in the current file	Cancel
Creating a new Circuit File

Choose File New.

A new circuit window is opened.

Opening an Existing Circuit File

Only files saved in the AIM-Spice format can be opened directly (it is possible to open standard text files. This is described in Section 5.5). The default extension for these files are CIR. You open an existing AIM-Spice circuit file with the following procedure:

1)	Choose File Open or click the following toolbar button:

The dialog box shown below is displayed.

2)	Select the name of the file you want to open.

3)	Choose OK.

When you use the mouse, you can open the file in one operation.

Double-click the filename of the file you want to open.

Viewing a Circuit File in Another Directory

The list box with files only lists files with the extension CIR in the current drive and directory. It is possible to list other files as well.

To list other files:

1)	Select the drive, directory or the group of files you want in the list box named Directories, or type this information in the text box at the top of the dialog box. For example, you can type *.CKT to see a list of all files with that extension.

2)	Choose OK.

The list box to the left lists the files in the drive, directory or group of files you specified.

Opening Existing Standard Text Files

It is possible to open standard text files. When you specify such files in the File Open dialog box and choose OK, a message box is displayed that warns you that the file you want to open is not an AIM-Spice circuit file. You can choose to cancel the operation or continue opening the file.

A standard text file is displayed in the same way as circuit files, but you have lost the benefits of the integrated environment. When you now look at the menus, you see that most of the commands are dimmed. All the menu items in the Options menu are dimmed, and only one command in the Analysis menu is availablethe Run Standard Spice File command. This command runs the first analysis control line listed in the standard text file.

Importing Files

Another way of loading standard text files is to use the Import command in the File menu. This command converts a standard text file to the AIM-Spice circuit file format. .OPTIONS control lines and analysis control lines are converted to the format used by AIM-Spice.

After converting the file, trace through the circuit description and check if any lines need manual converting. If you try to simulate a circuit with illegal lines in the circuit description, AIM-Spice will remove these lines.

Saving a Circuit File

When you create a file or you want to take a break, you can save the file and return to it later. Two commands are available for saving a file: Save As and Save.

Saving a New Circuit File

Use Save As when you want to give a name to the new file. You can also use Save As when you want to save an old file under a new name.

To save a new file:

1)	Select the circuit window you want to save.

2)	Choose File Save As.

AIM-Spice displays the dialog box below.

3)	Type the name that you want to give to the file in the text box.

If you don't give an extension, AIM-Spice will give it the extension CIR.

4)	Choose OK.

AIM-Spice saves the file on your disk.

The circuit window will remain on the screen allowing you to continue working with it. The name that you gave the circuit file now appears in the title bar of that window.

Saving Changes

You can use the Save command when you want to save changes to a circuit you currently are working with and you want to retain the present file name.

To save changes:

Choose File Save or click the following toolbar button:

The file on your disk or diskette is replaced with the current version of the circuit.


Circuit Description in AIM-Spice

Above, we discussed how to work with the editor in AIM-Spice and how to manage circuit files. We are now ready to learn how to define circuits and how to prepare a circuit description. In this Chapter, we show how to prepare a circuit description using a differential pair circuit as an example.

Regarding general syntax rules for circuit descriptions, we note the following :

The first line (only) is the title line, and can contain any text.

Comment lines are marked by a '*' in the first column, and can contain any text.

Except for the title line and subcircuit definitions, the ordering of the lines is arbitrary.

AIM-Spice does not distinguish between upper and lower case letters.

The number of blanks are not significant except in the title line. Commas, parentheses and tabs are equivalent to blanks.

A Circuit Example

The sample circuit is shown below. Our first task is to give name to the nodes. A node name can be any text string, except that the ground node which must have the name "0". The most common way to name nodes is to give them numbers like we have done in the figure below.

The first line in the editor is taken as the title of the circuit, and the description of the circuit starts at line 2. The elements in the circuit are also named, and the first letter of the name is unique for that device type. For example, the names of resistors must start with the letter "R", voltage sources with "V", bipolar transistors with "Q" etc. The subsequent letters in the name can be any alphanumeric string. The circuit nodes to which the device is connected follows immediately after the device name. The last field of the device description is the values of the parameters that determine the electrical characteristics of the device. If you want to continue a device description on a new line, place a '+' in column 1 of the new line.

The complete circuit description for our example circuit is shown below together with comments on some of the lines.

DIFFPAIR CKT - SIMPLE DIFFERENTIAL PAIR

VIN 1 0 SIN(0 0.1 5MEG 5NS) AC 1

VCC 8 0 12

VEE 9 0 -12

Q1 4 2 6 QNL

Q2 5 3 6 QNL

RS1 1 2 1K

RS2 3 0 1K

RC1 4 8 10K

RC2 5 8 10K

Q3 6 7 9 QNL

Q4 7 7 9 QNL

RBIAS 7 8 20K

.MODEL QNL NPN(BF=80 RB=100 CCS=2PF TF=0.3NS TR=6NS

+ CJE=3PF CJC=2PF VA=50)

In line 2 we have a voltage source with the name VIN. This source is specified with two values. The first, SIN(0 0.1 5MEG 5NS) is used during a transient analysis. The voltage source is specified with the predefined function SIN: VIN is sinusoidal with 0 volt offset, 0.1 volt amplitude and a frequency of 5MHz delayed 5ns. The second value is used during an ac analysis. AC 1 means that the source will have an amplitude of 1 V during an ac analysis.

Line 5, 6, 11 and 12 describe bipolar transistors. The last field on these lines is QNL. This is a device model specification. Bipolar transistors, like other semiconductor devices is described in terms of specific models and associated set of model parameters. To find the parameter values of the model QNL, we have to search for the line that starts with .MODEL, which in our case is line 14. Once the model QNL is defined, it can be used on several devices. In our circuit this model is used on all bipolar transistors.

In the remainder of this topic, we discuss the different elements making up a complete circuit.

Names

The definition in Line 7 starting with RC1 defines the resistor RC1 in the circuit example above. The first field in the lineRC1is the name of the resistor.  Names must start with a letter that signifies the type of circuit element being considered.  The rest of the name can be any string of alphanumeric characters.

Nodes

In line 7, the two items following the name4 and 8are the nodes to which the resistor RC1 is connected. Node names are not limited to integers, but can be any alphanumeric text string. There is one exception, the ground node must have the name 0. Nodes are not treated as integers, but as text strings. Therefore 000 and 0 are different names.

Values

The last item on line 710Kis the resistor value. Numerical values are written in standard floating-point notation, with optional scale suffixes. Here are some examples of legal values.

1.0	1.	1	0.5	.5	-1.0	1E6	1.6e-9

The scale suffixes follows the normal scientific notation, i.e.,

F	=	1E-15

P	=	1E-12

N	=	1E-9

U	=	1E-6

MIL	=	25.4E-6

M	=	1E-3

K	=	1E3

MEG	=	1E6

G	=	1E9

T	=	1E12

Units are allowed, but are ignored by AIM-Spice. All characters that are not scale suffixes can be used as units.

Circuit Elements or Devices

Each circuit element or device in the circuit is represented by a line not beginning with a period. All such lines have the same format:

The name of the device, followed by

two or more nodes, followed by

a model name (not all devices have this), followed by

one or more parameters

All lines that do not start with a period, except for the title line, represent circuit elements or devices.

The first letter in a device name specifies the device type. Names of resistors must start with an "R", capacitors with a "C", diodes with a "D", bipolar transistors with a "Q", etc. The device type specification determines the meaning of the information in rest of the line: how many nodes, if a model name is required, and which parameters are to be specified at the end of the line.

Some of the devices allow or require a model name. A model gives you the option to define model parameters once, and then use that set of parameters for as many devices as you want. For example, all the transistors in our circuit example have the same parameter beta, (β = 80). All refer to the same model, QNL, which defines β in terms of BF=80.

The ordering of the device lines is not significant. How they are connected is determined by the nodes. All device terminals with the same node name are connected to each other.

The rest of this topic presents an overview of the device types available in AIM-Spice. A complete description of the devices is found in the AIM-Spice online Reference.

Passive Devices

The passive devices available in AIM-Spice are: resistors, inductors, capacitors, transformers, and transmission lines. They are all linear.

Resistors and capacitors can have model names, but this is not required.

Semiconductor Devices

The semiconductor devices available in AIM-Spice are semiconductor resistors, semiconductor capacitors, RC transmission lines, p-n diodes, Schottky diodes, heterostructure diodes, silicon bipolar transistors, Junction Field Effect Transistors (JFETs), Metal Oxide Semiconductor Field Effect Transistors (MOSFETs), compound semiconductor Metal Semiconductor Field Effect Transistors (MESFETs), Heterostructure Field Effect Transistors (HFETs), amorphous silicon Thin Film Transistors (a-Si TFTs), poly-silicon Thin Film Transistors (poly-Si TFTs), and Heterostructure Bipolar Transistors (HBTs). All these devices require models, many of which are discussed in this book. Additional information, such as device geometry, can be specified.

Voltage and Current Sources

These devices are the only sources generating power. There are two types of sources: controlled and independent.

Controlled Sources

All combinations of controlled sources are available in AIM-Spice: current controlled voltage source, current controlled current source, voltage controlled voltage source, and voltage controlled current source. They perform the following functions:

v = h · i	i = f · i	v = e · v	i = g · v

where the constants e, g, h and f represent voltage gain, transconductance, current gain and transresistance, respectively.

Independent Sources

Independent sources can have different values for different types of analysis. One value can be specified for a Transient Analysis, another for an AC Analysis and so on. A value for a DC Analysis must be prefixed by the keyword DC, the keyword for an AC Analysis is AC. For a Transient Analysis, use one of the following keywords: EXP, PULSE, PWL, SFFM, or SIN.

The voltage sources VIN, VCC and VEE are used in the circuit example shown in Fig. Error! Bookmark not defined.. From the netlist, we infer that VCC and VEE have only dc values. In our case, VIN does not have a specified dc value. It will be swept over a voltage range during a DC Analysis. On the other hand, this source is specified for both an AC Analysis (amplitude 1 V and phase 0 degrees) and a Transient Analysis (sinusoidal with 0 volt offset, 0.1 volt amplitude and a frequency of 5MHz delayed 5ns). VCC and VEE will be assigned a value of 0 V during an AC Analysis and with their specified dc values during a Transient Analysis or DC Analysis.

The following rules apply when specifying independent sources:

Power supplies, such as VCC and VEE, can be specified without using the keyword DC.

The inputs to the circuit, such as VIN, may contain, for example, input waveforms and clocks. AC values are given for computing frequency response.

For a voltage source without specified values for a given analysis, the values will be set to zero and the circuit response will not be affected.  However, the current through such a source can be monitored, allowing the source to be used as a current meter.

Switches

Switches allow us to change circuit connections during an analysis. They can be either voltage or current controlled. Switches requires model names, SW for voltage controlled switches and CSW for current controlled switches.

Models

Many of the device types use model statements for specifying the parameters used in describing the device. The .MODEL statement has the following form:

.MODEL NAME TYPE (PARAMETER=VALUE PARAMETER=VALUE ....)

The model statement in the example circuit is common for all the transistors in the circuit.

The AIM-Spice Reference Manual provides a complete list of all models used by AIM-Spice. Each model has its own set of parameters. Since default values are assigned to all parameters, specification of one or more parameter values can be omitted (this is not true for the BSIM models. For these models you have to give explicit values for all model parameters). For example, if only default values are used for a bipolar junction transistor, the model description becomes:

.MODEL QNL NPN

Subcircuits

When a circuit contains many identical blocks or subcircuits, it is convenient to be able to write a block once and then reference it when needed. You can define a subcircuit as a "super" device and reference it many times without retyping the block. Logical elements, for example, are prime candidates for subcircuit specifications.

A subcircuit is defined in terms of a block of lines that start with the line .SUBCKT and ends with the line .ENDS. Between these lines, there are one or more devices, models, calls to other subcircuits, and even new subcircuit definitions. When a subcircuit has been defined, it can be referenced as a device with a name that starts with the letter X.

Nodes can be defined as terminals for a subcircuit, making it possible to connect the subcircuit to the rest of the circuit. Node names used in subcircuit definitions are local names, and they will not come in conflict with global node names in the main circuit. The following is an example of a CMOS inverter subcircuit:

.SUBCKT INV 1 2 3

M1  3 2 1 1 MOSP W=24U L=1.4U

M2  3 2 0 0 MOSN W=12U L=1.0U

.ENDS


Circuit Analysis with AIM-Spice

AIM-Spice supports seven different types of circuit analysis.  These are:

1)	Operating Point analysis.

2)	DC transfer curve analysis. (A voltage or current source is swept over a user defined interval.)

3)	AC small signal analysis. (Calculates frequency responses.)

4)	Transient analysis. (Calculates the time domain response.)

5)	Pole-Zero analysis. (Locates poles and zeros in the small signal transfer function.)

6)	Transfer Function Analysis. (Calculates the DC small signal transfer function, input resistance and output resistance.)

7)	Noise Analysis. (Analysis of the device-generated noise in the circuit.)

All analyses are available as commands from the Analysis menu. All analysis commands, except for the DC Operating Point Analysis, require additional control parameters to be specified. However, before choosing one of the commands in the Analysis menu, you should decide which circuit to analyze and make the corresponding circuit window the active window.

When choosing one of the commands from the Analysis menu, a dialog box appears. You specify the control parameters in the dialog box before starting the simulation. All dialog boxes have one command button labeled Run. You choose this button to initiate a simulation. The dialog box for the Transient Analysis is shown below.

The dialog boxes contain three command buttons: Cancel, Save, and Run. After completing the parameter fields, you can choose among these command buttons. If you choose Cancel, the parameters entered will be discarded. If you choose Save, the parameters will be stored together with the rest of the circuit information. Run performs the same operation as Save and, in addition, initiates the analysis.

We will now discuss the control parameters for the different types of analyses available in AIM-Spice.

Operating Point

This analysis calculates the dc operating point. No control parameters are required.

DC Transfer Curve

In this analysis, one or two sources (voltage or current sources) are swept over a user defined interval. The dc operating point of the circuit is calculated for each value of the source(s). The DC Transfer Curve Analysis is useful for finding the logic swing of logic gates and the I-V characteristics of a transistor, for example. The dialog box for the DC Transfer Analysis is shown above.

The first parameter in a dc analysis is the sweep variable(s). To specify a sweep source, open the drop down list box next to the source name field to see a list of all sources in the circuit and select one of them, or type a source name directly in the edit box. If you specify two sources, the first one will be in the inner loop, i.e., it varies faster than the other. The other parameters are the start, end and increment values for the source (s).

For example, if we want to find the I-V characteristics of a MOSFET, we can use the parameter values shown in the dialog box above. The drain-source voltage source, vds, is in the inner loop and sweeps from 0 to 5 V every time the gate-source voltage, vgs, changes value (the start, stop and increment values of vgs are specified by selecting the 2. Source button in the dialog box).

AC Small Signal Analysis

This analysis calculates the frequency response of the circuit by linearizing the circuit equations around the operating point.

The dialog box for the AC Small Signal Analysis is shown above. The first parameter determines the number of frequencies at which the analysis is performed. The option buttons in the dialog box determine the distribution of the frequencies. If you choose LIN, the number you specify will be the total number of frequencies. If you choose OCT, the value corresponds to the number of frequencies per octave, and if you choose DEC, the value gives the number of frequencies per decade.

The selection shown in the dialog box specifies that the analysis starts at 1 Hz and ends at 10GHz, and that the response is calculated at 200 frequencies per decade.

Transient Analysis

The time domain response of the circuit is calculated from time t = 0 to a user defined upper time limit. The dialog box above specifies a Transient Analysis which ends at 200 ns with a suggested stepsize of 2 ns.

This analysis also has two optional parametersthe display start time and the maximum stepsize. The first optional parameters specifies that the generation of output starts at a time value different from zero, and the second sets an upper bound on the time steps used by AIM-Spice.

Just as for the AC Small Signal Analysis, source values are taken from the device lines in the circuit description. In our example circuit the voltage source VIN is specified with a sinusoidal value during a Transient Analysis.

Pole-Zero Analysis

AIM-Spice is able to locate poles and zeros in the small signal ac transfer function. First the dc operating point is calculated, and then the circuit is linearized around the bias point. The resulting circuit is used for locating poles and zeros.

The dialog box for the Pole-Zero Analysis is shown above. In this dialog box, you specify which type of transfer function you want, if you want to locate both poles and zeros or only one type, and the nodes defining the input and output of the circuit.

The Pole-Zero analysis can be performed on circuits containing all types of devices except transmission lines.

Transfer Function Analysis

The dialog box for the Transfer Function Analysis is shown above. This analysis computes the dc small signal value of the transfer function, the input resistance, and the output resistance. In the example in the dialog box, AIM-Spice would compute the ratio V(8)/vin, the small signal resistance at vin, and the small signal output resistance measured across the nodes 8 and 0.

Noise Analysis

The noise analysis computes device-generated noise for the given circuit. When provided with an input source and an output port, the analysis calculates the noise contributions of each device (and each noise generator within the device) to the output port voltage. It also calculates the input noise to the circuit, equivalent to the output noise referred to the specific input source. This is done for every frequency point in a specified range. The calculated value of the noise corresponds to the spectral density of the circuit variable viewed as a stationary gaussian process. After calculating the spectral densities, noise analysis integrates these values over the specified frequency range to arrive at the total noise voltage/current (over this frequency range). This calculated value corresponds to the variance of the circuit variable viewed as a stationary gaussian process.

The format of the parameter "Output Noise Variable" is V(OUTPUT<,REF>), where OUTPUT is the node at which the total output noise is sought. The parameter "Input Source" is an independent source to which input noise is referred. The next three parameters contain information relating to frequency, identical to those of the AC analysis.  The last parameter is an optional integer.  If specified, the noise contribution of each noise generator is produced at every "Points per Summary" frequency point.


Setting Initial Conditions

Initial conditions are currents and/or voltages specified to help locating the bias point of a circuit, or to force the bias point to satisfy one or more conditions. One reason for giving AIM-Spice initial conditions is to select one out of two or more stable states such as, for example, in bistable circuits.

There are three different ways of specifying initial conditions: the .IC statement, the .NODESET statement, and the IC= specification on individual device lines. All these statements are specified in the editor together with the netlist.

.IC

This control statement is used to specify initial values for a Transient Analysis. This statement can be interpreted in two ways, depending on whether the UIC option is selected (see Transient Analysis). If UIC is selected, the node voltages in the .IC statement will be used to compute initial voltages for capacitors, diodes and transistors. This is equivalent to specifying IC= for each element, but is much more convenient. IC= can still be specified and will override the .IC values. However, AIM-Spice will not perform any operating point analysis when this statement is used. Hence, the statement should be used with care.

AIM-Spice will perform an operating point analysis before the transient analysis if UIC is not specified. Then the .IC statement has no effect.

.NODESET

This control statement helps AIM-Spice locating the dc operating point. Specified node voltages are used as a first guess for the dc operating point. This statement can be useful with bistable circuits. However, normally it is not needed.

.NODESET is active during all bias point calculations, not only in a transient analysis. .IC has higher priority than .NODESET for a transient analysis.

IC=

Using this statement, capacitors, inductors, transmission lines, diodes, and transistors can be given initial voltage (e.g., capacitors) or current (e.g., inductors) values on the device line. The UIC option must be active in the Transient Analysis dialog box in order to use these initial values. AIM-Spice will skip the calculation of the bias point and go directly to the Transient Analysis when the UIC option is active. All devices without assigned  IC=  value are assumed to have a zero initial value.


Options

A set of options that control different aspects of a simulation is available from the Options menu. These are divided among the following four logical groups corresponding to the dialog boxes shown below:

General

Analysis specific

Device specific

Numeric specific

Each circuit has its own set of options, and before you reset any of them, decide which circuit you want to work with, and make the corresponding circuit window the active window.

To reset one of the options, you choose commands from the Options menu. All options in a group are listed in a dialog box together with their default values.


Interactive Simulation Control

During a simulation, different commands can be executed depending on the type of analysis being performed. DC Operating Point, Pole-Zero, and Transfer Function Analysis generate so called one-vector-plots, i.e. they produce only one data point. Therefore, these analyses are executed immediately after you choose the Run command in the dialog box, and the results are presented after the simulation is completed. The results are presented in a table for DC Operating Point and Transfer Function Analysis, and in a graph for Pole-Zero Analysis. The other analysis types produce output during the simulation and you have to select which variables to monitor before you start the simulation. The following sections explain the procedures for the different analyses.

DC Operating Point

As mentioned, the DC Operating Point Analysis produces a so-called one-vector plot. The results are presented in a table as soon as the simulation is completed.

You can also run a DC Operating Point analysis by clicking the following toolbar button:

Pole-Zero Analysis

Like the Operating Point Analysis, the Pole-Zero Analysis produces a one-vector plot. But unlike the Operating Point Analysis, this analysis presents its results in a graph.

You can also run a Pole-Zero analysis by clicking the following toolbar button:

Transfer Function Analysis

This analysis also produces a one-vector plot, and the results are presented in a table.

You can also run a Transfer Function analysis by clicking the following toolbar button:

Noise Analysis

The noise analysis produces both one-vector plots, and multi-vector plots. We have chosen to use the same interface as for the analysis types listed above. The results are presented after the simulation is completed and only one-vector plots are displayed. To display the other plots, use AIM-Postprocessor.

You can also run a Noise analysis by clicking the following toolbar button:

AC, DC Sweep, Transient, and Distortion Analysis

AIM-Spice changes mode when you choose the Run command from one of the analysis dialog boxes. The menus listed in the menu bar will change and the status bar will give you information about what happens at any time.

When the application changes to analysis mode, the circuit description, together with options and analysis parameters, are loaded into the AIM-Spice kernel. While reading the circuit into the kernel, the status bar will show the text "Parsing circuit, Please wait ...". After the input and error checking operation is done, the status bar shows which analysis is selected.

The simulation can only begin after you have specified which circuit variables to plot. All commands needed to do the preliminary work before starting a simulation, are located in the Control menu. This menu is shown below.

Selection of Variables to Plot

In AIM-Spice you can open as many plot windows as you like. A plot window contains one or more circuit variables that will be plotted graphically during a simulation. To open a new plot window, choose the command Select Variables to Plot from the Control menu. This command displays the dialog box below.

This dialog box is divided into two main areas. To the left is a list of all the variables in the circuit. The first element in this list is always the independent variable. The dialog box above corresponds to an AC Analysis of our example circuit. In an AC Analysis, frequency is the independent variable. The node voltages in the circuit are listed after the independent variable. You can plot several variables in the same window by selecting more than one variable from the list.

If it is too cumbersome to scroll through the list of variables, you can use the speed search feature. Start entering the name of the variable you want to select in the speed search field and the variable is automatically scrolled into view.

The area to the right is active only for AC Analysis, in which case you can choose either to plot the amplitude value or the phase value. If you choose to plot the amplitude, you can select a dB-scale. This area is dimmed if other types of analyses are selected.

After having specified which variables to plot in a given plot window, you have to choose y-axis limits for the windows. AIM-Spice has no way of guessing limits for the plots. The plot limits can be specified by selecting the button called Y Axis Format, in which case the dialog box shown below appears. You have to specify lower and upper limits and increments for the vertical axis (y-axis) of the plots. It is wise to specify large intervals as a first guess. As the simulation progresses, the plot traces will appear on the screen, and you can reset the limits manually or by the Auto Scale command in the Format menu (Alt+U).

Complete the Y Axis Format dialog box and choose OK to return to the Select Variables To Plot dialog box. Choose OK again and a new plot window is opened. The title bar of the new window indicates which variables will be plotted in that window. To open more plot windows, choose Select Variables to Plot again.

It is not possible to use the command Select Variables to Plot to add more variables when the simulation is running, or after the simulation is completed. As soon as you start the simulation, this command is disabled.

To study your simulation results more carefully after the simulation is completed, save the results to a file and use AIM-Postprocessor. We have chosen this approach because we wanted the graphical operations in the simulator to be as fast as possible and to relax the functionality requirements.

Selection of Variables to Save

The command Select Variables to Save is handy when you are simulating large circuits containing hundreds of nodes. The default is to save every circuit variable for the entire simulation. In some cases, this produces large amounts of data. However, this command lets you specify which variables you are interested in and want to save. Specifying a small number of variables to save reduces both the simulation time and the size of the output file.

The command displays the dialog box below. It contains a list of all circuit variables together with the two useful command buttons labeled Select All and Clear All.

Here you have the option of going through the list and selecting the variables you wish to save. To select all variables in the list, choose the command button labeled Select All. To deselect all variables in the list, choose the command button labeled Clear All. Note that the independent variable (always the first variable in the list) is always saved, regardless of whether you select it or not.

Formatting Axes and Labels

When AIM-Spice creates new graph windows, it uses default axis and label formats. To change the format, use commands from the Format menu. You can use these commands as long as you are in the analysis mode. To format, for example, the x-axis of a graph, first activate the corresponding plot window and then choose the X-Axis command. If you have a mouse, you may also double click the x-axis to change its format. You can change the following properties of an axis:

Axis Type (linear or logarithmic).

Base (when you select logarithmic axis, you have to choose which base number to use, 8 or 10).

Minimum value

Maximum value

Increment value (distance between axis labels).

Minor tics (number of tic marks between labels).

Grid lines (you specify line styles for grid lines drawn on major and minor tic marks and you may turn grid on or off).

To format a label, use commands from the Format menu, or double click a label. You can change the following properties of labels:

Notation (select among three numeric formats in the label: AIM-Spice scale factors, decimal or scientific).

Number of decimal digits used in the numeric format.

Arranging Plot Windows

Commands for arranging the plot windows inside the main window are located in the Windows menu (see the menu bar in the main window). When you choose Cascade Windows, the plot windows will be arranged in a stack. To place a given plot window at the top of the stack, choose the title of that window from the Window menu. Choose Tile Windows Vertical to arrange all the windows side by side or Tile Windows Horizontal to arrange all the windows vertically.

The plot windows can also be moved and resized with the mouse or with keyboard commands from the system menu.

Starting a Simulation

To start a simulation, choose the command Start Simulation from the Control menu of the main window. This command is dimmed until you have opened at least one plot window. Once the simulation is launched, AIM-Spice plots the selected variables in the plot windows as soon as they are available from the simulator.

You can also start a simulation by clicking the following toolbar button:

Stopping a Simulation

The instantaneous simulation results in the plot windows may tell you that something needs to be altered in your circuit description or in the parameter settings. Then you may open the Control menu and stop the simulation at any time. With a simulation in progress, the Control menu is slightly altered from that shown abovethe command Start Simulation is replaced by Stop Simulation, and all other commands are dimmed and not available.

You can also stop a simulation by clicking the following toolbar button:

Resetting the Plot Limits during a Simulation

If during a simulation you realize that the axis limits specified are unsuitable, they can be reset at any time without having to stop the simulation. The simplest procedure is to select Auto Scale from the Format menu (Alt+U). Alternatively, use either the other commands available in the Format menu, the Zoom command from the View menu, or double-click on the appropriate axis and complete the dialog box.

To make the Zoom command active, choose the command once. A check mark appears next to the command name. Now you can use the mouse to reset limits. Place the mouse cursor in the upper left corner of the new viewing rectangle. Then press and hold the right mouse button while you drag the mouse cursor to the lower right hand corner of the new viewing rectangle. Release the mouse button and AIM-Spice will redraw your plot with the new viewing rectangle. When you choose the Zoom command once more, you deactivate the command, and the graph is redrawn with the original axis limits.

Saving Results after Completing a Simulation

AIM-Spice indicates that a simulation is completed by displaying "Simulation Done" in the status bar. When a simulation is over, you can save the results in a file by choosing the Save Plots command from the File menu.

This command displays the dialog box shown below. This dialog box displays a list with plots accumulated since last time you saved plots. If you want to save all the plots in the list, choose the command Save All Plots. If you want to save only a selection of the listed plots, select the plots you want to save, and then choose the command Save Selected Plots. If you are not interested in any of the plots, choose the command Destroy All Plots. When one of the commands Save All Plots or Save Selected Plots is selected, a Save As dialog box is displayed. Complete the entries in the dialog box, and choose OK.

Tip: If you want to compare results from different simulations in AIM-Postprocessor, run all the simulations before you save the results. That way you can collect the results from all simulations in a single output file. When you load this output file into the postprocessor, you are able to plot variables from different simulations in the same graph.

You can also save the plots by clicking the following toolbar button:

Exiting after Completing a Simulation

To leave the analysis mode, choose the command Exit Analysis Mode from the Control menu. The menu bar changes back to the original menu and the circuit description reappears in the main window. To exit from AIM-Spice, choose the command Exit from the File menu.

You can also leave analysis mode by clicking the following toolbar button:

Simulation Shortcuts

After you have simulated a circuit for the first time, all the settings are saved.  If you decide to simulate the circuit again using the same settings, you can run the simulation without going through all the steps described in the previous sections.  If you click one of the toolbar buttons listed below, you run the corresponding analysis immediately using the current settings.

  AC Analysis	  DC Analysis	  Transient Analysis

Error Reporting

Error messages are written to an error file as soon as they are detected. When an error occurs, AIM-Spice interrupts the simulation and displays the message box shown below.

If you choose the button labeled Yes, AIM-Spice displays the contents of the error file in a popup window. This popup window is closed the same way as the main application window. The error window stays on top of all windows belonging to AIM-Spice.

To correct an error, you quit the analysis mode, return to the circuit window and make the necessary changes to the circuit with the error window visible. The error window automatically closes when you start another Run.