From 3079439e81599637d789ae88987bad8deef6c006 Mon Sep 17 00:00:00 2001 From: htfab Date: Tue, 10 Sep 2024 17:33:43 +0200 Subject: [PATCH] fix: make openlane2 install the PDK into $PDK_ROOT --- project.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/project.py b/project.py index dc80230..a8ef0ac 100644 --- a/project.py +++ b/project.py @@ -12,6 +12,7 @@ import cairosvg # type: ignore import chevron import gdstk # type: ignore +import volare import yaml from git.repo import Repo @@ -506,7 +507,7 @@ def harden(self): shutil.rmtree("runs/wokwi", ignore_errors=True) os.makedirs("runs/wokwi", exist_ok=True) progress = "--hide-progress-bar" if "CI" in os.environ else "" - harden_cmd = f"python -m openlane --dockerized --run-tag wokwi --force-run-dir runs/wokwi {progress} src/config_merged.json" + harden_cmd = f"python -m openlane --pdk-root $PDK_ROOT --dockerized --run-tag wokwi --force-run-dir runs/wokwi {progress} src/config_merged.json" else: # requires PDK, PDK_ROOT, OPENLANE_ROOT & OPENLANE_IMAGE_NAME to be set in local environment harden_cmd = "docker run --rm -v $OPENLANE_ROOT:/openlane -v $PDK_ROOT:$PDK_ROOT -v $(pwd):/work -e PDK=$PDK -e PDK_ROOT=$PDK_ROOT -u $(id -u $USER):$(id -g $USER) $OPENLANE_IMAGE_NAME ./flow.tcl -overwrite -design /work/src -run_path /work/runs -config_file /work/src/config_merged.json -tag wokwi" @@ -541,10 +542,16 @@ def harden(self): pdk_sources_file = os.path.join( config["PDK_ROOT"], config["PDK"], "SOURCES" ) + pdk_sources = open(pdk_sources_file).read() open("runs/wokwi/OPENLANE_VERSION", "w").write( f"OpenLane2 {openlane_version}\n" ) - open("runs/wokwi/PDK_SOURCES", "w").write(open(pdk_sources_file).read()) + open("runs/wokwi/PDK_SOURCES", "w").write(pdk_sources) + volare.enable( + os.environ["PDK_ROOT"], + {"sky130A": "sky130"}[config["PDK"]], + pdk_sources.split()[1], + ) os.chdir(cwd)