Hello everyone. I have trying, several times and b...
# sky130
f
Hello everyone. I have trying, several times and by different ways, to simulate (in Ngspice) process montecarlo using
.lib '<sky130A_path>/models/sky130.lib.spice mc'
. All the other simulations, nominal and local mismatch work properly by using`.lib 'sky130A_path/models/sky130.lib.spice tt_mm'`. When I set "mc" I am obtainng the following error (if I change the device, for example standard nmos, I get the same error for other device. ====== Error log =========================================== option SCALE: Scale is set to 1e-06 for instance and model parameters Error on line: m.xm3_0.msky130_fd_pr__nfet_01v8_lvt vdd_0 gate_0 gate_0 0 xm3_0:sky130_fd_pr__nfet_01v8_lvt__model l= 8.900000000000000e-01 w= 1.284000000000000e+01 nf= 1.000000000000000e+00 ad= 3.723600000000000e+00 as= 3.723600000000000e+00 pd= 2.626000000000000e+01 ps= 2.626000000000000e+01 nrd= 0.000000000000000e+00 nrs= 0.000000000000000e+00 sa= 0.000000000000000e+00 sb= 0.000000000000000e+00 sd= 0.000000000000000e+00 could not find a valid modelname Simulation interrupted due to error! ====== My netlist sims_net01.sp =============================
Copy code
*SKY 130 nm LIBS
.lib '<sky130A_path>/models/sky130.lib.spice mc'
.option scale=1u

*Parameters

*DC Sources
V_dd vdd 0 dc=1.0 ac=1 PWL(0 0 5.00e-04 0 1.50e-03 1.00e+00)
V_dd_0 vdd vdd_0 dc=0

*Circuit 0:
XM3_0 vdd_0 gate_0 gate_0 0 sky130_fd_pr__nfet_01v8_lvt w='12.84' l='0.89'
+ ps='2*(0.290+12.84)' pd='2*(0.290+12.84)' 
+ as='0.290*12.84' ad='0.290*12.84'
XM2_0 gate_0 gate_0 vref_0 0 sky130_fd_pr__nfet_01v8_lvt w='1.72' l='3.10'
+ ps='2*(0.290+1.72)' pd='2*(0.290+1.72)' 
+ as='0.290*1.72' ad='0.290*1.72'
XM1_0 vref_0 gate_0 0 0 sky130_fd_pr__nfet_01v8 w='0.82' l='1.05'
+ ps='2*(0.290+0.82)' pd='2*(0.290+0.82)' 
+ as='0.290*0.82' ad='0.290*0.82'

*Analysis
.options gmin=1.00e-16 reltol=1.00e-03 vntol=1.00e-05 abstol=1.00e-14 temp=2.00e+01
.end
====== Montecarlo control ======================================
Copy code
.options seed=random
.control
    let mc_runs = 10  $ number of runs for monte carlo
    let run = 1             $ number of the actual run
    define gauss(nom, var, sig) (nom + (nom*var)/sig * sgauss(0))
    define agauss(nom, avar, sig) (nom + avar/sig * sgauss(0))
    dowhile run <= mc_runs
        set run = $&run
        if run = 1
            source $inputdir/../netlists/sims_net01.sp
        else
            mc_source
        end
        dc temp -40 80 20
        write $inputdir/../results/sims_net01_{$run}.raw
        destroy all                   $ delete all output vectors
        let run = run + 1             $ increase loop counter
    end
    quit
.endc
.end
l
.param mc_mm_switch=1 Try this. Anyway, tt_mm corner is already what you need, which is a monte carlo run with local mismatch for typical corner.
f
Hi Luis. Thank you for your reply, but the flag .param mc_mm_switch=1 is already defined inside the library sky130.lib.spice mc, more specificcly it call the following:
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
For specific reasons of our project, we need to simulate montecarlo of global process variability.
l
Something you could do as a workaround is create a copy of a corner which already works and change those parameters by hand. I had similar kinds of errors like that before because this parameter was not set. I don't know if this bug was already fixed, but mc sims didn't work if the w and l of the transistors were not the ones specified in the bin files.
🙌 1
f
Hi Luis. You found the reason to fail my simulation. I am setting W and L outside of what is specified in the bin files. I checked this by using all devices with W=1 and L=1, and it works. The problem is that I need to simulate outside of bins. I will try to understand the other way that you are proposing, by setting manually the corner. Thank you very much for your help.
l
https://lci.ufsc.br/pdf/_00309905.pdf Consider using transistor arrays, if you need a specific w/l. This way you can still use the bin transistor dimensions.
n
Hi @Fabián Olivera, For Monte carlo simulation use the models provided in
/sky130A/lib.tech/combined/sky130.lib.spice mc.
They are defined for bigger transistor sizes and they are continuous models. For running simulation keep the .
param mc_mm_switch=1
.
f
Thank you very much @naina singhal! it works perfectly!
👍 1
l
@Luis Henrique Rodovalho you must compile a list of your favorite papers! That link is fantastic