<@U016EM8L91B> for some reason the `tt_mm` corner ...
# sky130
s
@Tim Edwards for some reason the
tt_mm
corner does not show any mismatch in devices. Below
test_comparator.sch
schematic, part of the
xschem_sky130
test circuits does not show any variation. The waveform is actually an overlay of 40 runs, they are all identical. It used to work in the past, showing differences in the output waveform per each run. The netlist calls the
sky130.lib.spice lib
with
tt_mm
corner. Do I need to set some switches or parameters? Netlist attached as well.
k
@Stefan Schippers I am struggling with the same issue here, even in much simpler case of a voltage divider. Until now I've got any variations.
VoltageDividerMM.spice,mm.txt
t
@Stefan Schippers: Is the behavior different if you run ngspice multiple times instead of getting results from a
while
loop?
I'm wondering if
reset
goes back to the same random seed due to the
option seed
command.
I guess I should take at face value the comment that it used to work and assume that something broke.
It is the parameter setting
MC_MM_SWITCH
that controls whether mismatch is turned on or not. It is always multiplied by the
agauss(.)
function, so that
MC_MM_SWITCH=1
randomizes the values and
MC_MM_SWITCH=0
does not. The
MC_MM_SWITCH
in device model parameter expressions is found throughout the files in
$PDK_ROOT/sky130A/libs.ref/sky130_fd_pr/spice/
. I don't see anything obviously wrong there, but I need to reinstall the PDK from scratch, since for open_pdks regressions can come from many different sources.
k
Hi @Tim Edwards, I have took a look at the resistor model in the directory You've mentioned however haven't found the
MC_MM_SWITCH
. The only think which relates to the eventual mismatch modelling is this commented part. Is that right ?
Copy code
* SKY130 Spice File.
* statistics {
*       mismatch {
*       }
*         process {
*               vary sky130_fd_pr__res_xhigh_po__var_mult dist=gauss std=0.025
*               vary sky130_fd_pr__res_high_po__var       dist=gauss std=0.025
*         }
* }
t
@Krzysztof Herman: That's Spectre syntax. It's commented out because we didn't have time to figure out how to convert it to something ngspice-compatible at the time we generated the skywater-pdk repository. I commented out the lines but left them in so that the data would be available to make the conversion to ngspice syntax, which is what I'm doing in open_pdks. That said, it looks like the example you posted, for the xhigh_po and high_po resistors, does not get converted to an
agauss()
function anywhere. So that is probably what I need to track down.
k
understood, thank You!
I suppose the model definition should contain something similar to this line
Copy code
toxe = {3.996598e-09+MC_MM_SWITCH*AGAUSS(0,1.0,1)*(4.148e-9*0.9635*(sky130_fd_pr__nfet_01v8__toxe_slope/sqrt(l*w*mult)))}
c
I don't know if this helps you, but bminch has made a video on this topic. I have modified my PDK succesfully with the script that he presents to run monte carlo simulations.

https://www.youtube.com/watch?v=fGxs2TnDgrU

k
@Christoph Weiser, thanks I will give a try!
t
Somebody please ping me on Tuesday. I want to take an in-depth look at the problem and get a fix out as soon as I can, but I'm traveling and won't be able to get around to it in the next two days.
k
@Tim Edwards ok, I will remind You about the issue, have a nice trip!
s
Thanks @Tim Edwards for your investigations.
@Tim Edwards the while loop and the reset instruction does not reset the random number generator seed. In the test_comparator.sch i have (commented out) also an agauss() parameter for the VCC so each run would get a different VCC. I see VCC variations if i uncomment this agauss() parameter, so the MOS transistors not showing mismatches is probably due to some parameter switch, may be the MC_MM_SWITCH you mentioned.
@Tim Edwards looking into the spice model files it seems that
tt_mm
lib does set
MC_MM_SWITCH = 1
, so i don't know why we still see no mismatch variations in multiple runs. * 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
Setting a voltage source to value 'MC_MM_SWITCH' i see it has value '1' so the parameter is correctly set at simulation runtime.
@Tim Edwards I have a small script that starting from
sky130.lib.spice
displays content of all included files. Looking into this flattened big file there are
agauss()
functions only for resistors and for some sonos cells. so it is not surprising i see no variations. I see lot of
agauss()
parameters in file
.../libs.ref/sky130_fd_pr/spice/sky130_fd_pr.spice
which however does not seem to be included. May be we are in the middle of some big transition or change? Will update my open_pdks if you tell me to do so... Thanks
t
@Stefan Schippers: There should not be such a file
sky130_fd_pr.spice
.
@Stefan Schippers: What version of open_pdks do you have, and how was it built?
l
There is a bug with monte carlo simulations. The simulator doesn't update the seeds between simulations that runs with less than 1 second. If you make another long simulation inside the loop, like a transient one, it should change the values.
https://github.com/RTimothyEdwards/open_pdks/issues/201 See this thread. There are lots of repeated results, because there was not enough time between the simulations to change the seed.
s
@Tim Edwards I have built open_pdks from commit:
Copy code
commit 3a2a72e112d12771f528ed8b79b799222728e7eb (HEAD -> master, tag: 1.0.316, origin/open_pdks-1.0, origin/master, origin/HEAD)
Author: Tim Edwards <tim@opencircuitdesign.com>
Date:   Mon Jun 27 14:08:22 2022 -0400
doing the usual:
./configure --enable-sky130-pdk --prefix=/home/schippes
followed by
make && make install
. I have these files, both in the source tree and in the installed paths:
Copy code
schippes@mazinga:~/sda7/open_pdks$ locate sky130_fd_pr.spice
/mnt/sda7/home/schippes/open_pdks/sky130/sky130A/libs.ref/sky130_fd_pr/spice/sky130_fd_pr.spice
/mnt/sda7/home/schippes/open_pdks/sky130/sky130B/libs.ref/sky130_fd_pr/spice/sky130_fd_pr.spice
/mnt/sda7/home/schippes/share/pdk/sky130A/libs.ref/sky130_fd_pr/spice/sky130_fd_pr.spice
/mnt/sda7/home/schippes/share/pdk/sky130B/libs.ref/sky130_fd_pr/spice/sky130_fd_pr.spice
I think it's time to redo a new full install :-)
t
@Stefan Schippers: I can confirm the presence of that file on doing a complete rebuild. My best guess is that some recent rework of the code in foundry_install.py has somehow caused it to believe that the "compile" option is always on. I'll debug it on my flight home today.
👍 1
k
Hi, @Tim Edwards I hope You are back home, I send You reminder about the issue we have with mc_mm simulations, regards