Hello All Any idea on how to run mismatch simulations in ngspice for sky 130 based netlist??
a
Hello All Any idea on how to run mismatch simulations in ngspice for sky 130 based netlist??
l
Check this. https://github.com/lhrodovalho/AICSP2022RAIL/blob/main/lib/amp/ngspice/tb_ol_ac_df_mc.spice You must enable the mismatch models with this line in your testbench.
.param mc_mm_switch=1
The you run your sim multiple times with loop. You can save the results in an external file.
👍 1
s
@Abhishek Anand (@Luis Henrique Rodovalho) Calling the .lib with
tt_mm
corner will enable mismatch. (will set
mc_mm_switch=1
) In the
sky130.lib.spice
file:
Copy code
...
...
* Typical corner with mismatch (tt_mm)
.lib tt_mm
.param mc_mm_switch=1
.param mc_pr_switch=0
* MOSFET
.include "corners/tt.spice"
* Resistor/Capacitor
.include "r+c/res_typical__cap_typical.spice"
.include "r+c/res_typical__cap_typical__lin.spice"
* Special cells
.include "corners/tt/specialized_cells.spice"
.endl tt_mm
...
...
Setting
.param mc_mm_switch=1
and calling the .lib with
tt
corner is risky since if the ,lib is sourced after the .param it will reset the mc_mm_switch parameter back to zero.
Copy code
...
...
* Typical corner (tt)
.lib tt
.param mc_mm_switch=0
.param mc_pr_switch=0
* MOSFET
.include "corners/tt.spice"
* Resistor/Capacitor
.include "r+c/res_typical__cap_typical.spice"
.include "r+c/res_typical__cap_typical__lin.spice"
* Special cells
.include "corners/tt/specialized_cells.spice"
.endl tt
...
...
👍 1
l
@Stefan Schippers I guess
.param mc_pr_switch=0
is for process (global) mismatch. Lately I'm only simulating my circuits with GF180 PDK, and I usually set those parameters outside the '.lib' line. Is there a corner for global mismatch only, or both enabled at the same time, for SKY130 PDK?
s
there is one corner, '`mc`' which sets:
Copy code
.param mc_mm_switch=0
.param mc_pr_switch=1
this is for process (global) variation. The **__mm corners (tt__mm, ss_mm, sf_mm, ....) have the opposite setting:
Copy code
.param mc_mm_switch=1
.param mc_pr_switch=0
I don't see a corner where the two flags are both set to 1.
👍 1
t
I didn't implement a specific corner with both flags enabled; if you really want that, you can make a copy of the
.lib
file and define both flags. Usually, though, the mismatch analysis is done on corners, not with monte carlo analysis, which uses an entirely different set of include files and parameters.
👍 1
a
Thank you all for the inputs . is there any direct way to find energy consumption in ngspice?
s
@Abhishek Anand you can save the currents of all voltage supplies, multiplying by the vplyage and integrating over time gives the energy consumption. see alsothe ngspice user manual: 15.6.5.3 Measurement of power dissipation in a device
a
@Stefan Schippers yeah thank you . It's mentioning about the power dissipation . How to integrate the current so as to get energy dissipation.
Got it 15.4.8 . Some INTEG function is present
s
This message contains interactive elements.
🙌 1