Verifying & Preparing a Project for Simulation

Now reading version 24. For the latest, read: Verifying & Preparing a Project for Simulation for version 25

The design to be simulated should be verified and adequately prepared so you can receive the proper simulation results. The relevant regions of the Simulation Dashboard panel will guide you in design verification and preparation to make sure that the design meets the requirements necessary for simulation.

Controlling the Scope of the Simulation

First of all, the scope of the simulation should be chosen using the Affect setting at the top of the Simulation Dashboard panel. The setting defines for which sheet(s) of the active project the circuit simulator makes a list of circuits:

  • Document – only for the schematic sheet that is currently open.
  • Project – for all sheets of the current project.

Define which schematic sheets are to be included in the simulation.
Define which schematic sheets are to be included in the simulation.

  • The Affect setting allows you to quickly switch between modes when debugging local problems, allowing you to isolate an issue to a particular sheet. This setting may be effectively used in conjunction with a Compile Mask directive (see below) and the function of adding sources from the Simulation Dashboard, which allows you to consider the schematic of the current sheet separately from other schematic sheets.
  • Also note that if the design project that contains the circuit to be analyzed includes design variants, the analyses will be performed for the active variant.

Using a Compile Mask in Simulatable Designs

Because all elements of a design covered by a Compile Mask directive are invisible to the design compiler, they will be omitted from the design. This feature can be put to great use when simulation is included as part of the design flow.

Voltage and Current sources are necessary elements when running circuit simulations, but they have no place on the completed PCB. By applying a small amount of planning to the structure of the circuit, it is usually possible to group all simulation-specific components in one section of the design – a section that can then be easily covered by a Compile Mask directive.

When the circuit is used for simulation, the Compile Mask directive is disabled to reveal the simulation-specific components. Once the circuit is verified and ready for inclusion in the design, the Compile Mask directive can be re-enabled, so that the simulation-specific components are excluded from the design. If the design should ever need to be changed again in the future, another simulation pass can be quickly executed prior to sign-off by disabling the Compile Mask directive (to reveal the simulation-specific components again).

Javascript

Initially, the Compile Mask directive is disabled, making the circuit ready for simulation.

When the Compile Mask directive is enabled in the example shown above, the simulation sources are hidden from the design.

Verifying the Design for Simulation

First of all, the schematic used in the simulation must be part of a PCB project (*.PrjPcb). If the schematic sheet is a free document, the simulation-related controls will not be available to use: the Simulate » Run Simulation command from the main menus will be inactive, as well as the Simulation Dashboard panel. A warning will be shown at the top of the panel.

Simulation is not available for a schematic that is not part of a project.
Simulation is not available for a schematic that is not part of a project.

When the active schematic document is part of a PCB project, click the Start Verification button in the Verification region of the Simulation Dashboard panel to start project verification according to the chosen scope of the simulation.

Click Start Verification to verify your circuit for simulation.
Click Start Verification to verify your circuit for simulation.

A series of automated processes and checks will be invoked, which include the generation of the circuit's SPICE Netlist (*.nsx), a number of simulation-related electrical rule checks, and simulation model validity checks. The model check will detect components with missing simulation models, and models with parsing or pin mapping errors.

When there are no detected violations, a green check icon will be shown in the Verification region of the Simulation Dashboard panel.

The Verification region when there are no violations detected
The Verification region when there are no violations detected

If there are any detected check violations, the corresponding warnings and icons will be shown in the Verification region of the Simulation Dashboard panel. Possible violations are described below.

After the initial verification run, verification is performed automatically when there is a minor change made to the schematics. For more major changes that might take a significant amount of time, the automatic verification will be stopped, and a message that the verification is out of date will be shown at the top of the Simulation Dashboard panel. Click the Update control to perform the verification.

Violations of simulation electrical rule checks (ERC) will be listed under the Electrical Rule Check header.

Violations related to component simulation model checks will be listed under the Simulation Models header. 

Preparing the Design for Simulation

Adding and Configuring a Simulation Source

To simulate a circuit, the schematic design should contain at least one voltage or current source. If there is no source, the simulation can still be performed and you will be warned by the message Need to add source in the Preparation region of the Simulation Dashboard panel. A voltage or current source can be placed in schematics by clicking the Add control in the Simulation Sources region of the Simulation Dashboard panel and selecting the Voltage or Current command from the menu or by using the Place Voltage or Place Current command from the Simulate main menu or the simulation command menu in the Active Bar.

