@User: @User created a script to convert the Spectre-syntax MC parameters into something that ngspice recognizes. I ran the script and generated a patch file from it that I apply in open_pdks. If you use the open_pdks build, then you need to put ".param mc_switch = 1" at the top of the testbench netlist to enable the Monte Carlo. Caveats are (1) I have not had time to check that this works---it really just needs a quick testbench to show that any given parameter has a gaussian spread; (2) the script that Brad wrote only looks in the models that are in the cell files, which is to say in libs.ref/sky130_fd_pr/ in the open_pdks installation. This is good for running mismatch simulations. However, the script needs to be expanded to check and convert the equivalent statistics blocks in the models that are in the path libs.tech/ngspice/, which would be the ones that you want for run-to-run process variation. Expanding the script should be pretty easy to do, since the statistics blocks for mismatch and process are exactly the same, just with different keywords. Then you would need another parameter (mc_switch was maybe too generic; probably better to have mc_mm_switch and mc_pr_switch, say). Related issue: The simulations break if you don't put the parameter at the top of every testbench. Is there a way to have the parameter set to zero by default and overridden by the contents of the testbench?
05/03/2021, 4:15 PM
What I have seen if that you have different corner for Monte-Carlo dis/enabled, e.g. tt and tt_mc.
tt would then do '.param MC_SWITCH=0' and tt_mc '.param MC_SWITCH=1'.
I agree you need to have a per model mc_switch parameter then.