is there any tutorial on how to connect ngspice to...
# sky130
h
is there any tutorial on how to connect ngspice to sky130 ?
l
Install Open PDKs The create ngspice testbenches with include statements pointing to the Open PDKs ngspice folder, like this:
Copy code
* Include SkyWater sky130 device models
.lib "/usr/share/pdk/sky130A/libs.tech/ngspice/sky130.lib.spice" tt
.param mc_mm_switch=0
t
Hi @User Thank you for posting the example ngspice simulation. I've tried to run it myself but ngspice errrors out right away. I'm new to ngspice. Could you tell me what might be wrong here? I know that my links to the models are correct. Warning: Model issue on line 0 : .model x1:sky130_fd_pr__nfet_01v8__model.58 nmos lmin=1.0e-06 lmax=2.0e- ... unrecognized parameter (numparm__________000000bb) - ignored unrecognized parameter (numparm__________000000bc) - ignored unrecognized parameter (numparm__________000000bd) - ignored Doing analysis at TEMP = 27.000000 and TNOM = 27.000000
l
https://github.com/google/skywater-pdk-libs-sky130_fd_pr/blob/f62031a1be9aefe902d6[…]6/cells/nfet_01v8/tests/sky130_fd_pr__nfet_01v8__nfet_vth.spice This example only runs if you run it in the command line inside the folder where the example is located in your computer.
Copy code
* Include SkyWater sky130 device models
.include "../../../models/r+c/res_typical__cap_typical__lin.spice"
.include "../../../models/r+c/res_typical__cap_typical.spice"
.include "../../../models/corners/tt.spice"
This code here has relative paths. This might be your mistake. The code with the PDK should run with no problems unless a new update broke it.
Copy code
* CMOS inverter testbench

* Include SkyWater sky130 device models
.lib "/usr/share/pdk/sky130A/libs.tech/ngspice/sky130.lib.spice" tt
.param mc_mm_switch=0

.param pVDD = 3.3

VDD vdd 0 dc {pVDD}
VSS vss 0 0

.subckt inv in out vdd vss
XP out in vdd vdd sky130_fd_pr__pfet_g5v0d10v5 ad=4e+11p pd=2.8e+06u as=4e+11p ps=2.8e+06u w=1e+06u l=500000u m=3
XN out in vss vss sky130_fd_pr__nfet_g5v0d10v5 ad=4e+11p pd=2.8e+06u as=4e+11p ps=2.8e+06u w=1e+06u l=500000u m=1
.ends 

vin in vss 0
* DUT
X0 in out vdd vss inv


.option gmin=1e-15
.option scale=1e-6

.control

    dc vin 0 3.3 10m
    plot in out
    
.endc

.end
Try this. This only works with Open PDKs installed, as it install all the spice models in
Copy code
.lib "/usr/share/pdk/sky130A/libs.tech/ngspice/sky130.lib.spice" tt
t
Thank you, I have it working now. Looking at my log files, I noticed I was missing .param mc_mm_switch=0.