Manuals >Reference >SPICE Simulators
Print version of this Book (PDF file)
prevnext

Circuit Model Descriptions

The circuit description for the HSPICE and ELDO simulators is similar to the UCB SPICE simulator circuit description. The details in the following sections also apply to HSPICE and ELDO.

Specifying Simulator Options

For information on available options and their syntax, refer to the User's Manual for that simulator. Simulator options are specified in the first line of the circuit definition using the following syntax:

 .OPTIONS OPT1 = OPTVAL1 OPT2 = OPTVAL2 ... OPTN = OPTVALN 

where

OPTs denote the option keywords used by the simulator

OPTVALs are the corresponding option values. Some options do not require a value; this field may or may not be specified, depending on the option.

A space is the only delimiter required between options.

The nominal and operating temperatures, TNOM and TEMP, are commonly used options; they can also be specified by entering a value (in °C) for the global variables TNOM and TEMP. To do this, enter the variable and its value in the System Variables table in the Utilities application.

    • TNOM is the temperature at which the model parameters are extracted; TEMP is the temperature at which the simulation is performed. When performing an optimization to extract model parameters, TEMP and TNOM should be set to the same value so that simulations during optimization are performed at TNOM. TNOM must be defined to guarantee consistency between simulation and extraction.
    • In general, TNOM and TEMP can be in any variable table, allowing different Models, DUTs or Setups to use different nominal and operating temperatures. IC-CAP checks for these global variables before running a simulation. If the variable is not found, the value of the option set in the .OPTIONS statement in the Circuit Editor is used when it exists. Otherwise, the circuit is analyzed using the simulator's default values.

IC-CAP automatically adds the option POST=1 to the options list when the selected simulator is hspice. Specifying this option causes hspice to return the binary raw data file, which IC-CAP requires for reading back the simulated data. This option is not necessary when performing a Manual Simulation from the Simulation Debugger command menu because the data is not read back into IC-CAP.

Describing the Device Model

A device model is used to characterize a single SPICE element of any type. This description requires 2 parts:

    • An element statement that calls a defined model
    • A .MODEL definition, which is identical to a .MODEL card in SPICE

The general form of the element statement that calls the device model is:

 DNAME NNUM1 = NNAME1 NNUM2 = NNAME2 ...NNUMN = NNAMEN MNAME
+ DPAR1 = DVAL1 DPAR2 = DVAL2 ...DPARN = DVALN

where

DNAME is the device name with the first letter being a simulator defined key letter denoting the type of model being specified.

NNUM denotes the node number connections.

NNAME denotes node names corresponding to the node numbers.

DPAR is a predefined DUT parameter name.

DVAL is the specified DUT parameter value. Refer to the SPICE Reference manual for DUT parameter names available for each model.

MNAME is the model name being referenced. This is the same MNAME specified in the .MODEL definition described below

A .MODEL definition specifies the parameters of a device model that describe a particular element. When a parameter is not specified, the default value in the model is used. The general form of the .MODEL definition is:

 .MODEL MNAME TYPE PNAME1=PVAL1 PNAME2=PVAL2 ...PNAMEN=PVALN 

where

MNAME is the model name. Regardless of the model name entered in the MNAME field of the .MODEL definition statement, IC-CAP substitutes the name of the Model as it is called in the Model List when the simulator input deck is built.

TYPE is a valid SPICE component type

PNAME is a parameter name for the particular model type

PVAL is the parameter value

As in SPICE, a plus sign ( + ) that appears as the first character of a line denotes a continuation of the previous line. This continuation character is often used for easier readability when specifying the .MODEL card.


Note


When using the SPECTRE simulator with either the OSI, SPECTRE442, or SPECTRE443 interfaces (see SPECTRE Interfaces), the LEVEL parameter for a MOS .MODEL card may not translate properly. IC-CAP outputs the value as a real number in the netlist, but SPECTRE requires an integer. To work around this issue, use the model type BSIM3 instead of MOS and omit the LEVEL parameter. Alternatively, enclose the LEVEL parameter with parentheses, for example, LEVEL = (11). By doing the later, IC-CAP does not flag it as a model parameter and leaves the expression alone when passing the netlist to SPECTRE.


Describing Subcircuits

A subcircuit model is used to describe a circuit that contains more than 1 element.

The syntax is similar to the syntax in SPICE. The subcircuit description must begin with a .SUBCKT and end with a .ENDS declaration. Statements between these 2 declarations describe the subcircuit components.

The general form of the first line of a subcircuit definition is:

 .SUBCKT SUBNAME NNUM1 = NNAME1 NNUM2 = NNAME2 ...NNUMN =
NNAMEN + (PAR1=PARVAL1 PAR2=PARVAL2 ...PARN=PARVALN)

where

SUBNAME is the name you give to the subcircuit. Regardless of the subcircuit name entered in the SUBNAME field of the .SUBCKT definition statement, IC-CAP substitutes the name of the Model being simulated when the simulator input deck is built.

