<@U016EM8L91B> <@U017X0NM2E7> while reading openr...
# magic
a
@Tim Edwards @Mitch Bailey while reading openram memory macro gds files , i am encountered with these errors. Any idea on how to fix these?
m
@Abhishek Anand I believe these are non fatal errors that you can ignore.
t
@Abhishek Anand: What Mitch said. The magic tech file for sky130 doesn't implement the optical correction layers. Also, there are several layer:purpose types that describe boundaries. The documentation on these is scarce, and magic and OpenRAM are disagreeing on how they should be used. However, they are just boundary markers, so it's not a critical issue of any kind.
m
@Tim Edwards Should/are the optical correction layers being included in the final caravel gds?
m
@Mitch Bailey yes they are
t
@Mitch Bailey: Yes. Since the bit cells are part of the PDK, magic will always use the vendor GDS. I don't like to include the optical correction layers in magic because they aren't really user design layers. It takes special software to predict the diffraction effects, and I don't know of any open source software that does that. But it's worse than that, since SkyWater runs the optical correction software on all the mask layout, so the optical correction design layers are marking exceptions to the standard optical correction.
👍 1
a
@Mitch Bailey @Tim Edwards Thanks for the clarification. I am running the following commands in sequence. gds read filename select top cell flatten filename_flat load filename_flat cellname delete filename cellname rename filename_flat filename select top cell extract do local extract all ext2sim labels on ext2sim (Here I encountered with "cannot read filename.ext)? What could be the reason for this?
m
Are you trying to run parasitic extraction on the entire SRAM macro?
a
@Mitch Bailey Yes . Trying to do for entire SRAM macro
m
@Tim Edwards Can magic handle a flattened SRAM parasitic extraction?
t
@Mitch Bailey: Yes, it can. Takes something like 12 hours for the 1kB SRAM, but it can do it. What I have not been able to do is get ngspice to run the resulting netlist, but my computer's oom manager killed the process when I tried to install open_pdks at the same time, so maybe it would have finished given enough time.
👍 1
@Abhishek Anand: As far as I can tell, that sequence of commands should have worked.
extract all
should have produced
filename.ext
and I have never seen any example in which it didn't. Was there any output from
extract all
that might indicate that it didn't write a file?
FYI, Matt Guthaus sent me a "tiny" SRAM of 8 bytes created by OpenRAM that I could simulate from the full R-C extracted netlist and I was able to get meaningful results out of the simulation (e.g., I could see the column bit line pre-charging much slower in the simulation with the R-C extracted netlist than in the simulation of the netlist without parasitics).
a
@Tim Edwards after executing "extract all" magic didn't show any output indicating that it doesn't produced a file. I will run it once again and see
m
@Tim Edwards Can you share that with us? @Bugra Onal was extracting but only getting capacitances even though the resistance threshold was set to 0.
He also got some negative capactiances...
t
@Matthew Guthaus: You can't just set
rthresh
to get parasitic resistances. Magic's extraction has a very unusual "lumped resistance" model which calculates a single "effective resistance" for an entire net. This outputs as a single-pin resistor---a value R associated with a net such that R*C will yield the effective point-to-point delay through the net (which of course is wildly inaccurate for anything other than a net with two endpoints). Plus, there aren't any tools that I know of that know how to deal with a single-pin resistor. So the full R-C extraction has to be done with the following recipe (which is floating around several places in the slack workspace):
Copy code
load <cellname>
flatten <cellname>_flat -dotoplabels
load <cellname>_flat
cellname delete <cellname>
cellname rename <cellname>_flat <cellname>
select top cell
extract do local
extract all
ext2sim labels on
ext2sim
extresist tolerance 10
extresist
ext2spice lvs
ext2spice cthresh 1
ext2spice extresist on
ext2spice
This recipe also reflects the fact that the full R-C extraction isn't clearly meaningful when run on a hiearchical layout, and so it is necessary to flatten the entire layout first. For the 1kB SRAM, though, the cellnames were so long and the hierarchy was so deep that I had to use
flatten ... -dotoplabels
to prevent issues with net names becoming rediculously long (and crashing magic, although I fixed that specific issue). That makes it harder to find nodes in simulation, but I can do
getnode
in the (flattened) layout to find the name of any specific net I want to look at in the simulation. Over the course of a week or so, I managed to track down (almost) all of the issues that were causing negative capacitances (there were a surprising number of them that were all completely independent from each other). I think that on the "tiny" SRAM there were no negative capacitances the last time I ran. I also think that the 1kB SRAM still had a handful of small negative capacitances which I just removed from the netlist. I still need to do another round of debugging to track down the remaining source of negative caps. The capacitances come out negative because magic uses a method where it first computes the total parasitic capacitance of a wire to substrate, then subtracts off the portion that is shielded. If it doesn't do that accounting correctly and double-counts some area or counts some area it isn't supposed to, then it can end up subtracting off more than the original total amount. You will at least want to make sure you do the full R-C extraction using the most recent version of magic. I can share the netlists but they are very large, so I'd prefer to avoid posting them if you can duplicate the way they were generated.
🙌 1
a
@Tim Edwards @Mitch Bailey .ext file was not generated it seems. Any idea on how to resolve this?
t
@Abhishek Anand: That is unexpected. The extraction seems to have taken no time (did not report percentage progress, which I would expect for something the size of an SRAM. Did you look at the layout when it was doing extraction? The output is possibly consistent with a failure to start up with the correct tech file, but I can't tell that from a screenshot.
a
I am doing on a 16*2 SRAM macro. Just making sure whether it works on small macros. Any other information needed ? So that we can able to debug this?
t
@Abhishek Anand: Yes. As I said above, did you look at the layout when it was doing extraction? How long did the extraction take? I do recall seeing something weird recently, in which the .ext file output ended up in another directory. I have never seen that happen before or since, so I've been treating it as a one-off issue, but just in case, does the .ext file show up somewhere else?
Scratch that---The one thing that stands out here is the lack of any response to the "extract" command, like it was being ignored. Immediately after issuing the "extract" command, it should print:
Copy code
Extracting <cellname> into <cellname>.ext:
Playing around with it a bit, I find that the output you get is exactly equivalent to having no layout at all.
a
@Tim Edwards I am unable to debug that issue. I installed it entire setup in another system. Everything is working fine and i followed the same steps that you have mentioned above . After using the command cellname delete<cellname> A window pops up saying " some n number of magic cells have been modified do you want to delete these modified cells" what does it mean??I selected no and proceeded and finally got a spice netlist file with R and C values.
After executing the command "extract all" i got these warnings as well.
@Tim Edwards i can also see three negative capacitances. Btw I am using version 8.3.397 and doing extraction on 16*2 SRAM macro. Lines 12009 , 12051 ,12118 . -ve capacitances between VSUBS and some nodes.
t
@Abhishek Anand: The last time I did a full R-C extraction on something that size I also got a handful of negative capacitances, so there's still something wrong in magic's accounting of shielding. But I didn't see very many of them and they weren't very large, so for the moment I'm punting on investigating that error, and I suggest that you just delete the negative capacitances from the netlist.
@Abhishek Anand: The "asymmetric device" warnings are expected for the unorthodox layout in the SRAM core cell. There are ends of poly overlapping diffusion that create 1-terminal MOS capacitors. Magic reports these (rather cryptically) as asymmetric devices (source and drain are different, which is technically true because one of them is missing).
a
@Tim Edwards Yeah Sure .Thank you
@Tim Edwards BTW did you run any spice simulations on extracted SRAM macros to verify the functionality ? I am encountering these errors.
m
@Abhishek Anand the 2206q version of the single port sram has a short in the word decoder. But that’s not the problem you’re seeing. I think the problem you have is that there is no simulation model for the special device
sky130_fd_pr__special_nfet_pass
extracted in the single port memory cells. In the dual port version, this model is not extracted. @Tim Edwards will this require a rule modification?
t
@Mitch Bailey: There is a model for
nfet_pass
, and it exists in all memory cells. @Abhishek Anand: What statements are you using in your simulation to include the model files?
@Abhishek Anand: And FYI, yes, I have simulated a trivially small SRAM block in ngspice. Do not expect ngspice to be able to run on anything like a 1kB sized SRAM in any reasonable time.
m
Ok, sorry for any confusion. Maybe I’m using the wrong pdk
Copy code
$ volare ls
$PDK_ROOT/volare/sky130/versions
└── e6f9c8876da77220403014b116761b0b2d79aab4 (2023.02.10) (enabled)

$ ls $PDK_ROOT/$PDK/libs.ref/sky130_sram_macros/spice/*
$PDK_ROOT/sky130A/libs.ref/sky130_sram_macros/spice/sky130_sram_1kbyte_1rw1r_32x256_8.spice
$PDK_ROOT/sky130A/libs.ref/sky130_sram_macros/spice/sky130_sram_1kbyte_1rw1r_8x1024_8.spice
$PDK_ROOT/sky130A/libs.ref/sky130_sram_macros/spice/sky130_sram_2kbyte_1rw1r_32x512_8.spice
$PDK_ROOT/sky130A/libs.ref/sky130_sram_macros/spice/sram_1rw1r_32_256_8_sky130.spice

$ grep nfet_pass $PDK_ROOT/$PDK/libs.ref/sky130_sram_macros/spice/*

$
t
@Mitch Bailey: Devices won't be found in the SRAM library. You'll find them in
$PDK_ROOT/$PDK/libs.ref/sky130_fd_pr/spice/sky130_fd_pr__special_nfet_pass.pm3.spice
.
If you do the usual
.lib
with
sky130.lib.spice
and the corner, it should pick up all of the devices in the SRAM cell.
a
I used .lib to include files
@Tim Edwards yes it should work with .lib statement as it worked with pre extracted simulations. But I don't know why I encountered this error on post extracted simulation.
t
@Abhishek Anand: I think you're seeing an error that's due to an issue in magic when extracting one of the weirder geometries in the single-port SRAM layout. This problem was fixed in magic version 8.3.378 (March 13, so about 2 months ago).
The pre-layout netlist presumably used the netlist that is in the SRAM library, where those devices were just removed from the netlist (since they are just tiny parasitic MOScaps, the SRAM will simulate fine without them). The extraction problem is caused by the device missing a terminal, and magic subsequently screwing up the measurement of L and W.
a
I am using version 8.3.397 of magic
@Tim Edwards so what could be the possible solution to this?
t
@Abhishek Anand: In the screenshot above, the SRAM and its components are being read from
sky130_sram_0kbytes_1rw_2x16_None_flat.cir
. The incorrect size of
special_nfet_pass
devices is in the low-level single-port SRAM cell, so it must be defined in that file. When and how was that netlist created?
a
That netlist is created from magic . That netlist consists of extracted values of R and C as well.
We will be getting .spice file from magic . That was renamed into .cir format
t
It's the "tiny" SRAM, so the files aren't all that big. I have the same layout (unless it's been changed in the past month or so) with the same flattened R-C extraction, so I can do a direct comparison. Can you please post the GDS and the netlist (feel free to post me in a private message if you don't want to broadcast the GDS to everyone in the Slack workspace)?
Okay. There was an issue that I totally forgot about, and now it's coming back to me! The problem originates somewhere in OpenRAM, so it's worth nailing the issue down and getting rid of the problem at the source. I saw this on the "tiny" (2x16) SRAM (I note that this one is even tinier), fixed it, and then forgot about the fix.
The issue of the weirdly extracted nfet_pass devices can be seen if you load the layout (any of the recent SRAM layouts from OpenRAM) into magic and then load this cell:
sky130_fd_bd_sram__sram_sp_colenda
. A screenshot is attached. In the bottom corner is a label "vnb". There are some very curious things about this label. If you select the pwell around this label and select the entire net, you'll find that the pwell and the nwell are merged together in the same net. If you select the label and type
port index
, you'll get an error message saying that you can select only one label at a time. It is impossible to see from the view in magic, because it absorbed and merged various layers on reading in the GDS, but if you do an ASCII dump of the GDS of
sky130_fd_bd_sram__sram_sp_colenda
, you'll find that text vnb is placed on layer 64:5 (nwell) at coordinate (1.050, 0.150), and also on layer 64:59 (pwell) at coordinate (1.050, 0.140). The surrounding rectangle is simultaneously on GDS layers 64:16 (nwell pin), 122:16 (pwell pin), and 64:20 (nwell). The parts of this that are related to nwell are all wrong; pin vnb should exist only on pwell. When reading in the GDS, magic is finding an nwell square underneath an nFET transistor, which is incompatible, and not having any recipe for what to do with that illegal combination of layers, part of it gets erased. Ultimately the nwell gets erased but both labels continue to exist (although very hard to tease apart in magic), so vnb ends up making a virtual short to nwell (which will, of course, totally screw up the netlist), and the messed-up transistor is too weird for the extraction engine to figure out, so it ends up with a strange width and length. Bottom line---Somewhere in OpenRAM you're generating label vnb simultaneously on pwell and nwell, and the nwell part of that needs to be removed.
@Abhishek Anand: Pinging you because I'm not sure that you'll get notified by me posting a response in this thread.
m
Can this be confirmed in the GDS version of the colenda cell?
Yes, this is in the GDS itself.
This is interesting, because this cell is from skywater directly.
t
Oh, great, another patch for open_pdks. . . : )
m
We use our own sram cell repo at this point.
@Jesse Cirimelli-Low This is interesting too.
a
@Tim Edwards. "Coming Back to me" ?are you referring to the same error that was posted in this thread (unable to find nfet_pass)?
t
@Abhishek Anand: No, I mean I looked at a slightly larger version of this SRAM layout (2x16) about a month ago. I noted the issue in my notebook and corrected it manually because my end goal was just to get a working simulatable netlist.
a
@Tim Edwards does that mean the error that i got (unable to find nmos_pass) can be rectified?so that i can able to simulate the netlist?
t
Yes. If I patch up the cell and send it back to you, can you replace it in your library and the SRAM layout GDS?
@Abhishek Anand: Corrected cell attached.
j
Thanks, I'll get this into OpenRAM too.
t
I would wager that that cell has never been taped out by Cypress or SkyWater. . .
a
Yeah sure . I would try
j
There was a time when netgen and magic were having issues handling substrate extraction a couple years ago and I probably added something like those labels/pwell layer to debug. Maybe they never made it out.
If these are the openram hosted cells that is
t
@Jesse Cirimelli-Low: These are the cells from the Google skywater-pdk sky130_fd_bd_sram repository on github.
a
@Tim Edwards i replaced your cell with the highligthed cell present in the following folder.and then generated SRAM layout using OpenRAM . The generated SRAM layout is extracted with the same procedure used earlier. Still I am encountering the same error.
@Tim Edwards can you confirm is this the procedure you expected me to do?
t
@Abhishek Anand: Yes, that's the correct procedure, but you should not get the same error unless there's another cell with the same problem. For the layout I extracted, the problem went away after I fixed the column end cell's GDS.
a
@Tim Edwards is there a way to compare my SRAM macro gds file with yours ? So that we can able to find out the problem.
t
@Abhishek Anand: Please repost your corrected GDS to me in the private message channel like you did with the last one
a
@Tim Edwards after extracting the fixed gds SRAM layout file that you shared with me , I didn't get any errors and working fine. Thank you
@Jesse Cirimelli-Low is modified sram_colenda.gds file updated in recent version of OpenRAM??
@Jesse Cirimelli-Low Any Idea?