Parametric Sweep Analysis

Parametric sweep allows component values to be varied, ran and plotted all automatically. Collated plots of signal against parameter as the x-axis can also be configured for examining, for example, AC gain at a specific frequency. verses control voltage  

The are two basic modes for parametric sweep.

1 A multiple parameter setup is set up  by GUI selection of the components to be varied. This passes an internal setup file to the spice engine.

2 An external "ReRun" text file. In this mode, a user specified ReRun file is passed to the spice engine, and the spice engine process this data until all runs are completed.

Additionally, there are two modes that the sweeps may use. Either "Run xspice engine once" enabled or disabled. The application of these modes is described below.

Parametric Sweep Analysis Setup

Component values and model parameters can be swept with results accumulated and plotted with one run command. Values may be swept by reference to their reference designator (R1, Q2 ...) or by reference to global Schematic Parameters (SchParams). 

To set up the components to be swept:

1 View the window of the relevant top level or subcircuit schematic first, then press the blue SS simulation setup dialogue property tabs. This is because the property dialog tab data is always referenced to the window (schematic) that initiated that dialogue and displays that data accordingly.

2 Select from the component list (the reference designators) and their associated parameters list. Each component can be enabled or disabled individually. The "enable" check will enable the actual runs. Note that the master enable for subcircuit schematics will be ignored.

3 Set the Worst Case (WC) model selector check boxes on the WC dialog setup page to the single process corner that the parameter sweeps are to use. Note: Irrespective of the total number of selections made, only the corner selected first in order of strong, nominal, weak will be used. Note: Current limitation is that only WC active device corners are selected. RCL will stay at their nominal values

All combinations of enabled parameters will be run. Take care that this will not result in too large a number of runs. The runs can be checked by examining the rerun file that is generated. The name of this file is "[base schematic name]RNN.rrn.

That is a schematic with name:

TestCircuit.sss will generate a TestCircuitRNN.rrr file. This file may be accessed from the View" main menu.

All parameters of all voltage and current sources can be sweep, excepting the  PWL source, which is not supported for parameter sweeps. 

The file that SuperSpice creates for the run can be viewed from the "View\Multiple Parameter Sweep File" menu. Alternative, the file can be pre-created from the "File\Create Multiple Sweep File" menu.

Viewing the  Parameter Sweep File allow the runs to be checked. details of the file format are shown below.

Collated Plots

This feature plots signals verses the swept parameter.

1 Set the signal to be plotted in the "Collated Parameter Plot" text field under Signal Name. e.g. out, v1[i]. These are the names that appear in the Signals tab (click to plot docked view).

2 Enable the feature with the enable button.

3 In the DC, AC, TRAN and NOISE tabs of the Simulation Setup dialog, set the appropriate "Collated Parameter Test Point" frequency, time point, or value.

4 Run the Simulation. New signals will be added to the end of the Signal List. These are the signal to be plotted and the parameter to be used as the x-axis.

4 After the run, pop up the waveform setup dialog by double-clicking on the waveform window.

5 Set the parameter to be swept as the x-axis, and enable the signal to be plotted. 

Note: It is a good idea to only run a few point of the main simulation. e.g. Plotting a VCA gain at 20MHz, set the sweep to have a few values very close but either side of the wanted point. This minimises the run time.

It may get confused run to run, so it may be necessary to reset the x-axis and/or re-click on the signal in the signal list. Additionally, it may be useful to set the signal display type of the virtual setup data for Signal list plots via the "WaveformOnClick" option. Turning off "Intelligent default" on the graph may also be useful to make sure the signal is of the display type require such as dB or actual value.. 

User Specified Multi Dimensional Parametric Sweep ReRuns

A user text file may be used to specify what component values are to varied for each run. This file is called a ReRun file.

Any number of R, L, C, V, I and parameters of BJT, DIODES, JFET, MOSFET E, F, G , H sources and TRANSMISSION LINES,  can be varied automatically. This is achieved by specifying component values and parameters in a plain text ReRun file. That is, a ReRun file contains sets of lists of component values that are to be used for each simulation run. This text file method, whilst those GUI lovers may wince a  bit, is actually much faster to setup for complex multiple runs.

1 Construct a text Name.rrn file. Its default name can be the same as the schematic but with a ".rrn" extension. The Parameter setup dialog has buttons to generate these files if they do not already exist.

2 Set the parameter sweep type button to "file", and make sure the file in the parameter setup dialog points to the file.

3 Check the "Enable" button in the Parameter setup. 

3 Run the simulation.

Run the TrebleBassSweep.sss example to see this feature in operation.

Note: Monte Carlo runs automatically generates a ReRun file as described here.

ReRun File Description

An example of the contents of a Rerun file is:

.ReRun RunName1
r1 1k
c2 10n
q 1e-18 is q2n3904
q2 1 area q2n3904
v3 2 vsine frequency
.temp 50
.RREnd
*
.ReRun RunName2
r1 2k
c2 30n
q 250 bf q2n3904
v3 2 vsine frequency
.temp 75
.RREnd

Runs are performed in sequence. Any value set in the preceding run remains for all following runs until set again. The first run will use the values as is on the schematic.

