Hi all, I would like to know what is the best met...
# analog-design
p
Hi all, I would like to know what is the best method to run multiple process corner simulations. From what I understand, you can generate the netlist file for a typical process corner and then modify the model files in the netlist in order to generate all the other desired process corner netlists. Then you need to run each netlist individually using ngspice in order to get the results. Of course all of this can be automated with some scripting. Is there a way to avoid all that and just define somehow multiple corner simulations inside xschem or inside a single netlist? Also, if the method described above can not be avoided, is there a way to gather all the results generated by the individual ngspice runs in a single raw file? Thanks
s
for the last question, yes, you can append simulation results onto the same raw file by setting
set appendwrite
before the write instruction, typically:
Copy code
.control
  let run=0
  dowhile run <= 100
    save all
    tran 1n 4000n uic
    remzerovec
    write tb_bandgap_opamp.raw
    set appendwrite
    **** change something in the circuit
    alterparam par=val
    reset
    let run = run + 1
  end
.endc
πŸ‘ 1
l
The answer is scripting. I don't know if is there any simulation manager GUI available. In my case, I write a template netlist .sp and I run a TCL script to create a single netlist for each corner, as a numbered netlist .spN. Here is a example of testbench for AC measurements of an amplifier I've designed. I'll make the entire project available later.
πŸ‘ 1
Mabrains also have some python scripts for corner simulations. Check this bandgap circuit simulation https://github.com/mabrains/PLL_design/blob/main/pll_int/BGR/testbench/scripts/corners/run_corners.py
πŸ‘ 1
c
I have also written my own custom little python toolkit to solve the problem. But it is solved as you say or Luis has mentioned by modifying the netlist. I have also integrated xschem into the process, such that the netlist is exported from xschem by the commandline interface. The same goes for more complicated parametric sweeps, where the ngspice control language becomes to cumbersome to use. This comes of course with a speed penalty because you start with a new netlist/ngspice process that will reload the PDK also.
πŸ‘ 1
p
Thanks a lot guys. Very useful information πŸ˜€