I have a more minor issue: sometimes when I save a...
# magic
d
I have a more minor issue: sometimes when I save a .mag file, all of the relative paths (such as
$PDKPATH/libs.ref/sky130_fd_sc_hd/mag
) get replaced with absolute paths (in my case
~/proj/caravan-project/pdk/sky130A/libs.ref/sky130_fd_sc_hd/mag
). This is inconvenient because I would like my design to be opened on multiple systems, and I have to manually fix this each time I commit. Do you know what causes this filepath replacement and if there is a way to prevent it?
👍 1
t
The full path of the layout file is saved internally to magic; the substitution to "$PDKPATH" or "~" is done when the file is written out. According to the substitution routine, it should first try to substitute "$PDKPATH" and then it will try to substitute the home directory.
It does not appear that magic makes any attempt to check if the $PDKPATH variable itself is a full path, so my guess about what's going on here is that $PDKPATH probably has the user-home tilde in it; magic then cannot find an exact match against the full-path name of the file, so it fails the $PDKPATH substitution and succeeds on the home directory substitution. Changing $PDKPATH to an absolute path should make the problem go away, although I will also fix the routine in magic to expand $PDKPATH itself to an absolute path if needed.
Actually it would be $PDK_ROOT that it is set from, not $PDKPATH, and it is probably best dealt with in the .magicrc file by expanding with
file nativename $env(PDK_ROOT)
.
a
As a follow-up, is it possible to write out the cell path with a variable name instead of an absolute path? That way we could still have our repos in different paths across systems, but each user could set an env variable for their repo path, and our repos would still agree on the committed paths with variable names hiding the path differences across systems
t
I have not tried doing this but I don't think it would be particularly hard to transfer the subroutines used for substituting variables into the file path for GDS files to the routines that handle .mag files.
👍 1