Can we inport spice models in the schem so we can ...
# sky130-pv-workshop
m
Can we inport spice models in the schem so we can create test bench faster ? So we can play with the lab exercise day2 l4? I am not familair with ngspice and I will ned more time to learn it. Thanks
k
this will be a question to @Tim Edwards
t
I forget what the path is to the PDK (so I use "/path/to" below), but you need in the SPICE netlist, the line
Copy code
.lib /path/to/sky130A/libs.tech/ngspice/sky130.lib.spice tt
This loads all of the models for simulation, so should be able to simulate any device that is in the
sky130_fd_pr
symbol library.
m
this is my spice code here I do not know the structure or what element is missing:
x1 A B GND in1 in2 VDD out sky130_fd_sc_hd__and2_1 V1 in1 GND PWL(0 0 20n 0 900n 1.8) V2 in2 GND 1.8 V3 VDD GND 1.8 .lib /usr/share/pdk/sky130A/libs.tech/ngspice/sky130.lib.spice tt .control tran 1n 1u plot V(in1) V(in2) V(out) .endc .ends * NGSPICE file created from sky130_fd_sc_hd__and2_1.ext - technology: sky130A .subckt sky130_fd_sc_hd__and2_1 A B VGND VNB VPB VPWR X X0 VPWR B a_59_75# VPB sky130_fd_pr__pfet_01v8_hvt ad=0p pd=0u as=0p ps=0u w=420000u l=150000u X1 X a_59_75# VPWR VPB sky130_fd_pr__pfet_01v8_hvt ad=0p pd=0u as=0p ps=0u w=1e+06u l=150000u X2 VGND B a_145_75# VNB sky130_fd_pr__nfet_01v8 ad=0p pd=0u as=0p ps=0u w=420000u l=150000u X3 a_59_75# A VPWR VPB sky130_fd_pr__pfet_01v8_hvt ad=0p pd=0u as=0p ps=0u w=420000u l=150000u X4 X a_59_75# VGND VNB sky130_fd_pr__nfet_01v8 ad=0p pd=0u as=0p ps=0u w=650000u l=150000u X5 a_145_75# A a_59_75# VNB sky130_fd_pr__nfet_01v8 ad=0p pd=0u as=0p ps=0u w=420000u l=150000u .ends .end
Ijust edited the spice file generated from layout
t
The "proper" way would be to write a separate testbench netlist and
.include
the netlist generated from layout. But the hand-edited netlist you show above should work (assuming an install path of
/usr/share/pdk
).