Open mithro opened 4 years ago
FYI - This is probably blocking the skywater low level primitive release.
If you do parasitic capacitance extraction, you get behavior that is non-deterministic based on pointers to memory in a hash table. This is something different. You are getting a different pin order on your output. The extracted output pin order in the layouts should be enforced by doing "readspice" in magic to pull a CDL or SPICE file that has the pin order in it (only SPICE netlists require a specific pin order) and use that pin order to annotate the layout view with port indexes that match that pin order. But I thought you were doing this? Or is there no CDL or SPICE entry for the device sky130_fd_pr_rf2__rf2_xcmvpp6p8x6p1_polym4shield? The pin order here does make a difference, as C0 and C1 are the capacitor ports, but M4 is the metal shield, so scrambling them is bad.
I think I answered that question; only the "_top" cell has a SPICE file associated with it. So magic is free to use whatever pin order it decides on. I believe we talked about enforcing an alphabetical order by default so that it is consistent between runs. I will work on this.
@mithro : What is the source file that the above SPICE file is derived from?
@mithro : More research. . . If these cells come from the "vcells" files, then the problem is a disconnect between the original GDS file and CDL file. The GDS has cell name "s8rf_xcmvpp6p8x6p1_polym4shield" and has pins "c0", "c1", "c2", and "sub". The CDL has cell name "xcmvpp6p8x6p1_polym4shield" and has pins "pin0", "pin1", "pin2", and "pin3'. If the CDL source is corrected, then the "readspice" should work correctly for that cell, and the errors should go away.
@mithro : Even more research. . . The real underlying problem is that the SPICE for the lowest level device, which is xcmvpp11p5x11p7_m3_lishield, is in the device models under "xcmvpp_pqonly.mod". It is listed there as "inline subckt". There is still a discrepancy between the names in the GDS and .mod files, but I'm assuming that the usual regeneration of everything with the sky130_fd_pr_rf prefix will resolve that? If so, then the remaining problems are in converting SPECTRE to SPICE. The "inline subkt" line in the model will not be recognized by ngspice, and the SPECTRE-to-ngspice conversion must map this to a standard ".subckt" subcircuit. Once that is done, then the "readspice" script can read the subcircuit and use that to annotate the port order of the layout, so that the output of the device top will match the subcircuit definition. This depends on my working on the SPECTRE to SPICE conversion.
@RTimothyEdwards -- So it sounds like there are two issues; (a) Magic output not being deterministic (b) Something around reading the CDL files?
@mithro : Yes. Although there is no non-determinism if everything else is being done correctly. I would suggest that the non-determinism is best left as it is, as it is helping to flag other problems. The other problem is actually two problems in itself: (1) The names still disagree between layout and SPICE, and (2) The SPICE is in SPECTRE format so I can't read it. For (2), I could enhance the "readspice" command so that it can read the SPECTRE "inline subckt" syntax. However, it remains true that we need to convert these to SPICE anyway. So, my suggestion is to get the SPECTRE format converted to SPICE, then resolve the differences in names, and after that the rest of building the PDK IP library for sky130_fd_pr_rf2 should work.
The immediate pin ordering problem has been solved by extending the "port" command with the option "port renumber", which numbers all ports in the edit cell by alphabetical (strcmp) order.
@RTimothyEdwards So, I should use "port renumber" if I don't have a CDL file with the port order?
@mithro : Yes, although it should be okay to use "port renumber" regardless, since reading the SPICE or CDL file will just renumber it again. Just don't renumber the ports after reading a SPICE or CDL file.
Given the exact same input, magic produces non-deterministic spice output.
This seems to be because something is being sorted by the pointer location?
This can be most clearly seen from the following where the pin order changes from
MET5 C1 C0 SUB
toC0 C1 MET5 SUB