Title line and end line

Each run is separated by the lines ".Rerun optional any name" and ".RREnd"

Temperature line

.temp 75.3

The above will set the circuit temperature to 75.3 deg C.

Basic devices

R, L, and C use the format:

ref_name value

example:

c1 10n
r1 10k
l1 1u

will set component c1 to 10n, l1 to 1u and component r1 to 10k

Model  Devices

[Ref_des] [value] [parameter_name] [model_name]

The parameter names are the normal spice model parameter names. However, not all parameters are xspice devices are currently supported. The lossless transmission line does not require a model name.

Example - Bipolar:

q 250 bf q2n3904_XN

Will set beta (hfe) of all devices using the model q2n3904_XN as there is only one identifier 'q'

Example - Mosfet:

m2 10u L bsim_model_xn

Will set the length of a single device only irrespective of its model. 

Note: Only a few parameters can be set per single model instance, e.g. 

For mos1, mos2, bsim3 "L", "W",  and "M" can be individually set.

A starter rerun file, set for worst case, for these model types can be automatically generated by using the "Create File" in the Model library manger dialog.

Example - Transmission Lines

t1 50n td
o 1.5 len TRG50_XN 

The t1 statements sets the characteristic delay td to 50ns, the o statement sets the length of the line to 1.5 Meters. Note, lossless lines are individually parameter specified and do not use a ".model".

Parameters supported are Z0, R, L, C, G, LEN, TD and F, as described in the documentation on transmission lines.

Example - Potentiometer

.ReRun Run1 0.3
a 0.3 position VariableResistor_XN
a 50k resistance VariableResistor_XN 
.RREnd
.ReRun Run2 0.8
a 0.8 position VariableResistor_XN
a 20k resistance VariableResistor_XN
.RREnd

Note: For multiple independent sweeps of say, Treble and Bass controls, a separate potentiometer model is required for each pot.

Generator Sources

Voltage and current sources use the following format:

[vi_name] [value] [paramerter_name] [model_name]

Model names must be one of the following:

vdc 
vsine 
vpulse 
vexp
vsffm

idc 
isine 
ipulse 
iexp
isffm

Example:

v3 150n tr vpulse

Will set the rise time for the pulse  generator v3  to the value of 150n

The parameter names are as follows:

DC Source

dcvalue
acvalue
phase

Since Source

offset
amplitude
frequency
delay
damping

Pulse Source

start_amplitude
stop_amplitude
delay
tr
tf
width
period

Exponential Source

amplitude1
amplitude2
delay1
rise1
delay2
rise2

Single Frequency FM Source

offset 
carrier_amplitude
carrier_frequency
modulation_index
mf (modulation frequency)

Auto Generate Rerun File for Models

The "Create File" in the Model library manger will generate a rerun file using an existing worst case model specification, or by using the automatic worst case generator described in the worst case section.

The text in this file can then be pasted/modified into the main rerun file.

Hierarchy

Components at a lower level of hierarchy must be post appended with a ":" and its position in the hierarchy.

Example:

r2:X1:X4

X4 being the lowest level of the hierarchy chain.

Auto Generation Of RRN ReRun File From RRG Generation file

To ease the burden of generating multidimensional .rrerun .rrend, a ReRun file can be generated from a name.rrg file to a name.rrn file. The name.rrg  file contains a list of components with their values in a list.

Example Reun Generater File Contents:

R1 : 1k2 1k5 4k 5k 6.8k
C2 : 10n 20n 40n
qn3 bf 2n222_xn 150 200 300
m2 L bsim_model_xn 10u 20u 30u
t3 td : 1n 2n 3n
o2 c lossy_model_xn 0.2 0.3 0.4
r2 tc1 : 1e-3 2e-3

This file will be processed such that all combinations of the values of R1, C2 and parameter bf will be generated and placed in a rrn file.

Notes: ':' is required before the value list for simple R, L and C. If R and C use a model, it must be in the same format as the above transistor parameter example. Spaces are also required between all fields, including the ":". The lossless TLine must have he ":" after its reference designator. It doesn't have a model 

e.g. 

RefDes1 :  vale1 value2 value3

Refdes2 parameter model values

Sweep Limitations

Not all variations of sweeps by reference designator (RefDes) mode or SchParams mode are valid.

1 Multiple variable sweeps must use the "Run xspice engine once" checked mode.

2 SchParams sweeps must use the "Run xspice engine once" unchecked mode.

3 .Subckt parameter sweeps must use the "Run xspice engine once" unchecked mode and SchParams mode.

4  SchParams sweeps and RefDes sweeps may not be used together.

5 SchParams sweeps may only sweep one variable at a time.

Setups are usually forced to valid modes on closure of the Simulation Setup dialog window.

Note: 

The parameter list for the component may contain items that are meaningless as far as parameter sweeps are concerned. They are there because SuperSpice specific data is added into the standard Spice3/XSpice .model statements. e.g the name of the symbol attached to the model. Ignore those fields.

To sweep the multiplier "m" value of a mosfet or bipolar, "m=1" must be added to its model if not already present. The actual value of m being not important.

Not available in the student versions.

Simulation Setup

Contents