Simulation sources should be added to the circuit. That can be done right from the Simulation Dashboard panel.
Simulation sources should be added to the circuit. That can be done right from the Simulation Dashboard panel.

Once a source has been placed, its properties can be changed in the Properties panel. Notes about configuring the properties of a source:

  • Stimulus Name is the assigned name of the signal. You can create new signals for the schematic or remove unnecessary ones. Select a signal from the available list using the Stimulus Name properties drop-down menu. You can assign the same signal name configuration to several signal sources in an electrical circuit.

    When using the same stimulus for several sources, note that these sources will share the same set of stimulus parameters. That means that when changing a stimulus parameter of one source, the exact change will be reflected in other sources. To avoid this, you can create a new stimulus.
  • Stimulus Type is a selection of the source type as a signal-time dependence:
    • DC Source – a constant signal source with no time dependence.
    • Exponential – an exponential signal source that has a temporal dependence in a form of an exponent.
    • Piecewise Linear – a time-dependent signal source in the form of a piecewise linear function. Learn more about Configuring a Piecewise Linear Source.
    • Pulse – a signal source that has a temporal dependence in the form of a rectangular pulse.
    • Single Frequency FM – a signal source that has a temporal dependence in the form of a single frequency modulated function.
    • Sinusoidal – a signal source that has a temporal dependence in the form of a sine function.
    • File – CSV file-based PWL source. Learn more about Using a CSV File as a Source.
  • A number of parameters for the source are available in the Parameters area of the Properties panel. The set of parameters depends on the selected source type.
  • The preview region shows the signal for a short period of time (two low frequency periods for periodic form signals) based on the specified parameters. This allows you to track the changes you have made and verify their correctness.

An example of configured properties for a sinusoidal source
An example of configured properties for a sinusoidal source

All sources placed in schematics are listed in the Simulation Dashboard panel. From here, you can remove the added sources and also activate/deactivate them. A deactivated source is not involved in the calculation and is displayed in faded colors on the schematic. Click a source name to cross-probe to this source on the schematic sheet.

Explore and manage the simulation sources from the Simulation Dashboard panel
Explore and manage the simulation sources from the Simulation Dashboard panel

The Simulation Generic Components library also includes a set of DC and AC current and voltage sources, controlled current and voltage sources, and signal sources of various types.

Configuring a Piecewise Linear Source

It is often necessary to create a complex piecewise linear signal when the waveform is specified by the user. In this situation, interpolated VPWL and IPWL voltage and current sources can be used. When Piecewise Linear is chosen as the Stymulus Type for the selected source, use the Time-Value Pairs parameter field in the Parameters region of the Properties panel to specify the coordinate values of the axes as a numerical sequence, as shown below.

Use the Time-Value Pairs parameter to configure a Piecewise Linear source
Use the Time-Value Pairs parameter to configure a Piecewise Linear source

Using a CSV File as a Source

The circuit simulator also supports using a CSV file to specify the time-value pairs for the interpolated VPWL and IPWL voltage and current sources. Set the Stimulus Type to File, then specify the path+filename in the File parameter (e.g., C:\Designs\Circuit Simulation\Analog Amplifier\PWL_Source.csv), as shown below. You can specify the path+filename manually or double-click in the File field and then browse to and choose the required file.

Adding and Configuring Probes

Probes are used to take measurements at specific locations of the circuit. A probe can be placed in schematics by clicking the Add control in the Probes region of the Simulation Dashboard panel and selecting the required probe type from the menu or by using the commands of the Simulate » Place Probe menu or the simulation command menu in the Active Bar. The following types of probes are available:

  • Voltage – shows the voltage referenced to the base node of an electrical circuit (usually a GND node). The probe must be placed on a wire or the electrical hotspot of a component pin.
  • Current –  shows the current flowing into the component pin. A positive current value indicates that current is flowing into the component pin, while a negative current value indicates that current is flowing out of the component pin. The current probe must be placed on the electrical hotspot of a component pin.
  • Power – shows the instant power value on the component pin. A positive power value indicates that the component pin is working as a power consumer, while a negative power value indicates that the pin is working as a power source. The power probe must be placed on the electrical hotspot of a component pin.
  • Voltage Difference – shows the voltage between chosen nodes. A pair of probes – positive (VD+) and negative (VD-) – are sequentially placed on wires or the electrical hotspots of component pins. The voltage is referenced to the negative probe.

