SIMPLIS Multi-Step Simulations - Saving State

With the introduction of SIMetrix/SIMPLIS Version 8.10e, you can save the state of Multi-Step and Monte Carlo simulations. In this context, "Saving state" means that the simulator creates an array of simulation files, including files which contain snapshots and initial conditions. Each simulation step or seed value has an associated set of simulator files, saved in the SIMPLIS_Data directory. These simulation files have file names based on the stepped parameter names and values for a multi-step simulation whereas for a Monte Carlo simulation, the file names includes the seed value.

In this topic:

Overview

For this process to work, successive simulations must use the same parameter names and step values for a multi-step, and for a Monte Carlo analysis, you must provide a starting seed value. Once you have generated the simulation files containing the state information, you can use these files in one of two ways:

  • You can load snapshot information from the files. SIMPLIS automatically checks the simulation files and checks if there are any changes to the circuit and if relevant snapshots exist. If the circuit is unchanged (analysis directives are excepted) then SIMPLIS will automatically load the snapshot. For more information on snapshots, see the Advanced SIMPLIS Training topic 2.0 Transient Analysis Settings. Also, the "Force new analysis" checkbox on the Choose SIMPLIS Analysis dialog must be unchecked to load snapshots.
  • Instead of loading the snapshot, you can include an initial conditions file. When you include an initial conditions file, you inhibit the loading of snapshots, and instead, initialize all reactive components. In order to load the file based on the stepped parameter values or seed value, you need to use a templated .include statement. This is described next.

The templated include file path uses symbolic notation, where percent signs enclose special keywords. For example:

.include "%deck%.init"

When the netlist preprocessor is invoked on the netlist, any include statement with symbolic keywords is resolved to a file path, and that file is included in the simulation. This is typically used for including an initial conditions file from a multi-step or Monte Carlo simulation. The symbolic keywords and their meanings are described below:

Symbolic Keyword Meaning
%DECKFILE% The deck file name, without any directory path nor file extension.
%DECKDIR% The directory where the deck file is located.
%DECK% The directory and deck filename, with a .deck extension.
%NETLISTDIR% The directory where the netlist file is located. Typically this is the same directory where the deck file is located.
%NETLIST% The directory and netlist filename, with a .net extension.
Note: The keywords are not case sensitive.

Examples

During a single run simulation (F9 mode), SIMPLIS creates an initial conditions file with the schematic's base name and with the double extension .deck.init. This initial conditions file is located in the SIMPLIS_Data directory, which is a sub directory of the schematic file. For example, suppose your schematic was named init_files.sxsch. The init file would therefore be init_files.deck.init. To include this file in the simulation, you could use either (but not both at the same time) of these two statements:
.include SIMPLIS_Data/init_files.deck.init

or:

.include %deck%.init

When running multi-step or Monte Carlo simulations, you can instruct SIMPLIS to create an initial conditions file for each step or seed value. You do this by checking the "Save state" checkbox on the Multi-Step or Monte Carlo dialog as shown below:

Multi-Step Monte Carlo
Important: To use the .include method for including initial conditions files, you must also specify a starting seed. This ensures that the Monte Carlo simulation uses a known set of seed values which correspond to the Monte Carlo simulation which generated the initial conditions files.

Each resulting initial conditions file is named according to the parameter name and step value for a multi-step simulation, or with the seed value for a Monte Carlo simulation.

Multi-Step Example

The templated include statement .include %deck%.init is automatically resolved to the correct initial conditions filename. Here is an example:

You run a multi-step simulation where one parameter is stepped over a set of three values:

  • FBASE=900k
  • FBASE=1Meg
  • FBASE=1.25Meg

SIMPLIS creates three deck files and after the simulation completes, three initial conditions files. These three files have the following names:

init_files_FBASE=900k.deck.init
init_files_FBASE=1Meg.deck.init
init_files_FBASE=1.25Meg.deck.init

You want to re-run the simulation, starting at the previous initial conditions. There are many reasons to do this - one is you might have a circuit which is difficult to get to converge in a POP analysis, and setting the initial conditions typically helps. The first simulation run could be a long transient, and the second simulation a POP analysis.

You first run the long transient with the save state checkbox checked. Then for the second run, add the .include %deck%.init to the F11 window of your schematic. When you run the simulation, the netlist preprocessor includes the initial conditions file based on the current parameter name and step value. You also should be aware that initial conditions files in the SIMPLIS_Data directory are overwritten every simulation.

Monte Carlo Example

During a Monte Carlo simulation, the program uses a pseudo random number generator to generate random numbers to seed the calculation of statistical distribution functions. The pseudo random number generator can be thought of as a very long sequence of numbers - picking an initial seed number will determine where you start on the list of numbers, and therefore what the future seed numbers will be. From this concept it's clear that to repeat a simulation, you need to provide an initial seed value, and once provided with an initial seed value, the seed values for the entire Monte Carlo simulation are determined, and fixed.

Taking the same circuit name, and assuming you provide an initial seed value of 123, the program creates a set of initial conditions files, one per seed value. The actual seed values used are determined by the circuit and will not be identical from one circuit to another. Even a small change to a fixed (non-statistical distribution function) circuit parameter will change the sequence of seed values. The seed value is appended to the schematic's name and the initial conditions files have the same .deck.init file extension. An example set of initial conditions file names are:

init_files_123.deck.init
init_files_2067261.deck.init
init_files_337175501.deck.init
init_files_384717259.deck.init
init_files_613744155.deck.init
init_files_834051741.deck.init
init_files_1281840491.deck.init
init_files_2017191533.deck.init

To include these initial condition files, you can use the same include statement as used in the multi-step example:

.include %deck%.init

For each parameter step or seed value, the netlist preprocessor resolves the %deck% keyword and includes the initial conditions file for the parameter step or seed value.

Backing Up Initial Conditions Files

You should think of all files in the SIMPLIS_Data directory as volatile and assume that SIMPLIS will overwrite the files when a simulation is run. You can always backup your initial conditions files by copying the files from the SIMPLIS_Data directory and saving them to a new directory. A simple example is to create a subdirectory of the schematic's directory and name it something like backup_init_files. Once you copy the initial conditions files to that location, you can include the files with the following include statement:

.include backup_init_files/%deckfile%.deck.init
or
.include %deckdir%/../backup_init_files/%deckfile%.deck.init

Renaming Initial Conditions Files

The templating process looks for specific keywords enclosed in the percent signs, and other text is treated as part of the filename. With this system, you can rename initial conditions files and still include these files in the simulation. For example, the multi-step simulation files discussed earlier:

init_files_FBASE=900k.deck.init
init_files_FBASE=1Meg.deck.init
init_files_FBASE=1.25Meg.deck.init

When you copy these files from the SIMPLIS_Data directory to the backup_init_files directory, you could rename them based on the circuit's operating conditions. For example, if these files were renamed, prefixed with a nominal_:

nominal_init_files_FBASE=900k.deck.init
nominal_init_files_FBASE=1Meg.deck.init
nominal_init_files_FBASE=1.25Meg.deck.init

Then you could use the following include statement to include these files in the multi-step simulations:

.include %deckdir%/../backup_init_files/nominal_%deckfile%.deck.init

Automating Initial Condition File Creation and Inclusion

The SIMetrix/SIMPLIS Design Verification Module automates the creation and inclusion of initial conditions files. This is accomplished through the GenerateInitFile and IncludeInitFile testplan entries. These entries automatically rename and make backup copies of the init files and add the correct syntax to include the files in a simulation run.