Worst case reruns consist of running many simulations, with worst case models, it does not mean getting worst case waveforms, although typically, worst case modeling can give worst case waveforms for many circuits, and that is the goal of why WC runs are actually performed. Worst case models are models with all their parameters so adjusted to make them correspond to the manufacturing maximum and minimums of the component. i.e. for a transistor, a STRONG (S) or Fast model would have its hfe at its maximum data sheet value, and its RC (collector resistance) set to its minimum value. To use the rerun mode, tick the "WC" button boxes in the simulation setup dialogue (blue SS button), Worst Case Reruns tab. The maximum/minimums are typically set to the "3 Sigma" or 99.7% points.
The Worst Case setup dialog selects which runs to be made. A check is placed for each run type to be run. To minimize the number of runs Resistor and Capacitor variations are tracked together. That is, runs will use the same run type (W, N, S) for both R and C. For example, minimum and maximum frequencies are usually given by setting both R and C to there max and min values.
.Subckt Models
Worst case runs of .subckt models must have the relevant models in the libraries. Each subckt model requires 3 versions, with a name given by the note below on model naming conventions, e.g. model_name_XN, model_name_XW and model_name_XS.
An example illustrating this feature is the Relay.sss schematic.
.subckt's may be identified as of a particular model type, e.g, NPN, PMOS, RES. This is to allow subcircuits to be varied in synchronization with standard spice model types. To do this, the subckt must have one of the following type of lines:
* _ss_subckt_model_type NMOS
* _ss_subckt_model_type PMOS
* _ss_subckt_model_type NPN
* _ss_subckt_model_type PNP
* _ss_subckt_model_type NJF
* _ss_subckt_model_type PJF
* _ss_subckt_model_type NMF
* _ss_subckt_model_type PMF
* _ss_subckt_model_type RES
* _ss_subckt_model_type CAP
* _ss_subckt_model_type IND
* _ss_subckt_model_type SUB
Spice Device Models
If worst case models for standard spice devices are not in the library, they will be automatically generated with reasonable defaults. There is a default set of virtual models that are in the SuperSpice.lib that are used to generate multipliers, or functional variation for nominal models. Each parameter of a nominal model has a corresponding multiplier in these virtual models. e.g.
.MODEL Virtual_SSWC_NPN_XW npn(Is=500m Xti=1 Eg=1 Vaf=800m Bf=400m Ne=1 Ise=500m Ikf=1
+ Xtb=1 Br=1 Nc=1 Isc=1 Ikr=1 Rc=1.25 Cjc=1.25 Mjc=1
+ Vjc=1 Fc=1 Cje=1.25 Mje=1 Vje=1 Tr=1.25 Tf=1.25 Itf=1
+ Vtf=1 Xtf=1 Rb=1.25 Re=1.25 Kf=1.5)
Each of the values associated with the each parameter will multiply the nominal model by that value, or process the value by any expression in curly brackets, {}. For example, if the model used was:
.MODEL Q2N2222_XN NPN(Is=31f Xti=3 Eg=1.11 Vaf=50 Bf=256 Ne=1.34 Ise=14f Ikf=50m
+ Xtb=1.5 Br=3.175 Nc=2 Isc=750p Ikr=0 Rc=300m Cjc=7.3p Mjc=341.6m
+ Vjc={-0.15} Fc=500m Cje=22p Mje=377m Vje=750m Tr=95n Tf=332p Itf=10
+ Vtf=30 Xtf=200 Re=300m Rb=30 Re=500m )
If the nominal model had a Bf=256, the virtual Weak model specification as noted above would cause a corresponding Bf=256*0.4 to be used for the weak bf model. If a model had a nominal Vjc of 0.75, then "-0.15" would be added to it giving Vjc=0.6
Typically for mosfets, Vt variations are specified by max and min absolute voltage variations, in these cases the following may be used to generate weak and strong models:
.MODEL Virtual_SSWC_NMOS_XW nmos(...Vth0={+0.15} ...)
.MODEL Virtual_SSWC_NMOS_XS nmos(...Vth0={-0.15} ...)
To add and subtract values form the nominal Vth0. The {} may contain arbitrary mathematical expressions.
Not all of the parameters have been given worst case specifications, i.e. where the multiplier is
1. This value may be changed if a more accurate worst case model is required. Most values are typically be of the order of +/- 30%, i.e. approximately 1.3 and 0.7
The above default worst case multipliers are used for all models of a given type, e.g., nmos, pmos, jfet etc (see the SuperSpice.lib for the complets list). A model can be directed to use a different set of multipliers by adding in the pathname and model of the virtual model to be used to the model parameter list. This model library must be loaded into SuperSpice. For example:
.MODEL Q2N2222_XN NPN(Is=31f Xti=3 Eg=1.11 Vaf=50 Bf=256 Ne=1.34 Ise=14f Ikf=50m
+ Xtb=1.5 Br=3.175 Nc=2 Isc=750p Ikr=0 Rc=300m Cjc=7.3p Mjc=341.6m
+ Vjc=750m Fc=500m Cje=22p Mje=377m Vje=750m Tr=95n Tf=332p Itf=10
+ Vtf=30 Xtf=200 Re=300m Rb=30 Re=500m SSWC_FileName=[C:\SoftwareDevelopment\SuperSpice\Debug\System\Zetex.lib] SSWC_ModelName=[Kevin_SSWC_NPN])
The key words SSWC_FileName and SSWC_ModelName point to the base name of where the virtual multiplier model(s) is/are located, in this example, in the zetex libary as: If no path is connected with the file name, e.g. SSWC_FileName=[Zetex.lib], the WC model spec must be place in the same file as the model itself. This is probably the best place for it. .MODEL Kevin_SSWC_NPN_XW npn(Is=750m Xti=1 Eg=1 Vaf=900m Bf=400m Ne=1 Ise=500m Ikf=1
+ Xtb=1 Br=1 Nc=1 Isc=1 Ikr=1 Rc=1.25 Cjc=1.25 Mjc=1
+ Vjc=1 Fc=1 Cje=1.25 Mje=1 Vje=1 Tr=1.25 Tf=1.25 Itf=1
+ Vtf=1 Xtf=1 Rb=1.25 Re=1.25 )
.MODEL Kevin_SSWC_NPN_XS npn(Is=1.25 Xti=1 Eg=1 Vaf=1.25 Bf=2 Ne=1 Ise=12 Ikf=1
+ Xtb=1 Br=1 Nc=1 Isc=1 Ikr=1 Rc=0.5 Cjc=0.75 Mjc=1
+ Vjc=1 Fc=1 Cje=0.75 Mje=1 Vje=1 Tr=0.75 Tf=0.75 Itf=1
+ Vtf=1 Xtf=1 Rb=0.75 Re=0.75 )
The model name can be any name, but note the use of the _XS and _XW added to the nominal model
Monte Carlo specifications are set by using a worst case model as above, but with a
-xn extension, model_name_XN, such as:
.MODEL ss_wc_ic_npn_xn npn(IsMC={Is*0.02/sqrt(m)} VafMC={Vaf*0.01/sqrt(m)} BfMC={Bf*0.01/sqrt(m)} IkfMC={Ikf*0.01/sqrt(m)} CjcMC={Cjc*0.01/sqrt(m)} CjeMC={Cje*0.01/sqrt(m)} TfMC={Tf*0.01/sqrt(m)})
Each parameter of the associated main nominal nominal model has the key
string "MC" appended to it. The
resulting name is set to the standard deviation (sigma) of the model parameters. Sigma may be
specified as an absolute number, or as a function of the mean, typically multiplied by the mean. Bipolars and Fets have
predefined physical parameters that may also be used in functions. These are "m", "length", "width" and "area", noting that "area" includes the effects of the parallel multiplier. This allows for the
appropriate sigma as device size gets larger. Parameters defined in the
parameter field of the device may also be used.
Parameter Sweeps
Parameter sweeps use a single selected worst case corner set up in the WC/MC dialog. Note: Current limitation is that only WC active device corners are selected. RCL will stay at their nominal values
Voltage and Current Source (power supply) generators sweeps
Voltage and current sources may be also be swept for worst case conditions of +/-x%. To use this feature, manually name the voltage source reference designator to be varied as "VPSWC" and the current source reference designator to be varied, as "IPSWC". No other sources will be varied. The parameters varied are:
1 VDC/IDC sources - the DC voltage or current
2 VPulse/IPulse sources - the second transient voltage or current
3 VSin/ISine - the amplitude of the sine wave.
Resistance and Capacitor Sweeping - R/C-QWC sweeps
A single special resistor or capacitor may be specified to be varied independently of all the other general resistors and capacitors that are set by their worst case tolerance specifications worst. For example, the "Load" resistor of a regulator may be set to three different values, for each of the worst case corners used by the other resistor, capacitor and transistor worst case setups.
Set the RefDes (reference designator) of the resistor to be varied as "RQWC".
Set the RefDes (reference designator) of the resistor to be varied as "CQWC".
This specified resistor or capacitor will then have its values set by the values give by the R/C-QWC text fields
Model Naming Convention
A _XS, _XN, _XW (strong, nominal, weak) must be appended to the manufactures models names with user created wc models. e.g. 2N2222_XS, 2N2222_XN 2N2222_XW, If manufactures data is missing adjust the main parameters to what is reasonable. i.e. vbe (set by IS in the diode equation) typically varies of the order of +/- 50mv. R's, C's and L's worst case models don't need models, they are calculated from the % stated the Rerun setup window. This function will only work when the models are in the SuperSpice loaded model database, external include file models will not have their models automatically selected.
Waveform/Signal Naming
Runs are identified with a name string in the following manner:
NN:NP:NnM:NpM:ND:NRLC:NG:NX:NT
The first letter, and the first letter after each ":" identifies a run type, e.g. Strong, Nominal or Weak. The characters after these letters indicate what model type is being referenced, e.g. npn, pnp etc..
N -> NPN and DIODE
P->PNP
nM-> NMOS
pM->PMOS
RLC-> RESISTOR/CAPACITOR/INDUCTOR
G-> Generator VOLTAGE/CURRENT source
X->SUBCKT
qRC-> Special RQWC resistor or CQWC capacitor
T->TEMPERATURE
Therefore a term SnM would refer to a strong model nmos run.
Multiple Models
SuperSpice is setup to support multiple models for the same component. This allows e.g. offsets in differential pairs to be simulated. Standard models have an _XN appended (Xcross coupled, Nominal) to their names. Have a look at the component properties for a transistor. The radio button options allow different model choices to be made. If a radio button selection is made, and changes are made to the model, a new model will be copied and created when the ok button is pressed by magic. If the required model already exists, then that model will be fetched instead.
Checking WC runs
To check that the runs are proceeding correctly, in "run xspice engine once " mode disabled, pull up the model file text (the pink 'M' button) before running. The model data will change for each run. If it don't, something's is set up incorrectly. In "run xspice engine once " mode enabled, view the "Worst Case Rerun file" for appropriate entries.
Not available in the student versions.
Monte Carlo
Most components may be automatically and randomly varied. To do this, check the "MC" button the the simulation setup, worst case tab. Then set the number of runs required.
Monty Carlo runs use either the default standard deviation setups in the SuperSpice.lib file, or the specification pointed to by the nominal model. Only one worst case corner is used for any MC set of runs. This corner may be chosen by selecting the appropriate corner in worst case setup dialog.
Notes:
Currently, resisters, capacitors, inductors, diodes, bipolar, jfet, mosfet (level 1,2, 8, 14) and gasfet are varied.
MC requires that the "Run XSpice engine once" option be enabled.
ReRun file. Monte Carlo runs generate and use a rerun file as described in the parameter sweep multi dimensional reruns setup. The file name used for the rerun file is [schematic_name]MC.rrn. That is, the base name of the schematic is used with the addition of "MC.rrn". This file can be examined for the actual values used in the runs.
Run XSpice Engine Once
This option is under some development, and consequently may have some bugs. The original and safest option is to leave this check cleared for WC runs. The causes SuperSpice to repeatedly start stop and re-rerun the XSpice engine for each worst case condition. This mode gives reliable results, but takes longer, and causes additional interaction between other running applications. This mode must be used when .subckts are to be varied, e.g. when a .subckt is specified to be of a device type such as NPN, PMOS etc.
When checked, the XSpice engine is initiated only once. The engine then reads a file and repeatable runs the analysis for each Worst Case/Monte Carlo condition. This is cleaner and runs faster. However, there may be some issues with the implementation of this feature. Specifically, BSim3 and BSim4 models might result in some erroneous results for worst case reruns. This mode must be used when running MC.
Checked - Run the XSpice engine once and update parameters for each worst case run on the fly. Speeds up parsing of the runs. Still in development.
Unchecked - ReRun XSpice engine for every worst case run. Safest mode.
Try both options, when able, if results are the same, use the run once option.