Probes can be added right from the Simulation Dashboard panel.
Probes can be added right from the Simulation Dashboard panel.

Once a probe has been placed, its properties can be changed in the Properties panel. By default, it will be named after the net or component on which this probe is placed.

  • If a probe is placed in an inappropriate location, the Empty Probe name will be assigned to it.
  • Current and power probes are not supported for pins of a component that has a sub-circuit based simulation model. In this case, the Not Available name will be assigned to the probe.

Examples of placed probes. Note that the current probe was placed in an inappropriate location (not on a component pin) so the Empty Probe name was assigned to it.
Examples of placed probes. Note that the current probe was placed in an inappropriate location (not on a component pin) so the Empty Probe name was assigned to it.

All probes placed in schematics are listed in the Simulation Dashboard panel. From here, you can remove the added probes and also activate/deactivate them. A deactivated probe is not involved in the calculation and is displayed in faded colors on the schematic. Click a probe name to cross-probe to this probe on the schematic sheet.

Explore and manage the probes from the Simulation Dashboard panel
Explore and manage the probes from the Simulation Dashboard panel

From both Properties and Simulation Dashboard panels, you can change the color of a source. The chosen color will define the color of the corresponding plot in the simulation result document.

Also, the last value calculated during the simulation process will be shown in the Properties panel and the design space, next to the probe, and the preview of the corresponding plot will be shown in the Properties panel.

Simulation results are shown next to the probe in the design space and the Properties panel.
Simulation results are shown next to the probe in the design space and the Properties panel.

Interactive Probe Mode

This feature is in Open Beta and available when the Simulation.InteractiveProbes option is enabled in the Advanced Settings dialog.

You can enable interactive probe mode by enabling the Interactive Mode option in the Preparation region of the Simulation Dashboard panel to immediately reflect any changes of probes (adding and removing probes, enabling and disabling probes, moving a probe to a different net, changing probe color) in the .sdf document containing the simulation results.

The Interactive Mode option in the Simulation Dashboard panel
The Interactive Mode option in the Simulation Dashboard panel

After enabling the Interactive Mode option, the simulation should be re-run for the feature to work.
Enabling the Interactive Mode option may affect simulation performance and the size of the .sdf document.

Adding Simulation Models to the Design

To simulate a design successfully, all components in the circuit must be simulation-ready, that is, they must each have a linked simulation model defined for them. Altium Designer's simulator supports popular SPICE-model formats, including PSpice and LTspice formats. Model files with the extensions .mdl.ckt.lib and .cir can be used.

Note that Special Functions in LTspice models (these are defined with the A designator in their model syntax) are not currently supported.

Altium Designer comes with a default Simulation Generic Components library that contains a number of simulation models for the most popular components. Also, you can find simulation-ready components using Altium Designer's Manufacturer Part Search panel.

With such a vast pool of components available to designers in the real world, there will often be times where the component(s) required for use in a circuit will need to be created in libraries added by the user. As well as defining the component's symbol, a simulation model for that component needs to be acquired and then linked, in order to make that component simulation-ready.

A simulation model can be obtained from many and varied sources. The following is a non-exhaustive list of possible places or methods to get the model you require for a target device you wish to use in your design:

  • Manufacturer – a popular place to look for a model is on the site of the manufacturer that makes the device you want to use. Typically, there will be a link to any available model from the page dealing with the specific device.
  • Altium Designer's SPICE Model Wizard – use this wizard to create and automatically link a SPICE3f5 device model to an existing or new library component. If linking to a new component, that component will be created automatically by the wizard. The following device model types are supported: Semiconductor Capacitor, Semiconductor Resistor, Current-Controlled Switch, Voltage-Controlled Switch, JFET, Lossy Transmission Line, Uniform Distributed RC Transmission Line, Diode and BJT. For more information on using Altium Designer's Spice Model Wizard to create a simulation model, see Creating a Simulation Model.
  • Third-Party Modeling Tools – various simulation software packages contain features for modeling a device. This typically takes the form of a model wizard.
  • Dedicated Modeling Companies – you may be able to source the required model from a third-party company that creates simulation models based on a given specification.
  • By Hand – the required model can be created yourself, from scratch. This will typically require good knowledge of the language in which the model definition is being written, for example, when creating a subcircuit. When creating a simple MDL file, you will need good knowledge of the parameters available for, and supported by, that device.

