Support for PSpice Models in Altium Designer
The PSpice® simulation model format is the format of choice for many device manufacturers. Altium Designer's Mixed-Signal Circuit Simulator has strong support for PSpice models. The following sections provide summary information on:
- Changes made to existing Spice syntax to facilitate using expressions and global parameters to represent values in a PSpice-modeled circuit.
- Changes made to existing Spice3f5 devices in order to make them PSpice compatible.
Spice Syntax Changes
To facilitate compatibility with PSpice, changes have been made to the existing Spice syntax. These changes include support for additional PSpice-based functions and operators, as well as the addition of global parameters.
Function Support
The following additional functions are supported:
ARCTAN(x) | returns the inverse tangent of x |
ATAN2(y, x) | returns the inverse tangent of y/x |
IF(t, x, y) | If t is TRUE then x, ELSE y |
LIMIT(x, min, max) | while min < x < max, x is returned |
LOG10(x) | returns the decimal logarithm of x |
MAX(x, y) | returns the maximum of x and y |
MIN(x, y) | returns the minimum of x and y |
PWR(x, y) | returns x to the power of y |
PWRS(x, y) | returns signed x to the power of y: |
SCHEDULE(x1, y1,...xn, yn) | allows you to control the value of y based on time x. An entry for time = 0s must be entered. |
SGN(x) | returns the sign of x (a.k.a. the signum function). |
STP(x) | unit step function. |
TABLE(x, x1, y1,...xn, yn) | allows you to construct a look-up table, returning the y value corresponding to x when all xn, yn points are plotted and connected by straight lines. |
Additional Operator Support
The following additional operators are supported:
- *** (exponentiation)
- == (equality test)
- != (non-equality test)
- & (Boolean AND)
- | (Boolean OR)
In-Line Comment Support
The PSpice in-line comment character is supported. This character - a semicolon ; - is treated as the end of a line in the circuit description. Any text after this character (on the same line) is treated purely as a comment and therefore ignored by the Simulator, which moves on to the next line in the circuit description.
The following example shows a single in-line comment, where comment text is added to one line in the circuit description:
R2 2 4 6 ; R2 is a feedback resistor
If you want to add comment text over multiple lines (creating trailing in-line comments), simply use the semicolon inline comment character to mark the beginning of each subsequent comment line:
R2 2 4 6 ; R2 is a
;feedback resistor
An in-line comment can be used to replace a standard comment line, which must start with the * character in the first column of the line. This can improve the readability of your circuit description.
.PARAM Support
The PSpice .PARAM
statement is supported. This statement defines the value of a parameter, allowing you to use a parameter name in place of numeric values for a circuit description. Parameters can be constants, expressions or a combination of the two. A single parameter statement can include reference to one or more additional parameter statements.
In addition, the following three internal variables (predefined parameters) are available for use in expressions:
GMIN | shunt conductance for semiconductor p-n junctions. |
TEMP | temperature. |
VT | thermal voltage. |
Global Parameters
Altium Designer's Circuit Simulator supports the use of global parameters and equations. Use a global parameter in an equation and then use that equation in a component value on your schematic. Alternatively, define the equation as a global parameter and then reference the global parameter from a component value.
Simply include the expression or parameter name within curly braces {} - when the Simulator detects this it will attempt to evaluate it, checking the Global Parameters page of the Simulator's Analyses Setup dialog for the definition of any part of the expression that cannot be immediately resolved.
Spice Model Changes
To make the existing Spice3f5 device models compatible with PSpice, changes have been made to the general form for a device and/or additional parameter support has been added for use in a linked model file. The following sections summarize the changes that have been made.
- For additional detailed information on simulation models as well as simulation analyses, refer to the Mixed Simulation References. These references should be used in conjunction with this article in order to gather a complete listing of the supported parameters for each device model.
- For more detailed information concerning PSpice, consult the PSpice User's Guide and PSpice Reference respectively.
Capacitor
The Netlist Template Format for this device remains unchanged:
@DESIGNATOR %1 %2 &VALUE &MODEL ?LENGTH|L=@LENGTH| ?WIDTH|W=@WIDTH| ?"INITIAL VOLTAGE"|IC=@"INITIAL VOLTAGE"|
The following additional model parameters are supported and can be entered into a linked model file (*.mdl) for the device:
C | capacitance multiplier. (Default = 1). |
TC1 | linear temperature coefficient (in ˚C-1). (Default = 0). |
TC2 | quadratic temperature coefficient (in ˚C-2). (Default = 0). |
VC1 | linear voltage coefficient (in Volt-1). (Default = 0). |
VC2 | quadratic voltage coefficient (in Volt-2). (Default = 0). |
Where a parameter has an indicated default, that default will be used if no value is specifically entered.
The format for the PSpice model file is:
.MODEL ModelName CAP(Model Parameters),
where:
ModelName
is the name of the model, the link to which is specified on the General tab of the Sim Model dialog. This name is used in the netlist (&MODEL
) to reference the required model in the linked model file.-
Model Parameters are a list of supported parameters for the model, entered with values as required.
Diode
The Netlist Template Format for this device remains unchanged:
@DESIGNATOR %1 %2 @MODEL &"AREA FACTOR" &"STARTING CONDITION" ?"INITIAL VOLTAGE"|IC=@"INITIAL VOLTAGE"| ?TEMPERATURE|TEMP=@TEMPERATURE|
The following additional model parameters are supported and can be entered into a linked model file (*.mdl) for the device:
IBVL | low-level reverse breakdown knee current (in Amps). (Default = 0). |
IKF | high-injection knee current (in Amps). (Default = infinite). |
ISR | recombination current parameter (in Amps). (Default = 0). |
NBV | reverse breakdown ideality factor. (Default = 1). |
NBVL | low-level reverse breakdown ideality factor. (Default = 1). |
NR | emission coefficient for isr. (Default = 2). |
TBV1 | bv temperature coefficient - linear (in ˚C-1). (Default = 0). |
TBV2 | bv temperature coefficient - quadratic (in ˚C-2). (Default = 0). |
TIKF | ikf temperature coefficient - linear (in ˚C-1). (Default = 0). |
TRS1 | rs temperature coefficient - linear (in ˚C-1). (Default = 0). |
TRS2 | rs temperature coefficient - quadratic (in ˚C-2). (Default = 0). |
Where a parameter has an indicated default, that default will be used if no value is specifically entered.
The format for the PSpice model file is:
.MODEL ModelName D(Model Parameters),
where:
ModelName
is the name of the model, the link to which is specified on the General tab of the Sim Model dialog. This name is used in the netlist (&MODEL
) to reference the required model in the linked model file.-
Model Parameters are a list of supported parameters for the model, entered with values as required.
Inductor
The existing model has been changed to support the general PSpice model form:
L<name> <
node> <
node> [model name] <value> [IC = <initial value>]
*.mdl
) then, in the Sim Model dialog, set the Model Kind to General
and the Model Sub-Kind to Generic Editor
. The Netlist Template Format should then be entered as follows:
@DESIGNATOR %1 %2 @VALUE @MODEL ?"INITIAL CURRENT"|IC=@"INITIAL CURRENT"|
The value for the INITIAL CURRENT
parameter is entered on the Parameters tab of the Sim Model dialog.
L
.
In the Model Name field, enter the name specified for the model in the model file. Use the options in the Model Location region of the dialog to point to the required file. Click on the Model File tab to view the content of the model file.
The following additional model parameters are supported and can be entered into a linked model file (*.mdl
) for the device:
L | inductance multiplier. (Default = 1). |
IL1 | linear current coefficient (in Amp-1). (Default = 0). |
IL2 | quadratic current coefficient (in Amp-2). (Default = 0). |
TC1 | linear temperature coefficient (in ˚C-1). (Default = 0). |
TC2 | quadratic temperature coefficient (in ˚C-2). (Default = 0). |
Where a parameter has an indicated default, that default will be used if no value is specifically entered.
The format for the PSpice model file is:
.MODEL ModelName IND(Model Parameters),
where
ModelName
is the name of the model, the link to which is specified on the General tab of the Sim Model dialog. This name is used in the netlist (@MODEL) to reference the required model in the linked model file.-
Model Parameters are a list of supported parameters for the model, entered with values as required.
Current-Controlled Switch
The Netlist Template Format for this device remains unchanged:
V@DESIGNATOR %1 %2 0V
@DESIGNATOR %3 %4 V@DESIGNATOR @MODEL &"INITIAL CONDITION"
The following additional model parameters are supported and can be entered into a linked model file (*.mdl
) for the device:
IOFF | control current for OFF state (in Amps). (Default = 0). |
ION | control current for ON state (in Amps). (Default = 1E-3). |
Where a parameter has an indicated default, that default will be used if no value is specifically entered.
The format for the PSpice model file is:
.MODEL ModelName ISWITCH(Model Parameters),
where:
ModelName
is the name of the model, the link to which is specified on the General tab of the Sim Model dialog. This name is used in the netlist (@MODEL) to reference the required model in the linked model file.- Model Parameters are a list of supported parameters for the model, entered with values as required.
Voltage-Controlled Switch
The Netlist Template Format for this device remains unchanged:
@DESIGNATOR %3 %4 %1 %2 @MODEL &"INITIAL CONDITION"
The following additional model parameters are supported and can be entered into a linked model file (*.mdl
) for the device:
VOFF | control voltage for OFF state (in Volts). (Default = 0). |
VON | control voltage for ON state (in Volts). (Default = 1). |
Where a parameter has an indicated default, that default will be used if no value is specifically entered.
The format for the PSpice model file is:
.MODEL ModelName VSWITCH(Model Parameters),
where:
ModelName
is the name of the model, the link to which is specified on the General tab of the Sim Model dialog. This name is used in the netlist (@MODEL) to reference the required model in the linked model file.-
Model Parameters are a list of supported parameters for the model, entered with values as required.
JFET
The Netlist Template Format for this device remains unchanged:
@DESIGNATOR %1 %2 %3 @MODEL &"AREA FACTOR" &"STARTING CONDITION" ?"INITIAL D-S VOLTAGE"|IC=@"INITIAL D-S VOLTAGE", @"INITIAL G-S VOLTAGE"| ?TEMPERATURE|TEMP=@TEMPERATURE|
The following additional model parameters are supported and can be entered into a linked model file (*.mdl
) for the device:
ALPHA | ionization coefficient (in Volt-1). (Default = 0). |
BETATCE | BETA exponential temperature coefficient (in Amp/Volt2). (Default = 1E-4). |
ISR | gate p-n recombination current parameter (in Amps). (Default = 0). |
M | gate p-n grading coefficient. (Default = 0.5). |
N | gate p-n emission coefficient. (Default = 1). |
NR | emission coefficient for isr. (Default = 2). |
VK | ionization knee voltage (in Volts). (Default = 0). |
VTOTC | VTO temperature coefficient (in Volt/˚C). (Default = 0). |
XTI | IS temperature coefficient. (Default = 3). |
Where a parameter has an indicated default, that default will be used if no value is specifically entered.
The format for the PSpice model file is:
.MODEL ModelName NJF(Model Parameters) - N-channel JFET
.MODEL ModelName PJF(Model Parameters) - P-channel JFET
where
ModelName
is the name of the model, the link to which is specified on the General tab of the Sim Model dialog. This name is used in the netlist (@MODEL) to reference the required model in the linked model file.-
Model Parameters are a list of supported parameters for the model, entered with values as required.
Resistor
The existing model has been changed to support the general PSpice model form:
R<name> <
node> <
node> [model name] <value> [TC = <TC1> [,<TC2>]]
A PSpice model of this type should be linked to a schematic component using a model file. Simply specify the model in a model file (*.mdl
) then, in the Sim Model dialog, set the Model Kind to General
and the Model Sub-Kind to Generic Editor
. The Netlist Template Format should then be entered as follows:
@DESIGNATOR %1 %2 &MODEL &VALUE ?TC1/TC=@TC1?TC2|, @TC2| /
Although you could use the existing Spice3f5 Resistor (Semiconductor) model - as this model type allows use of a linked model file - specification of the netlist format for a PSpice Resistor model using the Generic Editor allows you to make use of the additional PSpice parameters ([TC = <TC1> [,<TC2>]]
).
For the circuit to be parsed correctly, ensure that the Spice Prefix field is set to R
.
In the Model Name field, enter the name specified for the model in the model file. Use the options in the Model Location region of the dialog to point to the required file. Click on the Model File tab to view the content of the model file.
The following additional model parameters are supported and can be entered into a linked model file (*.mdl
) for the device:
R | resistance multiplier. (Default = 1). |
TC1 | linear temperature coefficient (in ˚C-1). (Default = 0). |
TC2 | quadratic temperature coefficient (in ˚C-2). (Default = 0). |
TCE | exponential temperature coefficient (in %/˚C). (Default = 0). |
Values for TC1
and TC2
can be entered on the Parameters tab of the dialog. Where a parameter has an indicated default, that default will be used if no value is specifically entered - either on the Parameters tab or in the linked model file.
The format for the PSpice model file is:
.MODEL ModelName RES(Model Parameters),
where:
ModelName
is the name of the model, the link to which is specified on the General tab of the Sim Model dialog. This name is used in the netlist (@MODEL) to reference the required model in the linked model file.-
Model Parameters are a list of supported parameters for the model, entered with values as required.
Voltage-Controlled Voltage/Current Source
The following general PSpice model forms are supported:
E<name> <
node> <
node> VALUE = { <expression> }
E<name> <
node> <
node> TABLE { <expression> } = < <input value>,<output value> >
E<name> <
node> <
node> POLY(<value>) < <
controlling node> <
controlling node> > < <polynomial coefficient value> >
Note: For linear Voltage-Controlled Current Sources, the formats are the same as those above, but substituting G
for E
.
These devices do not support linked model files. The netlist format for a PSpice model in one of the above forms should be specified using the Generic Editor. In the Sim Model dialog, set the Model Kind to General
and the Model Sub-Kind to Generic Editor
.
For the circuit to be parsed correctly, ensure that the Spice Prefix field is set to the entry applicable to the device being used:
VCVS - E
VCCS - G
The following are examples of generic netlist template formats that could be used for these model types.
VALUE model
@DESIGNATOR %1 %2 VALUE = {@EXPR}
The value for the EXPR
parameter is entered on the Parameters tab of the Sim Model dialog.
TABLE model
@DESIGNATOR %1 %2 TABLE {@EXPR} = @ROW1 ?ROW2|@ROW2| ?ROW3|@ROW3|
Values for the EXPR
and ROW
parameters are entered on the Parameters tab of the Sim Model dialog. Any number of ROW
parameters can be defined, in the format (<input value>
, <output value>
).
The netlist format could be entered using the following alternative entry:
@DESIGNATOR %3 %4 TABLE { @EXPR } ( @TABLE )
Values for the EXPR
and TABLE
parameters are again entered on the Parameters tab of the Sim Model dialog. The value for the TABLE
parameter is specified in the form:
(<input1>, <output1>)(<input2>, <output2>)...(<inputn>, <outputn>)
POLY model
@DESIGNATOR %3 %4 POLY (@dimension) (%1, %2) @coeffs
The values for the dimension
and coeffs
parameters are entered on the Parameters tab of the Sim Model dialog.
Current-Controlled Voltage/Current Source
The following general PSpice model form is supported:
H<name> <
node> <
node> POLY(<value>) <controlling V device name> < <polynomial coefficient value> >
F
for H
.
General
and the Model Sub-Kind to Generic Editor
.
CCVS - H
CCCS - F
The following example generic netlist template format could be used for these model types:
@DESIGNATOR %1 %2 POLY (@dimension) @ControlSource @coeffs
The values for the dimension
, ControlSource
and coeffs
parameters are entered on the Parameters tab of the Sim Model dialog.
Bipolar Junction Transistor (BJT)
Many of the parameters that can be included in a linked model file for this type of device are common to both Spice3f5 and PSpice. Those that are supported can be found in the SPICE3f5 models Bipolar Junction Transistor (BJT) Model page.
CN | quasi-saturation temperature coefficient for hole mobility |
D | quasi-saturation temperature coefficient for |
GAMMA | epitaxial region doping factor |
ISS | substrate p-n saturation current |
NK | high-current roll-off coefficient |
NS | substrate p-n emission coefficient |
QCO | epitaxial region charge factor |
QUASIMOD | quasi-saturation model flag for temperature dependence |
RCO | epitaxial region resistance |
TRB1 | RB temperature coefficient (linear) |
TRB2 | RB temperature coefficient (quadratic) |
TRC1 | RC temperature coefficient (linear) |
TRC2 | RC temperature coefficient (quadratic) |
TRE1 | RE temperature coefficient (linear) |
TRE2 | RE temperature coefficient (quadratic) |
TRM1 | RBM temperature coefficient (linear) |
TRM2 | RBM temperature coefficient (quadratic) |
VG | quasi-saturation extrapolated bandgap voltage at 0° K |
VO | carrier mobility knee voltage |
XCJC2 | fraction of CJC connected internally to Rb |
XCJS | fraction of CJS connected internally to Rc |
Metal Oxide Semiconductor Field-Effect Transistor (MOSFET)
Of the existing MOSFET device models, the following is not supported with respect to PSpice compatibility:
- BSIM3 model version 2.0
For the other supported MOSFET device models, many of the parameters that can be included in a linked model file are common to both Spice3f5 and PSpice. Those that are supported can be found in the SPICE3f5 models, Metal Oxide Semiconductor Field-Effect Transistor (MOSFET) Model page.
GDSNOI | channel shot noise coefficient (use with NLEV=3) |
JSSW | bulk p-n saturation sidewall current/length |
L | channel length |
N | bulk p-n emission coefficient |
NLEV | noise equation selector |
PBSW | bulk p-n sidewall potential |
RB | bulk ohmic resistance |
RDS | drain-source shunt resistance |
RG | gate ohmic resistance |
TT | bulk p-n transit time |
W | channel width |