Krzysztof Herman
07/24/2024, 2:52 PMmc_ok
and mm_ok
switches for statistic analysis. It is a little bit confusing since the documentation of hspice (and ngspice follows this approach) defines the gauss
and agauss
functions in such way that this parameter placed at third place means a number of sigmas gauss(nominal_val, std, nsigmas)
. When mc_ok
or mm_ok
are set to 0 there is no variation but still the function is calculated.Tim Edwards
07/24/2024, 3:11 PMTim Edwards
07/24/2024, 3:20 PMMC_MM_SWITCH
and MC_PR_SWITCH
correspond to what you refer to as mm_ok
and mc_ok
. Equations take a form like mismatch_factor*MC_MM_SWITCH*AGAUSS(0,1.0,1)
, where the gaussian mean in the AGAUSS
function call is always set to zero and the sigma is alwasy set to one; the expression result is then multiplied by mismatch_factor
(which takes care of the sigma) and is added to the parameter nominal value (which takes care of the mean). Example usage suggests that mismatch_factor = 1
corresponds to 3 sigma.
This can vary from foundry PDK to foundry PDK, but when converting from, say, spectre models to ngspice, this is generally the easiest way to do the conversion.Krzysztof Herman
07/25/2024, 10:59 AMagauss
function is set to 1 this implies 3 sigma and should be used as a default value.Krzysztof Herman
07/25/2024, 11:05 AMTim Edwards
07/25/2024, 1:11 PMmismatch_factor = 1
corresponds to 3 sigma". I haven't found any statement in the documentation to absolutely confirm that. But from other foundries' PDKs, usually the values are set to a default of 3 sigma; either they will provide a parameter, e.g., process_sigma = 3
or something obvious like that. If it's just a generic term like mismatch_factor
and the foundry's example usage has it set to 1, then it's most likely to be corresponding to 3 sigma. Obviously gauss()
can be multiplied up so that nsigmas
can be either hidden in the mismatch_factor
or even in the parameter value being multiplied by the agauss()
result.Tim Edwards
07/25/2024, 1:20 PMsky130.lib.spice
file and made a number of different categories, most of which were combinations of corners and mismatch; process variation (monte carlo) is a single .lib
section and not combined with anything. It probably should include sections where process and mismatch are combined. I did not do that because at the time ngspice was struggling with the .lib
files and unfortunately processing all the .lib
sections instead of just the one being requested, which was causing ngspice to take ages to start up a simulation. That has been fixed, so there is no reason not to include every kind of useful combination of variations in the .lib
file.Krzysztof Herman
07/25/2024, 2:26 PM.lib
file. As for the nsigmas
I was suggested by the developers of ngspice to get information from the hspice manual https://cseweb.ucsd.edu/classes/wi10/cse241a/assign/hspice_sa.pdf The definitions are on page 919Tim Edwards
07/25/2024, 2:29 PMKrzysztof Herman
07/25/2024, 2:31 PM