The model (or macro model) is assigned to the component either when defining the component in the corresponding editor or once the component's schematic symbol is placed on the schematic sheet.

  • The simulator only supports ANSI encoding for model files.
  • Simulation models used in a project are cached in the project, so simulation of such projects can be easily run on different machines.

The available options for the placement of components with simulation models in Altium Designer are described in the sections below.

Placing a Component from the Simulation Generic Components Library

The Simulation Generic Components library is installed with Altium Designer by default. Components from this library can be placed into your schematic as regular components. Access the library from the Components panel by selecting the Simulation Generic Components entry or by selecting the Simulate » Place Simulation Generic Component command from the main menus of the Schematic editor.

Access the Simulation Generic Components library from the Components panel
Access the Simulation Generic Components library from the Components panel

  • Refer to the Simulation Generic Components page for reference about the parameters of components placed from this library.
  • Note that while the generic simulation components can be placed directly onto the schematic, they will need to be replaced by physical (rather than virtual) components as the design progresses.
  • A number of frequently used generic simulation components (resistor, capacitor, transistors, etc.) can also be placed from the Simulation Generic Components library on the schematic using the commands of the Simulate » Place Models sub-menu.

Placing a Component with an Attached Simulation Model

If a component in your Workspace library or an available file-based or database library has a simulation model attached to it, place this component from the Components panel.

Refer to the following pages to learn more about linking a simulation model to a library component:

If you are working with a library that has some components with simulation models and some without, enable the Simulation column in the Components panel to make it easy to locate the simulation-ready components.

Display the Simulation column in the Components panel to see, at-a-glance, which components have simulation models.
Display the Simulation column in the Components panel to see, at-a-glance, which components have simulation models.

If a component has a simulation model, you can examine the model in the Component Details region of the Components panel when the component is selected in the panel's list.

Sourcing a Simulation-ready Component from the Manufacturer Part Search Panel

The Manufacturing Part Search panel provides you with access to manufacturer parts, many of which have simulation models. You can filter the part to list only those that have simulation models by selecting the Yes option for the Has Simulation parameter in the panel's Filters pane. Parts that have models are listed the  icon next to their entries.

In the Manufacturer Part Search panel, you can filter the list to show only the parts that have simulation models.
In the Manufacturer Part Search panel, you can filter the list to show only the parts that have simulation models.

A part selected in the list of the Manufacturer Part Search panel can be saved to your Workspace (recommended), downloaded as an integrated library, or placed directly into your design.

When placing a part from the Manufacturer Part Search panel directly on a schematic sheet, Altium Designer applies default 1-to-1 mapping between the schematic symbol and the simulation model of the part. If the resulting mapping is not correct, you can override this behavior by enabling an option that automatically replaces the existing component symbol with a generic component symbol. This generic component symbol is a simple rectangle that is created during placement, whose pins are automatically mapped to the correct model pins. To use this feature, enable the Always Generate Model Symbol for Manufacturer Part Search Panel Using Simulation Model Description option to the  Simulation - General page of the Preferences dialog.

Placing a Component When You Only Have the Simulation Model

If you have a simulation model in the form of a model file on your hard drive or uploaded into your connected Workspace, you can place this model directly from the Components panel instead of attaching this simulation model to a component first.

  • To use a model file on your hard drive this way, make it available as a file-based library and then select the entry for this file in the panel.

    A simulation model file can be made available as a file-based library. An example of a model file added to the list of installed libraries is shown here.
    A simulation model file can be made available as a file-based library. An example of a model file added to the list of installed libraries is shown here.

  • When the Show in Components Panel option is enabled in the Simulation – General page of the Preferences dialog, the SPICE Libraries category is available in the Components panel. The libraries contained in the Model Path folder specified on the Simulation – General page of the Preferences dialog will be listed in this category. The category structure reflects the structure of the specified folder. The SPICE Models folder specified in this field by default resides in the Mixed Simulation extension's default installation Library folder (\ProgramData\Altium\Altium Designer <GUID>\Extensions\Mixed Simulation\Library) and includes a folder of Analog Devices' SPICE models.

  • To use Workspace simulation models this way, select Models from the  button menu in the Components panel and then select Simulations within the All category of your Workspace library in the panel.

    Browse the simulation models in your connected Workspace from the Components panel by enabling the Models option in the panel.
    Browse the simulation models in your connected Workspace from the Components panel by enabling the Models option in the panel.

