I have a sky130 ngspice netlist with the MOSFETs d...
# analog-design
p
I have a sky130 ngspice netlist with the MOSFETs defined as "X0 Y A GND SUB nmos_3p3 w=37 l=10" . Unfortunately the characterization engine does not support transistors as X yet, so I tried to rename it to "M0 Y A GND SUB nmos_3p3 w=37 l=10" which seems to work. What is the difference between X and M? Should it simulate correctly that way? Why is Sky130 using X instead of M?
j
"M" means use one of the built-in MOS models. "X" means that there is a subcircuit defined somewhere (probably including various components including one or more "M"s). You need to include a file that defined the "nmos_3p3" subcircuit
p
I have included the necessary include filesz that's not the problem. What I am wondering is whether simulating with M will give the same results as with X for nmos_3p3
j
It is interesting that the model and the subcircuit have exactly the same name, though I suppose it isn't confusing for Spice. In theory the subcircuit simulation should be better since it adds components like parasitic capacitors and resistors to the model
p
Ok, so I should get roughly similar results, the difference is just the capacitors/resistors? That sounds good.
Hmm, so the simulation time for M might be faster than X?
j
Yes, just the model should be faster
p
That's even better, then I can provide a faster variant too. Thanks a lot for the explanation!
j
You can find the subcircuit in the included file (a .lib?) and see what you will be missing by not using it
In the case of Sky130 there will be several levels of .include so it takes some searching to find the subcircuit
p
Is there a way to flatten a spice netlist?
l
Try using the
listing
command inside your spice. It will output the flattened netlist of everything