RTimothyEdwards / magic

Magic VLSI Layout Tool
Other
498 stars 103 forks source link

.magicrc ignored #279

Closed jacobnrohan closed 1 year ago

jacobnrohan commented 1 year ago

I'm running qflow using the suggested demo source file map9v3.v. The flow runs successfully through the Migration step using the osu018 technology. Placement and Routing steps show their respective animations. However, when I click "Edit Layout" in qflow, magic opens with an empty layout and no technology layers, and qflow reports the following:

Diagnostic:   Creating qflow.magicrc
Diagnostic:   Found a tech load command in .magicrc
Diagnostic:   tech load not trusted
Diagnostic:   Inserting own tech load
Magic version is 8.3.443

For clarity, after clicking "Edit Layout", qflow.magicrc is generated:

Screenshot from 2023-11-14 16-49-07

However, nothing appears in magic: Screenshot from 2023-11-14 16-52-54

magic log

loading history file ... 26 events added
Use openwrapper to create a new GUI-based layout window
Use closewrapper to remove a new GUI-based layout window

Magic 8.3 revision 443 - Compiled on Thu Nov  2 09:18:22 AM CDT 2023.
Starting magic under Tcl interpreter
Using Tk console window
Processing system .magicrc file
Could not find file 'SCN4M_SUBM.20.tech' in any of these directories:
         . $CAD_ROOT/magic/sys $CAD_ROOT/magic/sys/current
4 Magic internal units = 1 Lambda
New windows will not have a title caption.
New windows will not have scroll bars.
New windows will not have a border.
Root cell box:
           width x height  (   llx,  lly  ), (   urx,  ury  )

