Tim Edwards
03/30/2024, 1:06 AMname: iterations
description: Iterations to run
display: Iterations
minimum: 1
maximum: 100
step: linear
stepsize: 1
Also in the "simulate" block, you will want to add the line:
collate: iterations
You will then get a spread of values from which are calculated minimum and maximum. A better measurement is to measure the distribution standard deviation, which can be done in CACE, using a "spec {...}" block with
spec {
minimum: -10 fail std3n-above
typical: 0
maximum: 10 fail std3p-below
}
This should set the minimum value to (mean - 3 * sigma)
of the monte carlo distribution, and the maximum value to (mean + 3 * sigma)
of the monte carlo distribution.
My sky130_ef_ip__rdac3v_8bit
example has a Monte Carlo example, although it does not use the standard deviation measurement
The same method for Monte Carlo can be done for device mismatch, but instead of process corner mc
, use process corners ff_mm
, tt_mm
, and ss_mm
, which are the process corners but also include mismatch.
When using Monte Carlo or mismatch, be sure to add to the simulation netlist the following (using CACE notation):
.option SEED=[{seed=12345} + {iterations=0}]
This forces ngspice to set a new random seed for every simulation. The result is random but also reproducible.
The Monte Carlo (or mismatch) simulation can also be done by looping over iterations inside ngspice with an ngspice for
loop; make sure you do a reset
every loop, and set the SEED
option inside the loop as well. It should be faster because it doesn't incur the startup time of reading all the device models on every iteration. However, it requires a special control block, whereas by using CACE, the same testbench can be re-used for measurements with monte carlo, mismatch, or no statistical variation, by choosing the appropriate set of conditions.Mitch Bailey
03/30/2024, 1:39 AM100
iterations, but it appears that the iteration maximum is set at 10
. Is this a typo?
simply run the simulation over 100 iterations
name: iterations
description: Iterations to run
display: Iterations
minimum: 1
maximum: 10 <- does this limit the parameter value to 10?
step: linear
stepsize: 1
Sorry if I’m not understanding the setup.Tim Edwards
03/30/2024, 1:45 AM