Setting up your design for simulation
Files needed for simulation
To simulate your design, PSpice needs to know about:
- the parts in your circuit and how they are connected,
- what analyses to run,
- the simulation models that correspond to the parts in your circuit, and
- the stimulus definitions to test with.
This information is provided in various data files. Some of these are generated by the design entry program such as Capture, others come from libraries, and still others are user-defined.
Files that Design Entry Programs generate
When you begin the simulation process, the design entry programs first generate files describing the parts and connections in your circuit. These files are the netlist file and the circuit file that PSpice reads before doing anything else.
Netlist file
The netlist file contains a list of device names, values, and how they are connected with other devices. The name that design entry program generate for this file is DESIGN_NAME-DESIGN_NAME.NET
. The netlist file is located in the directory:
<project_directory>\worklib\<design_name>\cfg_analog\
Other files that you can configure for simulation
Before starting simulation, PSpice needs to read other files that contain simulation information for your circuit. These are model files, and if required, stimulus files and include files.
The simulation profile contains references to the other user-configurable files that PSpice needs to read.
Model library
PSpice uses this information in a model library to determine how a part will respond to different electrical inputs. These definitions take the form of either a:
- model parameter set, which defines the behavior of a part by fine-tuning the underlying model built into PSpice, or
- subcrcuit netlist, which describes the structure and function of the part by interconnecting other parts and primitives.
The most commonly used models are available in the PSpice model libraries shipped with your programs. The model library names have a.LIB extension.
If needed, however, you can create your own models and libraries, using a text editor like Notepad
Stimulus file
You can create a stimulus file by using a standard text editor to create the definition (a typical file extension is .STM).
Include file
An include file is a user-defined file that contains:
You can create an include file using any standard text editor. Typically, include file names have a .INC extension.
Configuring model library, stimulus, and include files
PSpice searches model libraries, stimulus files, and include files for any information it needs to complete the definition of a part or to run a simulation.
The files that PSpice searches depend on how you configure your model libraries and other files. Much of the configuration is set up for you automatically, however, you can do the following yourself:
- Add and delete files from the configuration.
- Change the scope of a file: that is, whether the file applies to a profile only, a design only (local) or to any design (global).
- Change the search order.
To configure these, edit the simulation profile by using the Configuration Files tab in the Simulation Settings dialog box.
Files that PSpice generates
After reading the circuit file, netlist file, model libraries, and any other required inputs, PSpice starts the simulation. As simulation progresses, PSpice saves results to two files—the data file and the PSpice output file.
Probe data file
The data file contains simulation results that can be displayed graphically. PSpice reads this file automatically and displays waveforms reflecting circuit response at nets, pins, and parts that you marked in your design (cross-probing). You can set up your simulation so PSpice displays the results as the simulation progresses or after the simulation completes.
After PSpice has read the data file and displays the initial set of results, you can add more waveforms to perform post-simulation analysis of the data.
There are two ways to add waveforms to the display:
- From within PSpice, by specifying trace expressions.
- From within the design entry program, by cross-probing.
The PSpice output file is an ASCII text file that contains:
- the netlist representation of the circuit,
- the PSpice command syntax for simulation commands and options (like the enabled analyses),
- simulation results, and
- warning and error messages for problems encountered during read-in or simulation.
- the types of analyses you run,
- the options you select for running PSpice, and
- the simulation control parts (like VPRINT1 and VPLOT1) that you place and connect to nets in your design.
Checklist for simulation setup
This section describes what you need to do to set up your circuit for simulation.
- Find the topic that is of interest in the first column of any of these tables.
- Go to the referenced section. For those sections that provide overviews, you will find references to more detailed discussions.
Typical simulation setup steps
When netlisting fails or the simulation does not start
If you have problems starting the simulation, there may be problems with the design or with system resources. If there are problems with the design, PSpice displays errors and warnings in the Simulation Status window. You can use the Simulation Status window to get more information quickly about the specific problem.
To get information about an error or warning shown in the Simulation Status window
The following tables list the most commonly encountered problems and where to find out more about what to do.
Things to check in your design
The model libraries, stimulus files, and include files are configured. |
|
Unmodeled parts and Defining part properties needed for simulation |
|
Things to check in your system configuration
Using parts that you can simulate
The part libraries for PSpice supply numerous parts designed for simulation. The PSpice libraries are located in the PSpice sub-folder in the tools\capture\library directory under your main installation directory. They include:
At minimum, a part that you can simulate has these properties:
- A simulation model to describe the part’s electrical behavior; the model can be:
- explicitly defined in a model library,
- built into PSpice, or
- built into the part (for some kinds of analog behavioral parts).
- A part with modeled pins to form electrical connections on your schematic.
- A translation from design part to netlist statement so that PSpice can read it in.
Special simulation-only parts
The PSpice part libraries also include special parts that you can use for simulation only. These include:
- stimulus parts to generate input signals to the circuit (see Defining stimuli)
- ground parts required by all analog and mixed-signal circuits, which need reference to ground
- simulation control parts to do things like set bias values
- output control parts to do things like generate tables and line-printer plots to the PSpice output file
Vendor-supplied parts
The PSpice libraries provide an extensive selection of manufacturers’ analog and digital parts. Typically, the library name reflects the kind of parts contained in the library and the vendor that provided the models. For example, MOTOR_RF.OLB and MOTOR_RF.LIB contain parts and models, respectively, for Motorola-made RF bipolar transistors.
Libraries are provided with PSpice: Standard PSpice libraries
Standard PSpice libraries
The standard PSpice libraries feature over 16,000 analog and 1,600 digital and mixed-signal models of devices manufactured in North America, Japan, and Europe.
Use parts from standard PSpice libraries if you want to analyze the part with PSpice.
The standard PSpice libraries are installed in the following locations in the installation directory:
-
Capture symbols for standard PSpice libraries at
\tools\capture\library\pspice
-
Standard PSpice model libraries at
\tools\psice\library\
You can find some information about a particular library (.lib) when you open it in a text editor and read the comments in the file.
Part naming conventions
The part names in the PSpice libraries usually reflect the manufacturers’ part names. If multiple vendors supply the same part, each part name includes a suffix that indicates the vendor that supplied the model.
Finding the part that you want
If you are having trouble finding a part, you can search the libraries for parts with similar names by using the part browser in Capture and restricting the parts list to those names that match a specified wildcard text string.
From Capture, select Place – PSpice Component – Search. The PSpice Part Search window opens.
To find parts using the parts browser
- In Capture, from the Place menu, choose Part.
-
In the Part Name text box, type a text string with wildcard characters that approximates the part name that you want to find. Use this syntax:
<wildcard><part_name_fragment><wildcard>
where<wildcard>
is one of the following:
The parts browser displays only the matching part names.
Passive parts
The PSpice libraries supply several basic parts based on the passive device models built into PSpice. These are summarized in the following table.
To find out more about how to use these parts and define their properties, look up the corresponding PSpice device letter in the Analog Devices chapter in the PSpice Reference Manual, and then see the Capture Parts sections.
TnCOUPLED TnCOUPLEDX1 KCOUPLE |
Breakout parts
The PSpice libraries supply passive and semiconductor parts with default model definitions that define a basic set of model parameters. This way, you can easily:
- assign device and lot tolerances to model parameters for Monte Carlo and sensitivity/worst-case analyses,
- define temperature coefficients, and
- define device-specific operating temperatures.
These are called breakout parts and are summarized in the following table.
To find out more about how to use these parts and define their properties, look up the corresponding PSpice device letter in the Analog Devices chapter in the PSpice Reference Manual, and then see the Capture Parts sections.
* For this device type, the PSpice libraries supply several breakout parts. Refer to the PSpice Reference Manual for the available parts.
Behavioral parts
Behavioral parts allow you to define how a block of circuitry should work without having to define each discrete component.
Analog behavioral parts
These parts use analog behavioral modeling (ABM) to define each part’s behavior as a mathematical expression or lookup table. The PSpice libraries provide ABM parts that operate as math functions, limiters, Chebyshev filters, integrators, differentiators, and others that you can customize for specific expressions and lookup tables. You can also create your own ABM parts.
Digital behavioral parts
These parts use special behavioral primitives to define each part’s functional and timing behavior. These primitives are:
Many of the digital parts provided in the PSpice libraries are modeled using these primitives. You can also create your own digital behavioral parts using these primitives.
Defining part properties needed for simulation
If you want to use a part for simulation, then your part should have the PSPICETEMPLATE property defined for it:
You can also add other simulation-specific properties for digital parts: IO_LEVEL, MNTYMXDLY, and PSPICEDEFAULTNET.
Here are the things to check when editing part properties:
- Does the PSPICETEMPLATE specify the correct number of pins/ nodes?
- Are the pins/ nodes in the PSPICETEMPLATE specified in the proper order?
- Do the pin/ node names in the PSPICETEMPLATE match the pin names on the part?
For examples of how to use the PSPICETEMPLATE property, see PSPICETEMPLATE examples.
Editing simulation properties
To edit a property needed for simulation
- In the schematic page editor, select the part to edit.
- From the Edit menu, choose Properties to display the Parts spreadsheet of the Property Editor.
- Click in the cell of the column you want to change (for example, PSPICETEMPLATE), or click the New button to add a property (and type the property name in the Name text box).
- If needed, type a value in the Value text box.
- Click Apply to update the design, then close the spreadsheet.
PSPICETEMPLATE property
The PSPICETEMPLATE property defines the PSpice syntax for the part’s netlist entry. When creating a netlist, Capture substitutes actual values from the circuit into the appropriate places in the PSPICETEMPLATE syntax, then saves the translated statement to the netlist file.
Any part that you want to simulate must have a defined PSPICETEMPLATE property. These rules apply:
- The pin names specified in the PSPICETEMPLATE property must match the pin names on the part.
- The number and order of the pins listed in the PSPICETEMPLATE property must match those for the associated .MODEL or .SUBCKT definition referenced for simulation.
- The first character in a PSPICETEMPLATE must be a PSpice device letter appropriate for the part (such as Q for a bipolar transistor).
PSPICETEMPLATE syntax
- regular characters that the schematic page editor interprets verbatim, and
- property names and control characters that the schematic page editor translates.
Regular characters in templates
Regular characters include the following:
- alphanumerics
-
any keyboard part except the special syntactical parts used with attributes (
@
&
?
~
#
). - white space
An identifier is a collection of regular characters of the form:
alphabetic character [any other regular character]*.
Property names in templates
Property names are preceded by a special character as follows:
The schematic page editor processes the property according to the special character as shown in the following table.
Separator characters include commas (,
), periods (.
), semi-colons (;
), forward slashes (/
), and vertical bars (|
). You must always use the same character to specify an opening-closing pair of separators.
The ^ character in templates
The schematic page editor replaces the ^ character with the complete hierarchical path to the device being netlisted.
Caution—Recommended scheme for netlist templates
Templates for devices in the part library start with a PSpice device letter, followed by the hierarchical path, and then the reference designator (REFDES) property.
It is recommended that you adopt this scheme when defining your own netlist templates.
Example: R^@REFDES
for a resistor
The \n character sequence in templates
The part editor replaces the character sequence \n with a new line. Using \n, you can specify a multi-line netlist entry from a one-line template.
The %
character and pin names in templates
Pin names are denoted as follows:
where pin name is one or more regular characters.
The schematic page editor replaces the %<pin name>
clause in the template with the name of the net connected to that pin.
The end of the pin name is marked with a separator. To avoid name conflicts in PSpice, the schematic page editor translates the following characters contained in pin names.
This pin name character... | Is replaced with this... |
PSPICETEMPLATE examples
Simple resistor (R) template
where REFDES equals R23
, VALUE equals 1k, and R is connected to nets abc and def.
Voltage source with optional AC and DC specifications (VAC) template
V^@REFDES %+ %- ?DC|DC=@DC| ?AC|AC=@AC|
where REFDES equals V6
, VSRC is connected to nodes vp
and vm
, DC is set to 5v
, and AC is undefined.
where, in addition to the settings for the previous translation, AC is set to 1v
.
Parameterized subcircuit call (X) template
Suppose you have a subcircuit Z that has:
To allow the parameter to be changed on the schematic page, treat G as an property in the template.
X^@REFDES %a %b Z PARAMS: ?G|G=@G|
Equivalent template (using the if...else
form)
X^@REFDES %a %b Z PARAMS: ?G|G=@G||G=1000|
X_U33 101 102 Z PARAMS: G=1024
where REFDES equals U33
, G is set to 1024
, and the subcircuit connects to nets 101
and 102
.
X_U33 101 102 Z PARAMS: G=1000
where the settings of the previous translation apply except that G is undefined.
Digital stimulus parts with variable width pins template
For a digital stimulus device template (such as that for a DIGSTIM part), a pin name can be preceded by a * character. This signifies that the pin can be connected to a bus and the width of the pin is set to be equal to the width of the bus.
U^@REFDES STIM(%#PIN, 0) %*PIN
where #PIN
refers to a variable width pin.
U_U1 STIM(4,0) 5PIN1 %PIN2 %PIN3 %PIN4
where the stimulus is connected to a four-input bus, a[0-3]
.
Pin callout in subcircuit templates
The number and sequence of pins named in a template for a subcircuit must agree with the definition of the subcircuit itself—that is, the node names listed in the .SUBCKT
statement, which heads the definition of a subcircuit. These are the pinouts of the subcircuit.
IO_LEVEL property
The IO_LEVEL
property defines what level of interface subcircuit model PSpice must use for a digital part that is connected to an analog part.
If you are creating a digital part, you need to
-
Add the
IO_LEVEL
property to the part and assign a value shown in the table below.Assign this value... To use this interface subcircuit (level)... -
Use this property in the
PSPICETEMPLATE
property definition (IO_LEVEL
is also a subcircuit parameter used in calls for digital subcircuits).
MNTYMXDLY property
The MNTYMXDLY
property defines the digital propagation delay level that PSpice must use for a digital part.
If you are creating a digital part, you need to do the following
-
Add the
MNTYMXDLY
property to the part and assign a value shown in the table below.Assign this value... To use this propagation delay... -
Use this property in the
PSPICETEMPLATE
property definition (MNTYMXDLY
is also a subcircuit parameter used in calls for digital subcircuits).
PSPICEDEFAULTNET property
The PSPICEDEFAULTNET
pin property defines the net name to which a power or ground (invisible) pin is connected.
For example, if the power and ground pins on a digital part are connected to the digital nets $G_DPWR
and $G_DGND
respectively, then the properties are defined as follows:
If you are creating a digital part, you need to do the following
-
For each power pin, create a
PSPICEDEFAULTNET
property and assign the name of the digital net to which the pin is connected. -
Use the appropriate pin name in the
PSPICETEMPLATE
property definition.
Specifying values for part properties
Note the following when specifying values for part properties:
-
Do not leave a space between the value and its unit, if the unit is a scale symbol. For example, specify
5K
instead of5 K
.
For a listing of the scale symbols, see Numeric value conventions in the Before you begin chapter of the PSpice Reference Guide. -
Do not use the European notation for specifying values. For example, if you specify
3K3
(the European notation for3.3K
), PSpice reads the value as3K
. Use3.3K
instead. -
Specify tolerance values as percentages. If you specify an absolute value, the tolerance value will be read as an absolute number. For example, if you specify the value of the
POSTOL
property as a percentage, say10%
, on a10K
resistor, the distribution values will be taken in the range of10K?1K
. If you specify the tolerance value as an absolute number, say10
, the distribution values will be taken in the range of10K?10?
.
Using global parameters and expressions for values
In addition to literal values, you can use global parameters and expressions to represent numeric values in your circuit design.
Global parameters
A global parameter is like a programming variable that represents a numeric value by name.
Once you have defined a parameter (declared its name and given it a value), you can use it to represent circuit values anywhere in the schematic; this applies to any hierarchical level.
Some ways that you can use parameters are as follows:
- Apply the same value to multiple part instances.
- Set up an analysis that sweeps a variable through a range of values (for example, DC sweep or parametric analysis).
When multiple parts are set to the same value, global parameters provide a convenient way to change all of their values for “what-if” analyses.
For example, if two independent sources have a value defined by the parameter VSUPPLY
, then you can change both sources to 10 volts by assigning the value once to VSUPPLY
.
Declaring and using a global parameter
To use a global parameter in your design, you need to:
-
define the parameter using a
PARAM
part from SPECIAL.OLB - use the parameter in place of a literal value somewhere in your design.
- Place a PARAM part in your design.
- Double-click the PARAM part to display the Parts spreadsheet, then click New.
-
Do the following for each global parameter:
- Click New, then enter NAMEn in the Property Name text box, then click OK. This creates a new property for the PARAM part, NAMEn in the spreadsheet.
- Click in the cell below the NAMEn column and enter a default value for the parameter.
-
While this cell is still selected, click Display. In the Display format frame, select Name and Value, then click OK.
- Click Apply to update all the changes to the PARAM part, and then close the spreadsheet.
For example, to declare the global parameter VSUPPLY that will set the value of an independent voltage source to 14 volts, place the PARAM part, and then create a new property named VSUPPLY with a value of 14v.
To use the global parameter in your circuit
- Find the numeric value that you want to replace: a component value, model parameter value, or other property value.
-
Replace the value with the name of the global parameter using the following syntax:
{ global_parameter_name }
The curly braces tell PSpice to evaluate the parameter and use its value.
Expressions
An expression is a mathematical relationship that you can use to define a numeric or boolean (TRUE/FALSE) value.
PSpice evaluates the expression to a single value every time:
- it reads in a new circuit, and
- a parameter value used within an expression changes during an analysis.
For example, a parameter that changes with each step of a DC sweep or parametric analysis.
Specifying expressions
To use an expression in your circuit
- Find the numeric or boolean value you want to replace: a component value, model parameter value, other property value, or logic in an IF function test.
-
Replace the value with an expression using the following syntax:
{ expression }
where {expression} can contain any of the following:- standard operators (listed in the Table below)
- built-in functions (listed in the PSpice User’s Guide)
- user-defined functions
- system variables (listed in the PSpice User’s Guide)
- user-defined global parameters
- literal operands
The curly braces tell PSpice to evaluate the expression and use its value.
* Logical and relational operators are used within the IF() function; for digital parts, logical operators are used in Boolean expressions.
For lists of system variables and functions in arithmetic expression, refer to your PSpice User’s Guide.
Defining stimuli
To simulate your circuit, you need to connect one or more source parts that describe the input signal that the circuit must respond to.
The PSpice libraries supply several source parts that are described in the tables that follow. These parts depend on:
- the kind of analysis you are running,
- whether you are connecting to the analog or digital portion of your circuit, and
- how you want to define the stimulus: using a file specification, or by defining part property values.
Analog stimuli
Analog stimuli include both voltage and current sources. The following table shows the part names for voltage sources.
** VPWL_F_RE_FOREVER and VPWL_F_N_TIMES are file-based parts; the stimulus specification is saved in a file and adheres to PSpice netlist syntax.
To determine the part name for an equivalent current source
-
In the table of voltage source parts, replace the first V in the part name with I.
For example, the current source equivalent to VDC is IDC, to VAC is IAC, to VEXP is IEXP, and so on.
If you want to specify multiple stimulus types
If you want to run more than one analysis type, including a transient analysis, then you need to use either of the following:
Using time-based stimulus parts with AC and DC properties
The time-based stimulus parts that you can use to define a transient, DC, and/or AC input signal are listed below.
In addition to the transient properties, each of these parts also has a DC and AC property. When you use one of these parts, you must define all of the transient properties. However, it is common to leave DC and/or AC undefined (blank). When you give them a value, the syntax you need to use is as follows.
For the meaning of transient source properties, refer to the I/V (independent current and voltage source) device type syntax in the Analog Devices chapter in the PSpice Reference Guide.
Using VSRC or ISRC parts
The VSRC and ISRC parts have one property for each analysis type: DC, AC, and TRAN. You can set any or all of them using PSpice netlist syntax. When you give them a value, the syntax you need to use is as follows.
where time-based_type is EXP, PULSE, PWL, SFFM, or SIN, and the parameters depend on the time-based_type.
For the syntax and meaning of transient source specifications, refer to the I/V (independent current and voltage source) device type in the Analog Devices chapter in the PSpice Reference Guide.
Digital stimuli
If you want this kind of input... Use this part....
Things to watch for
This section includes troubleshooting tips for some of the most common reasons your circuit design may not netlist or simulate.
Common reasons for simulation problems include:
Unconfigured model, stimulus, or include files
Unmodeled parts
If you see messages like this in the Capture Session Log:
Warning: Part part_name has no simulation model
then you may have done one of the following things:
Do this if the part in question is from the PSpice libraries
Replace the part with an equivalent part from an analog library or digital library with modeled parts.
- Make sure that you can simulate the part by checking the following:
- That it has a PSPICETEMPLATE property and that its value is non-blank.
-
That it has Implementation
type=PSpice
Model and an Implementation property with a non-blank value.
Check for this if the part in question is custom-built
-
Are there blank (or inappropriate) values for the part’s MODEL and PSPICETEMPLATE properties?
If so, load this part into the part editor and set these properties appropriately. One way to approach this is to edit the part that appears in your design.
To edit the properties for the part in question
- In the schematic page editor, select the part.
-
From the Edit menu, choose part.
The part editor window appears with the part already loaded. - From the Edit menu, choose Properties and proceed to change the property values.
Unconfigured model, stimulus, or include files
If you see messages like these in the Capture Session Log,
(design_name) Floating pin: refdes pin pin_name
or messages like these in the PSpice output file,
Model model_name used by device_name is undefined.
Subcircuit subckt_name used by device_name is undefined.
Can’t find .STIMULUS “refdes” definition
then you may be missing a model library, stimulus file, or include file from the configuration list, or the configured file is not on the library path.
Check for this
- Does the relevant model library, stimulus file, or include file appear in the configuration list?
- If the file is configured, does the default library search path include the directory path where the file resides, or explicitly define the directory path in the configuration list?
If the file is not configured, add it to the list and make sure that it appears before any other library or file that has an identically-named definition.
To view the configuration list
-
In the Simulation Settings dialog box, click the Configuration Files tab and click Include, Library and Stimulus in the Category field.
If the directory path is not specified, update the default library search path or change the file entry in the configuration list to include the full path specification.
To view the default library search path
Unmodeled pins
If you see messages like these in the Capture Session Log,
Warning: Part part_name pin pin_name is unmodeled.
Warning: Less than 2 connections at node node_name.
or messages like this in the PSpice output file,
then you may have drawn a wire to an unmodeled pin.
The PSpice libraries include parts that are suitable for both simulation and board layout. These parts may have a mix of modeled pins and unmodeled pins. The unmodeled pins map into packages but have no electrical significance; PSpice ignores unmodeled pins during simulation.
Check for this
If so, do one of the following:
- Remove wires connected to unmodeled pins.
- If you expect the connection to affect simulation results, find an equivalent part that models the pins in question and draw the connections.
Missing ground
If for every net in your circuit you see this message in the PSpice output file,
ERROR -- Node node_name is floating.
then your circuit may not be tied to ground.
Check for this
If not, place and connect one (or more, as needed) in your design. You can use the 0 (zero) ground part in SOURCE.OLB or any other ground part as long as you change its name to 0.
Missing DC path to ground
If for selected nets in your circuit you see this message in the PSpice output file,
ERROR -- Node node_name is floating.
then you may be missing a DC path to ground.
Check for this
If so, then add a very large (for example, ) resistor either:
Using the FLOAT property
When preparing a circuit for simulation with PSpice, it’s important to be sure that all pins for all parts are connected properly. If a pin is intentionally meant to remain unconnected, you need to use the PSpice pin property FLOAT, rather than a No Connect symbol. Otherwise, the circuit may not netlist correctly for PSpice.
The pin property FLOAT may have one of the following three values:
The FLOAT property can either be defined in the Part Editor when creating a new part, or you can edit a pin on an existing part using the Property Editor spreadsheet.
To define the FLOAT property using the Property Editor spreadsheet
- In Capture, double-click the pin to open the Property Editor spreadsheet.
- Click the Pins tab.
- Click New and type FLOAT (upper case) in the Property Name text box, then click OK.
- Click in the cell under the FLOAT column for the pin, and then type the property value you want to use.
- Click Apply to have the changes take effect.
For these device types, the PSpice libraries supply several parts. Refer to the PSpice Reference Manual for the available parts.
Return to top