microns:   0.000 x 0.000   ( 0.000,  0.000), ( 0.000,  0.000)
lambda:     0.00 x 0.00    (  0.00,  0.00 ), (  0.00,  0.00 )
internal:      0 x 0       (     0,  0    ), (     0,  0    )
Reading LEF data from file /usr/local/share/qflow/tech/osu035/osu035_stdcells.lef.
This action cannot be undone.
LEF read, Line 104 (Error): Don't know how to parse layer "metal1"
LEF read, Line 104 (Error): Try adding this name to the LEF techfile section
LEF read, Line 105 (Error): No layer defined for RECT.
LEF read, Line 106 (Error): Don't know how to parse layer "via1"
LEF read, Line 106 (Error): Try adding this name to the LEF techfile section
LEF read, Line 107 (Error): No layer defined for RECT.
LEF read, Line 108 (Error): Don't know how to parse layer "metal2"
LEF read, Line 108 (Error): Try adding this name to the LEF techfile section
LEF read, Line 109 (Error): No layer defined for RECT.
LEF read, Line 113 (Error): Don't know how to parse layer "metal2"
LEF read, Line 113 (Error): Try adding this name to the LEF techfile section
LEF read, Line 114 (Error): No layer defined for RECT.
LEF read, Line 115 (Error): Don't know how to parse layer "via2"
LEF read, Line 115 (Error): Try adding this name to the LEF techfile section
LEF read, Line 116 (Error): No layer defined for RECT.
LEF read, Line 117 (Error): Don't know how to parse layer "metal3"
LEF read, Line 117 (Error): Try adding this name to the LEF techfile section
LEF read, Line 118 (Error): No layer defined for RECT.
LEF read, Line 122 (Error): Don't know how to parse layer "metal3"
LEF read, Line 122 (Error): Try adding this name to the LEF techfile section
LEF read, Line 123 (Error): No layer defined for RECT.
LEF read, Line 124 (Error): Don't know how to parse layer "via3"
LEF read, Line 124 (Error): Try adding this name to the LEF techfile section
LEF read, Line 125 (Error): No layer defined for RECT.
LEF read, Line 126 (Error): Don't know how to parse layer "metal4"
LEF read, Line 126 (Error): Try adding this name to the LEF techfile section
LEF read, Line 127 (Error): No layer defined for RECT.
LEF read, Line 132 (Error): Don't know how to parse layer "metal1"
LEF read, Line 132 (Error): Try adding this name to the LEF techfile section
LEF read, Line 137 (Error): Don't know how to parse layer "metal2"
LEF read, Line 137 (Error): Try adding this name to the LEF techfile section
LEF read, Line 142 (Error): Don't know how to parse layer "via1"
LEF read, Line 142 (Error): Try adding this name to the LEF techfile section
LEF read, Line 143 (Error): No layer defined for RECT.
LEF read, Line 148 (Error): Don't know how to parse layer "metal3"
LEF read, Line 148 (Error): Try adding this name to the LEF techfile section
LEF read, Line 153 (Error): Don't know how to parse layer "metal2"
LEF read, Line 153 (Error): Try adding this name to the LEF techfile section
LEF read, Line 158 (Error): Don't know how to parse layer "via2"
LEF read, Line 158 (Error): Try adding this name to the LEF techfile section
LEF read, Line 159 (Error): No layer defined for RECT.
LEF read, Line 164 (Error): Don't know how to parse layer "metal3"
LEF read, Line 164 (Error): Try adding this name to the LEF techfile section
LEF read, Line 169 (Error): Don't know how to parse layer "metal4"
LEF read, Line 169 (Error): Try adding this name to the LEF techfile section
LEF read, Line 174 (Error): Don't know how to parse layer "via3"
LEF read, Line 174 (Error): Try adding this name to the LEF techfile section
LEF read, Line 175 (Error): No layer defined for RECT.
LEF read, Line 180 (Error): Don't know how to parse layer "metal1"
LEF read, Line 180 (Error): Try adding this name to the LEF techfile section
LEF read, Line 182 (Error): Don't know how to parse layer "metal1"
LEF read, Line 182 (Error): Try adding this name to the LEF techfile section
LEF read, Line 187 (Error): Don't know how to parse layer "metal2"
LEF read, Line 187 (Error): Try adding this name to the LEF techfile section
LEF read, Line 189 (Error): Don't know how to parse layer "metal2"
LEF read, Line 189 (Error): Try adding this name to the LEF techfile section
LEF read, Line 194 (Error): Don't know how to parse layer "metal3"
LEF read, Line 194 (Error): Try adding this name to the LEF techfile section
LEF read, Line 196 (Error): Don't know how to parse layer "metal3"
LEF read, Line 196 (Error): Try adding this name to the LEF techfile section
LEF read, Line 201 (Error): Don't know how to parse layer "metal4"
LEF read, Line 201 (Error): Try adding this name to the LEF techfile section
LEF read, Line 203 (Error): Don't know how to parse layer "metal4"
LEF read, Line 203 (Error): Try adding this name to the LEF techfile section
LEF read, Line 237 (Error): Don't know how to parse layer "metal1"
LEF read, Line 237 (Error): Try adding this name to the LEF techfile section
LEF read, Line 246 (Error): Don't know how to parse layer "metal1"
LEF read, Line 246 (Error): Try adding this name to the LEF techfile section
LEF read, Line 262 (Error): Don't know how to parse layer "metal1"
LEF read, Line 262 (Error): Try adding this name to the LEF techfile section
LEF read, Line 269 (Error): Don't know how to parse layer "metal1"
LEF read, Line 269 (Error): Try adding this name to the LEF techfile section
LEF read, Line 279 (Error): Don't know how to parse layer "metal1"
LEF read, Line 279 (Error): Try adding this name to the LEF techfile section
LEF read, Line 287 (Error): Don't know how to parse layer "metal1"
LEF read, Line 287 (Error): Try adding this name to the LEF techfile section
LEF read, Line 299 (Error): Don't know how to parse layer "metal1"
LEF read, Line 299 (Error): Try adding this name to the LEF techfile section
LEF read, Line 306 (Error): Don't know how to parse layer "metal1"
LEF read, Line 306 (Error): Try adding this name to the LEF techfile section
LEF read, Line 329 (Error): Don't know how to parse layer "metal1"
LEF read, Line 329 (Error): Try adding this name to the LEF techfile section
LEF read, Line 336 (Error): Don't know how to parse layer "metal1"
LEF read, Line 336 (Error): Try adding this name to the LEF techfile section
LEF read, Line 347 (Error): Don't know how to parse layer "metal1"
LEF read, Line 347 (Error): Try adding this name to the LEF techfile section
LEF read, Line 355 (Error): Don't know how to parse layer "metal1"
LEF read, Line 355 (Error): Try adding this name to the LEF techfile section
LEF read, Line 367 (Error): Don't know how to parse layer "metal1"
LEF read, Line 367 (Error): Try adding this name to the LEF techfile section
LEF read, Line 374 (Error): Don't know how to parse layer "metal1"
LEF read, Line 374 (Error): Try adding this name to the LEF techfile section
LEF read, Line 397 (Error): Don't know how to parse layer "metal1"
LEF read, Line 397 (Error): Try adding this name to the LEF techfile section
LEF read, Line 405 (Error): Don't know how to parse layer "metal1"
LEF read, Line 405 (Error): Try adding this name to the LEF techfile section
LEF read, Line 412 (Error): Don't know how to parse layer "metal1"
LEF read, Line 412 (Error): Try adding this name to the LEF techfile section
LEF read, Line 422 (Error): Don't know how to parse layer "metal1"
LEF read, Line 422 (Error): Try adding this name to the LEF techfile section
LEF Read:  Further errors will not be reported.
LEF read: Processed 3179 lines.
LEF Read: encountered 572 errors total.
Cell map9v3 read from current working directory
Cell map9v3 has technology "scmos", but current technology is "minimum"
Use command "tech load" if you want to switch technologies, or use
"cellname delete map9v3" and "load map9v3 -force" to force the cell to load as technology minimum
Creating new cell
Scaled tech values by 4 / 1 to match internal grid scaling
Using technology "minimum", version 0.0
Main console display active (Tcl8.6.13 / Tk8.6.13)

