ok, on my own machine now
# magic
j
ok, on my own machine now
t
Got it, thanks. Sorry for the delay.
I am missing a file
inv_P8u_N3u.mag
from that layout set. Ignoring the missing layout, I was able to do
lef write -hide
without any issue, and the resulting LEF file looks reasonable. Assuming the missing file is not part of the issue, what version of magic are you using?
This is the resulting LEF file:
j
Thanks Tim, Im using git version of magic
Magic 8.3 revision 346 - Compiled on Tue 29 Nov 150915 GMT 2022. Cloned that day.
t
I made several fixes to the LEF commands on that day and again in the following days. It's not clear from my notes that any of those changes would fix a potential crash condition, but it's worth pulling a more recent version and trying.
j
Ok, Ill try that. Here is the .mag of the missing file in case it was that which is breaking it. Ill pull the most recent version and try again, thanks, John
t
I was able to do the same
lef write -hide
with the previously missing cell added, so I expect there is something I did in one of those recent commits that fixed whatever is ailing it.
j
The latest git version of magic doesnt crash with >>>lef write -hide, so thats now working OK. Next thing I found was messages when writing gds Generating output for cell sky130_fd_sc_hd__buf_4 Calma output error: Structure name not found at GDS file position 344098 Calma output error: Can't write cell from vendor GDS. Using magic's internal definition
the gds so created can be viewed in some editors, but not klayout, and when magic opens it I get errors like Reading "sky130_fd_sc_hd__clkbuf_4". Error while reading cell "sky130_fd_sc_hd__clkbuf_4" (byte position 170550): Unexpected record type in input: Expected ENDSTR record but got BGNSTR. R and Reading "vdd_vss_interconnect_parasitics_test_ACTIVE". CIF file read warning: CIF style sky130(): units rescaled by factor of 5 / 1 and Reading "sky130_fd_pr__pnp_05v5_W3p40L3p40". CIF file read warning: Input off lambda grid by 3/5; snapped to grid.
t
@john wood: Since the years I worked at MultiGiG, I've been trying all sorts of things to resolve the problems that magic has with reading in GDS made with other layout tools, many of which allow people to create absurd hierarchies; Calibre can slice and dice things every which way to extract a valid netlist from the worst layouts. I think this has just encouraged people to be very bad at doing layouts. Anyway, the upshot is that this situation just gets worse and worse over time. My best way to deal with it is to make a reference from a magic layout to a GDS file using a "property" key:value pair in the cell, so that when you want to write GDS, magic will just go find the GDS file and pull the vendor GDS directly instead of trying to create it on its own. That, however, depends on the properties pointing to a valid GDS file. For the PDK generated by open_pdks, I have open_pdks set it all up at the time it builds and installs the PDK, so that the .mag files and the .gds files are all consistent, and each cell in magic has a property pointing to the correct positions in the corresponding GDS file. Obviously, this method is pretty easy to subvert by overwriting the GDS file with another one and not updating the properties in the .mag files. That appears to be what happened to your layout. The fixes for it are either (1) rebuild the whole PDK so that everything is consistent, or (2) remove the GDS file that the .mag files are referencing. I'm not entirely sure what went wrong, though, because in the output you posted, magic has detected that the GDS file doesn't match the pointers and has decided to write its own GDS, which should have been okay. There might be an error in the magic code there; I don't think that part of the code has been well tested. I will look into it.
j
thanks Tim, Ill rebuild the pdk and see if that does it.
Had a problem with the open_pdks builder. It almost finishes and then comes back with this
Executing transaction: done /root/eda/open_pdks/sources/sky130-pdk/env/downloads/Miniconda3-latest-Linux-x86_64.sh: 438: [[: not found Installing * environment... /root/eda/open_pdks/sources/sky130-pdk/env/downloads/Miniconda3-latest-Linux-x86_64.sh: 444: [[: not found CondaFileIOError: '/root/eda/open_pdks/sources/sky130-pdk/env/conda/pkgs/envs/*/env.txt'. [Errno 2] No such file or directory: '/root/eda/open_pdks/sources/sky130-pdk/env/conda/pkgs/envs/*/env.txt'
I used ./configure --enable-sky130-pdk --enable-sram-sky130
I managed to get magic to output OK gds for the skywater cells. I noticed in the .mag it had these lines use sky130_fd_sc_hd__clkbuf_4 input8 ~/eda/magic/open_pdks/sky130/sky130A/libs.ref/sky130_fd_sc_hd/mag Which I think was from synthesis using an older openlane setup on Ellens computer. I deleted the directory part ( ~/eda/magic/open_pdks/sky130/sky130A/libs.ref/sky130_fd_sc_hd/mag ) and without knowing explicitly where to find the mags, magic found the right gds itself. So Im thinking that magic isn't supposed to read the sky??.mag file?
Now Im back with the same problem with the Lef file. I added some more ports to the gds and now the latest magic which didnt previously segfault now segfaults on both lef write and lef write -hide. I can reproduce the error or not depending on just the presence of 3 labels.
t
(Sorry about the delay in responding; I was down in Virginia visiting my parents for the last few days.) At least in the recent past, I have been able to work around the obscure Conda errors in the PDK build (which come from the Google repository, not from open_pdks) by doing "make" twice in a row, and the error doesn't repeat the second time.
The addition of the location reference for finding library cells is an addition I've made to magic in recent years. You should not have to delete the references from the files. Just run the command option
load <cellname> -dereference
. The
-dereference
option ignores all of the indicated locations and just goes and looks for things in the usual places. If you run the
sky130A.magicrc
startup script, then the locations of all the
sky130A
libraries are added to the standard search paths. I have had a hard time getting the openlane development team to understand the basic issue that they should not put the PDK in a directory downstream of the working directory. Otherwise, all the references would look like "`$PDK_PATH/libs.ref/sky130_fd_sc_hd/mag`" and layouts would be portable as intended.
For the segfault, you can try running with
gdb
(run gdb on
/usr/local/lib/magic/tcl/magicexec
, since "`magic`" itself is a script, not an executable, or else run magic and attach gdb to the running process) and post the stack trace from the segfault.