NNUM are the numbers of the external nodes of the subcircuit. These external nodes are used to connect the subcircuit to another circuit. External nodes in the .SUBCKT declaration cannot be 0 (ground), but internal nodes can be connected to ground and any external node to ground in a surrounding circuit.

NNAME is a node name assigned to a node number. As in the device model description, IC-CAP allows the option of equating node numbers to node names. If you assign node names, use these names when specifying the Inputs and Outputs in the Setup.

PAR1 ... PARN are subcircuit parameters that can be passed through subcircuit calls. These parameters are added to the DUT parameter table in IC-CAP.

PARVAL1 ... PARVALN are the corresponding parameter values. These subcircuit parameters become DUT parameters and can be modified in the DUT Parameter Editor.

(While the syntax shown here is correct, passed parameters are ignored by IC-CAP.)

The body of the subcircuit model description contains the components of the subcircuit using element and .MODEL statements.

Assigning Node Names

IC-CAP allows the option of equating node numbers to node names in circuit descriptions because it is typically easier to refer to a node by a meaningful name rather than a number. If node numbers only are specified, these node numbers must be used when specifying inputs and outputs. Node identities can also be specified with the format %<name>. For example:

 Q1 1=C 2=B 3=E 4=S NPN or Q1 %C %B %E %S NPN

Although HSPICE and ELDO allow alphanumeric characters for node names, node numbers must still be associated with node names because IC-CAP parses HSPICE as a SPICE-type simulator.

When using this format, all node names within the circuit or device must be referenced using the %[nodename] syntax.

Test Circuits and Hierarchical Simulation

When characterizing a circuit, it is often necessary to add circuitry around a circuit or device to model the actual measurement Setup. IC-CAP provides a Test Circuit Editor to allow modeling of this additional bias circuitry. Select the DUT from the DUT/Setup panel. Click the Test Circuit tab and enter the test circuit description in the same manner you would enter a Circuit Description. The test circuit definition should include a call to the device or subcircuit defined in the Circuit Editor, as well as the additional circuitry needed to model the external parasitics of the measurement Setup.


Note


When you define a test circuit, the DUT parameter table contains the values specified in the test circuit specification. Regardless of the subcircuit name entered in the SUBNAME field of the .SUBCKT declaration, IC-CAP uses the name of the DUT being simulated when the simulator input deck is built.


Subcircuit and device model specifications can be called from inside another Model. This enables you to perform hierarchical simulations to study a circuit at different levels.

When making reference to another model, the model name must be used as it appears in the IC-CAP Model List. For example, assume you have defined 3 Models, model1, model2, and model3. model1 has a circuit model description that is a device definition. The circuit model description for model2 is a subcircuit definition at the gate level that includes a call to model1 in a device call statement. And, the circuit model description for model3 is a subcircuit definition that includes a call to model2 in a subcircuit call statement. When you simulate a Setup in model3, IC-CAP traverses the Model hierarchy and uses the circuit model description defined in model3, which includes calls to model1 and model2. The syntax for calling a device model is identical to that described in the Device Model Description section.

The general form of the device call is:

 DNAME NNUM1 = NNAME1 NNUM2 = NNAME2 ...NNUMN = NNAMEN MNAME
+ DPAR1 = DVAL1 DPAR2 = DVAL2 ...DPARN = DVALN

Calling a subcircuit specification allows you to insert an entire subcircuit into a circuit as if it were a single component. The call requires a syntax identical to that used in SPICE. The general form of the subcircuit call is:

 XNAME NNUM1 NNUM2 ...NNUMN SUBNAME (PARVAL1 PARVAL2 ... PARVALN)

where

XNAME is the name of the subcircuit call statement. The only requirement for this name is that it must start with the letter X.

NNUM are the node numbers of the calling circuit that connect to the external nodes of the subcircuit. The calling circuit node numbers need not be the same as the external nodes of the subcircuit. The nodes are connected in the order specified. Specify the same number of nodes declared in the subcircuit definition.

SUBNAME is the name of the subcircuit, previously described by a .SUBCKT definition. This must have the name of the model as it appears in the Model List if it is in a different model.

PARVAL are subcircuit parameter values. The order in which they are listed in the subcircuit call statement must match the parameters list in the subcircuit definition.

(While the syntax shown here is correct, passed parameters are ignored by IC-CAP.)


Note


When a test circuit is included in the Model, IC-CAP uses the test circuit description as the top level circuit definition. The node number connections defined in the test circuit description, not the circuit description, are used as the external nodes. Because of this, any node-number-to-node-name cross-referencing in the circuit description is not used. Only node names equated to node numbers in the test circuit description can be used when specifying Inputs and Outputs in the Setup Editor. When only node numbers are specified in the test circuit description, (that is, they are not equated to node names) these same node numbers must be used in the Input and Output node fields.



prevnext