At first I thought this was an issue in qflow. But now I'm wondering if the intended function of magic is to load from .magicrc then qflow.rc. If so, something appears to be wrong in magic. If not, something might be wrong with the way qflow inserts the tech load.

temporary work around

By adding the tech load line to qflow.magicrc, overwritting the hidden file mv ./qflow.magicrc ./.magicrc, then running magic, I can view the design.

Screenshot from 2023-11-14 17-10-13

magic log

loading history file ... 26 events added
Use openwrapper to create a new GUI-based layout window
Use closewrapper to remove a new GUI-based layout window

Magic 8.3 revision 443 - Compiled on Thu Nov  2 09:18:22 AM CDT 2023.
Starting magic under Tcl interpreter
Using Tk console window
Using TrueColor, VisualID 0x3b depth 24
Processing system .magicrc file
Could not find file 'SCN4M_SUBM.20.tech' in any of these directories:
         . $CAD_ROOT/magic/sys $CAD_ROOT/magic/sys/current
Input style lambda=0.20(p): scaleFactor=20, multiplier=1
Contact size value ignored (using GDS generation rules).
Contact size value ignored (using GDS generation rules).
Contact size value ignored (using GDS generation rules).
Contact size value ignored (using GDS generation rules).
Contact size value ignored (using GDS generation rules).
Contact size value ignored (using GDS generation rules).
The following types are not handled by extraction and will be treated as non-electrical types:
    n_field_implant p_field_implant nselect pselect glass filln filla fillb xp m1p m2p m3p m4p comment bb 
4 Magic internal units = 1 Lambda
New windows will not have a title caption.
New windows will not have scroll bars.
New windows will not have a border.
Repainting console in magic layout window colors
Root cell box:
           width x height  (   llx,  lly  ), (   urx,  ury  )

microns:   0.000 x 0.000   ( 0.000,  0.000), ( 0.000,  0.000)
lambda:     0.00 x 0.00    (  0.00,  0.00 ), (  0.00,  0.00 )
internal:      0 x 0       (     0,  0    ), (     0,  0    )
Reading LEF data from file /usr/local/share/qflow/tech/osu035/osu035_stdcells.lef.
This action cannot be undone.
LEF read: Processed 3179 lines.
Cell map9v3 read from current working directory
Scaled magic input cell map9v3 geometry by factor of 2
Processing timestamp mismatches.
Timestamp mismatches found in these cells: INVX8, XNOR2X1, INVX4, INVX2, AND2X2, OAI22X1, XOR2X1, NOR3X1, INVX1, NOR2X1, NAND3X1, NAND2X1, OAI21X1, AOI21X1, AOI22X1, DFFSR, BUFX2, CLKBUF1, FILL.
Using technology "scmos", version 2001a
RTimothyEdwards commented 1 year ago

Looking at the python script that generates the error message, it looks like it is expecting

tech load /usr/local/share/qflow/tech/osu035/SCN4M_SUBM.20

instead of

path sys +/usr/local/share/qflow/tech/osu035
tech load SCN4M_SUBM.20

Since it's a python script parsing a Tcl file, it's not prepared to understand the entire script. I can put in behavior to check for the path sys command, though, which should solve the immediate problem.

RTimothyEdwards commented 1 year ago

As far as I could tell, there were two separate errors here, as the ".tech" extension is often left off the name of the tech file in the "tech load" command, but the qflow script was not adding the extension before searching if the file exists. I have now added code to properly handle the file extension, and also to properly handle the "path sys" lines.

Ultimately this comes from an over-simplification of the magic startup script by the python code in qflow, and the fact that I switched to using "path sys" in recent years because I now mostly use technologies from the open_pdks installer, which puts technology files in paths with awkwardly long names like /usr/local/share/pdk/sky130A/libs.tech/magic/sky130A.tech which I found much cleaner to present in two separate lines.

RTimothyEdwards commented 1 year ago

The fix is in qflow version 1.4.101 (pushed to opencircuitdesign.com this morning and which will be mirrored to github by tomorrow).

jacobnrohan commented 1 year ago

Installed qflow version 1.4.101 and can confirm my issue is resolved. Thank you!