Hello, is it possible to do Monte Carlo simulation...
# xschem
e
Hello, is it possible to do Monte Carlo simulations using Xschem/NGspice and sky130 transistors ? If yes, how to do it please ?
d
Attached is sample code measuring dvth of a LVT NMOS. **************************************************** .control save all let run = 1 dowhile run <= 100 reset * 1. DCOP ANALYSIS * op *let vth_meas = @m.xdut.xm1.msky130_fd_pr__nfet_01v8[vth] let vth_meas = @m.xdut.xm1.msky130_fd_pr__nfet_01v8_lvt[vth] *let vth_meas = @m.xdut.xm1.msky130_fd_pr__nfet_01v8_hvt[vth] echo "$&vth_meas" >> vth_measures.txt remzerovec * need to set appendwrite to accumulate the vth's from all runs * in one file. THIS MEANS YOU MUST ENSURE FILE "vth_measures.txt" IS * DELETED FROM THE RUNDIR PRIOR TO RUNNING THIS LOOP. Otherwise * MC data from an older analysis will corrupt the results from your * current analysis. For best practice you should also delete file * "tb_MC_PMOS.raw" to save diskspace. set appendwrite set filetype=ascii write tb_MC_NMOS.raw * release the memory holding the output data sets (good memory management) destroy all let run = run+1 end setplot quit 0 .endc
of course, you must include the mc models at the start: .lib /home/slice/pdk/SW130/share/pdk/sky130A/libs.tech/combined/sky130.lib.spice tt_mm
r
@Diarmuid Collins if you put the
set appendwrite
after the first write you don't need to remove the file anymore before running as it will get overwritten by that first call
d
That makes usage a bit easier for me @Roel Jordans. Thanks for sharing.
e
Ok, thanks for the help