Hello, is it possible to do Monte Carlo simulations using Xschem/NGspice and sky130 transistors ? If yes, how to do it please ?
d
Diarmuid Collins
02/03/2025, 7:18 AM
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
Diarmuid Collins
02/03/2025, 7:19 AM
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
Roel Jordans
02/03/2025, 9:28 AM
@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
Diarmuid Collins
02/03/2025, 7:09 PM
That makes usage a bit easier for me @Roel Jordans. Thanks for sharing.
Linen is a search-engine friendly community platform. We offer integrations with existing Slack/Discord communities and make those conversations Google-searchable.