Can I get a clarification on `.param mc_mm_switch=0`. I think it's only required when I'm using the ...
m
Can I get a clarification on
.param mc_mm_switch=0
. I think it's only required when I'm using the sky130 libraries? Are there any docs about what it does? Also, I have 2 computers, one needs the param set to simulate, the other doesn't. Both are using the same xschem and pdk version.
h
From the name, it has something to do with enabling Monte Carlo variations in the models. What it does EXACTLY is only clear when looking into the model files.
s
@Matt Venn when you add the
.lib /.../.../pdk/sky130A/libs.tech/ngspice/sky130.lib.spice tt
the specified corner (
tt
) is read from the file:
Copy code
* Typical corner (tt)
.lib tt
.param mc_mm_switch=0
.param mc_pr_switch=0
* MOSFET
.include "corners/tt.spice"
* Resistor/Capacitor
.include "r+c/res_typical__cap_typical.spice"
.include "r+c/res_typical__cap_typical__lin.spice"
* Special cells
.include "corners/tt/specialized_cells.spice"
.endl tt
You see the .lib file sets the montecarlo / mismatch switches to zero. The
tt_mm
mismatch corner sets one of these switches:
Copy code
* Typical corner with mismatch (tt_mm)
.lib tt_mm
.param mc_mm_switch=1
.param mc_pr_switch=0
* MOSFET
.include "corners/tt.spice"
* Resistor/Capacitor
.include "r+c/res_typical__cap_typical.spice"
.include "r+c/res_typical__cap_typical__lin.spice"
* Special cells
.include "corners/tt/specialized_cells.spice"
.endl tt_mm
and the Montecarlo corner (
mc
) sets the other:
Copy code
* Monte Carlo process variation

.lib mc

.param mc_mm_switch=0
.param mc_pr_switch=1

.include "parameters/critical.spice"
.include "parameters/montecarlo.spice"

.endl mc
So as far as I know you should not need to set these parameters yourself.
m
Thanks Stefan. It's odd that on my PC I have to set one or the sim fails. On the laptop I don't.
s
@Matt Venn very likely on one pc the .spiceinit file is missing. This file must be present in the directory where ngspice runs and should contain the following lines:
Copy code
set ngbehavior=hsa
set ng_nomodcheck 
set num_threads=4
The last line is optional, The first one is very important, since it tells ngspice the .lib file format to use (hspice-like)
m
good idea, but I have it commited to my repo to avoid this
👍 1