https://open-source-silicon.dev logo
Title
p

Philipp Gühring

03/14/2023, 7:19 PM
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

Jecel Assumpção Jr

03/14/2023, 8:06 PM
"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

Philipp Gühring

03/14/2023, 8:12 PM
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

Jecel Assumpção Jr

03/14/2023, 8:18 PM
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

Philipp Gühring

03/14/2023, 8:20 PM
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

Jecel Assumpção Jr

03/14/2023, 8:23 PM
Yes, just the model should be faster
p

Philipp Gühring

03/14/2023, 8:23 PM
That's even better, then I can provide a faster variant too. Thanks a lot for the explanation!
j

Jecel Assumpção Jr

03/14/2023, 8:24 PM
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

Philipp Gühring

03/14/2023, 9:28 PM
Is there a way to flatten a spice netlist?
l

Luis Henrique Rodovalho

03/14/2023, 9:31 PM
Try using the
listing
command inside your spice. It will output the flattened netlist of everything