Hello, I have a problem with FIXED_BBOX property i...
# magic
g
Hello, I have a problem with FIXED_BBOX property in Magic. In the screenshot, there is a cell having 16100 22576 size. In Magic file I see the string FIXED_BBOX 0 0 16100 22576 but exporting the cell in GDS the abutment (in green) area is just the half. Looking into mag file I see also a line with "magscale 1 2." I suspect this has to do with the misalignment. I have no idea what messed up the layout. Can someone help me out in fixing by hand the mag file in order to correct the abutment area?
t
I'm not sure what happened. Magic is supposed to track the scale. The values given to FIXED_BBOX normally would be in internal units, which are units of the sky130 minimum manufacturing grid, or 5nm. That corresponds to "magscale 1 2" (which declares the relationship between internal and lambda units, where lambda units are fixed at 10nm). Anyway, if the box is half the size it should be, then just load the cell into magic and type:
Copy code
property FIXED_BBOX "0 0 32200 45152"
Then save and regenerate GDS.
g
I'm playing with Tiny Tapeout, I think (I'm not 100% sure of that) the pipeline that validate the project checks FIXED_BBOX. If the size doesn't match the expected value, the validation test fails. For this reason I asked if it possible to fix manually setting the expected values not scaled.
t
Was the FIXED_BBOX value originally generated manually or by a script?
g
There is a template generation the initial layout setting FIXED_BBOX. The value changed at some point when I started to add my stuff.
I was able to reproduce the action that changed the value of FIXED_BBOX. Following what I did:
1. I run the init script -> FIXED_BBOX took the value defined in the script
2 I placed in the layout created by the script a standard cell (sky130_fd_sc_hd__or2_1.mag) -> FIXED_BBOX took new value.
I checked inside sky130_fd_sc_hd__or2_1.mag. Even in this file it is defined FIXED_BBOX property. Anyway the new FIXED_BBOX I see, is different from the original and from the one defined the standard cell.
Is there some logic explaining the new value?
t
What is the init script?
g
Size comes from def file.
DIEAREA ( 0 0 ) ( 161000 111520 ) ;
t
This looks like an error in magic that I will need to investigate. It can be easily worked around; it will not happen if magic is started with the correct technology startup file (sky130A.magicrc) that it is supposed to be run with, which would scale the grid to the SkyWater 5nm manufacturing grid before the bounding box is declared and before any instances are placed. However, it appears that magic, in attempting to rescale the bounding box when it rescales the grid in response to placing the first instance, is multiplying it up by 4 and not 2, which is an error, so I will have to figure out why it does that.
g
magic_init_project.tcl
tt_block_1x1_pg.def
Adding I'm currently using this Magic version:
Magic 8.3 revision 424 - Compiled on dom 13 ago 2023, 164659, CEST.
t
The
magic_init_project.tcl
is sourced from inside magic. Whether or not magic is invoked with the command-line argument for reading the startup script (
-rcfile /path/to/sky130A.magicrc
) would only be found in whatever script runs magic on the
magic_init_project.tcl
file.
Your version of magic is a bit old but I know the problem is still there because I can easily reproduce it.
g
I confirm the workaround you suggested worked out. I will try to apply it on my original project. I let you now when done. Thanks for helping me out.
t
Thanks for surfacing a bug (even though now I have to go investigate it. . . )!
Sorry it took over a week to get around to investigating this, but I discovered that this is a bug that has been in the code for a while but has not been noticed since the usual procedure is to run magic with the .magicrc file, and that causes all grid scaling to be done before the first layout window is created. But it was clear that I had failed to remove code that scaled the "FIXED_BBOX" property after copying the code into a subroutine, causing it to be run twice. This is now fixed with version 8.3.518 and should not cause problems going forward.