Hi All. Running a TT sim in xschem/sw130 using TT ...
# xschem
d
Hi All. Running a TT sim in xschem/sw130 using TT models (taken from code.sym in the top.sch landing page for this pdk, as shown below). I can run ss/sf/fs/ff models separately. How do I run them in the the same sim so that I can sweep across process? Does anyone have an example where they do something like this which would kick off 5 model corners simultaneously, ideally outputting all the results in a format that could be read into a spreadsheet which allows me to tabulate performance across corners. Txs
s
Currently as far as I know there is no mechanism in ngspice that allows to
ALTER
or modify the netlist model process corner and re-run a simulation. So far the best that can be done is to change the netlist by replacing the process corner , adding
set appendwrite
before the
write
command, running the simulation again so the next corner data is appended to the previous raw file. A more efficient way is to run all corner simulations in parallel, each process writing to a separate raw file. The following launcher will poke into the produced netlist to change process corner and output raw filename , running 3 simulations in parallel on corners tt, ss, ff:
Copy code
tclcommand="
set spicefile $netlist_dir/sky130_oscillator.spice
xschem netlist
simulate
after 1000 ;# wait 1sec for ngspice to start and read netlist
# change corner and output raw filename
exec sed -i {/^\.lib/s/tt/ff/} $spicefile
exec sed -i {s/sky130_oscillator.raw/sky130_oscillator_ff.raw/} $spicefile
simulate
after 1000 ;# wait 1sec for ngspice to start and read netlist
# change corner and output raw filename
exec sed -i {/^\.lib/s/ff/ss/} $spicefile
exec sed -i {s/sky130_oscillator_ff.raw/sky130_oscillator_ss.raw/} $spicefile
simulate
"
NOTE: if you don't have enough processor cores it may be faster to run one simulation after the other.
d
Thanks Stefan. This launcher looks very interesting. I'm going to try that in addition to posting this question on the ngspice forum. Will update this thread as I go.
@Stefan Schippers: Do you have a similar flow for MC analysis? Or to anyone else reading this thread, how do other people perform MC analysis over say 200 runs? Thanks
s
MonteCarlo simulations are the ideal candidates to spread runs on multiple machines. However I haven't tried this and usually in my simple examples I simulate all MC runs one after the other using a single ngspice instance. Running more ngspice instances is tricky since you want to have non overlapping samples. May be Xyce has some more sophistication for that, but just my speculation.
d
Interesting. My plan here would be to implement MC analysis using the examples provided in section 22.5 of the ngspice manual. Provided Im able to apply gaussian distributions to the various device parameters, which seems I am, given that you have performed MC analysis on single ngspice instances, I expect to be able to run MC analysis on full blocks. The question of compute power is always one linked closely with MC analysis. To me thats another issue (one which I will need to purchase an external server for) but for the time being, I will try things out on a simple 5T OTA to pipeclean the flow. Will update this thread with results / progress. Before that however I want to successfully implement the .tcl script you have kindly provided for PVT analysis. So thanks for that.
for the benefit of others reading this thread, Stefans .tcl script is very powerful in that it enables us to create corner groups. Attached is a corner group I created for a fully PVT sweep. Attaching it for reference should anyone need to do a similar task.
again for the benefit of future readers, I have created an octave script which reads in all the data produced over a PVT run and summarises it in a single table (see below) like you get in commercial EDA tools. All required files to run this are checked into github at: https://github.com/SLICESemiconductor/OpenSourceTool_Examples/tree/main/PVT_corner_runs
s
@Diarmuid Collins the link does not work for me (web server err 404, page not found)
d
hmmm. let me look into that and get back to you