When you place a simulation model directly, Altium Designer analyzes the model and locates a suitable symbol in the Simulation Generic Components library. Discrete components will have a symbol that suits that type of component, and components that are modeled by a subcircuit will have a simple rectangular symbol.

The table below lists the supported model-kinds and the Simulation Generic Components library component symbol that is placed.

Component Model Text Symbol
(SIM Library Design Item ID)
Resistor .MODEL <model name> RES Resistor
Capacitor .MODEL <model name> CAP Capacitor
Inductor .MODEL <model name> IND Inductor
Diode .MODEL <model name> D Diode
Bipolar transistor .MODEL <model name> NPN BJT NPN 4 MGP
Bipolar transistor .MODEL <model name> PNP BJT PNP 4 MGP
Junction FET .MODEL <model name> NJF JFET N-ch Level2
Junction FET .MODEL <model name> PJF JFET P-ch Level2
MOSFET .MODEL <model name> NMOS MOSFET N-ch Level1
MOSFET .MODEL <model name> PMOS MOSFET P-ch Level1

Automatic Assignment of Simulation Models

If one or more components missing simulation models are detected during design verification, the Components without Models warning(s) will be shown in the Simulation Dashboard panel from where you have an option to automatically assign simulation models to these components.

Support for PSpice Digital Devices

Altium Designer also provides support for all PSpice digital primitives, digital stimuli (digital stimulus generator and file-based stimulus), digital input and digital output devices.

  • For all PSpice digital gates (except DLYLINE), inertial delay processing is implemented.
  • In all digital components, support for zero-time delays is provided. When the number of cycles reaches a prescribed limit (limits are set at 50 iterations), an error is reported and the simulation terminates.
  • Support for digital models that use global nodes $D_HI$D_LO, and $D_X is also provided. These nodes act as if there are digital signal sources connected to them with values 1, 0, and X, respectively.

Support for Variable Passives

Altium Designer provides support for variable resistors, capacitors, and inductors. The value of a passive component can be set as a variable. Use an expression in curly braces as the value of the Value parameter to define resistance for a resistor, the capacitance for a capacitor, or inductance for an inductor. The following can be used in expressions:

  • Built-in constants (pie, etc.)
  • User-defined global parameters
  • x for the voltage across the capacitor or the current through the inductor
  • temp for the analysis temperature
  • time in a transient analysis
  • hertz in AC sweep analysis
  • Node voltages
  • Voltage source currents
  • Inductance currents
  • Variable passive component currents

Use the 'q =' or 'flux =' string followed by an expression in curly braces as the value of the Value parameter to define the charge of a capacitor or flux of an inductor.

Examples of expressions in values of passives and results of transient analysis for corresponding circuits are shown below.

Javascript ID: Simulation_VariablePassives

An example of using variables for resistors. Resistance of R2 depends on the node voltage of the IN net and the time variable. Resistance of R4 depends on the current through R2 (which is a variable resistor).

An example of using variables for capacitors whose capacitance (C1) and charge (C2) depends on the voltage across them. The expressions for the capacitance and the charge result in the same current through the capacitors, so the resulting waveforms are equal.

An example of using variables for inductances whose inductance (L1) and flux (L2) depends on the current through them. The expressions for the inductance and the flux result in the same voltage across the inductors, so the resulting waveforms are equal.

Output voltage, power and current are supported for variable passives.

Net Name Assignment

Assigning net names is not necessary for circuit simulation, but it is recommended for convenience. Assigning a net name makes the selection of points for displaying characteristics clearer, especially when working with complex schematics. When Configuring & Running a Simulation in the Simulation Dashboard, it is possible to select the desired points for some types of calculations to display the characteristics on the plots in the Output Expression sections if you have identified those points with a net label.

If you find an issue, select the text/image and pressCtrl + Enterto send us your feedback.
Note

The features available depend on your Altium product access level. Compare features included in the various levels of Altium Designer Software Subscription and functionality delivered through applications provided by the Altium 365 platform.

If you don’t see a discussed feature in your software, contact Altium Sales to find out more.

Content