Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified hardcoded PDK path with the environment variable PDK_ROOT in sky130_mapped.py #325

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
usage: from sky130_mapped import sky130_mapped_pdk
"""

import os
from ..mappedpdk import MappedPDK, SetupPDKFiles
from ..sky130_mapped.grules import grulesobj
from pathlib import Path
Expand Down Expand Up @@ -33,7 +33,22 @@
openfasoc_dir = Path(__file__).resolve().parent.parent.parent.parent.parent.parent.parent

klayout_drc_file = Path(__file__).resolve().parent / "sky130.lydrc"
pdk_root = Path('/usr/bin/miniconda3/share/pdk/')

paths_to_check = [
Path('$PDK_ROOT'),
Path("/usr/bin/miniconda3/share/pdk/"),
Path(f"/home/{os.getenv('LOGNAME')}/miniconda3/share/pdk/")
]
pdk_root = None
for path in paths_to_check:
# print(f"\n...Checking for PDK root at: {path}...")
if path.exists():
pdk_root = path
break

if not pdk_root:
raise EnvironmentError("PDK root not found in expected locations!")

lvs_schematic_ref_file = openfasoc_dir / "common" / "platforms" / "sky130hd" / "cdl" / "sky130_fd_sc_hd.spice"
magic_drc_file = pdk_root / "sky130A" / "libs.tech" / "magic" / "sky130A.magicrc"
lvs_setup_tcl_file = pdk_root / "sky130A" / "libs.tech" / "netgen" / "sky130A_setup.tcl"
Expand Down Expand Up @@ -65,4 +80,5 @@
# set the grid size
sky130_mapped_pdk.gds_write_settings.precision = 5*10**-9
sky130_mapped_pdk.cell_decorator_settings.cache=False
sky130_mapped_pdk.gds_write_settings.flatten_invalid_refs=False
sky130_mapped_pdk.gds_write_settings.flatten_invalid_refs=False