From 049751ae1f8691b46f1ec22ae312dac037d9c238 Mon Sep 17 00:00:00 2001 From: mrg Date: Thu, 3 Feb 2022 10:19:28 -0800 Subject: [PATCH] FreePDK45 running with klayout and Sky130 running with magic. --- Makefile | 2 +- compiler/pgates/ptx.py | 6 ----- compiler/tests/Makefile | 42 +++++++++++++++++++++++--------- docker/set-paths.sh | 9 ++++++- technology/freepdk45/__init__.py | 6 ++++- 5 files changed, 44 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index 6f1fe0f4..af52eb2f 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,7 @@ MAGICRC_FILE := $(SKY130_PDK)/libs.tech/magic/sky130A.magicrc ALL_FILES := $(ALL_SPICE_FILES) $(GDS_FILES) $(MAG_FILES) $(MAGLEF_FILES) -INSTALL_BASE_DIRS := gds_lib mag_lib sp_lib lvs_lib calibre_lvs_lib klayout_lvs_lib lef_lib maglef_lib +INSTALL_BASE_DIRS := gds_lib mag_lib sp_lib lvs_lib calibre_lvs_lib klayout_lvs_lib maglef_lib INSTALL_BASE := $(OPENRAM_HOME)/../technology/sky130 INSTALL_DIRS := $(addprefix $(INSTALL_BASE)/,$(INSTALL_BASE_DIRS)) diff --git a/compiler/pgates/ptx.py b/compiler/pgates/ptx.py index e6a8313d..e49df518 100644 --- a/compiler/pgates/ptx.py +++ b/compiler/pgates/ptx.py @@ -161,12 +161,6 @@ class ptx(design.design): self.mults, self.tx_width, drc("minwidth_poly")) - - elif OPTS.lvs_exe and OPTS.lvs_exe[0] == "klayout": - self.lvs_device = "M{{0}} {{1}} {0} m={1} w={2} l={3}".format(spice[self.tx_type], - self.mults, - self.tx_width, - drc("minwidth_poly")) elif cell_props.ptx.model_is_subckt: self.lvs_device = "X{{0}} {{1}} {0} m={1} w={2}u l={3}u".format(spice[self.tx_type], self.mults, diff --git a/compiler/tests/Makefile b/compiler/tests/Makefile index 0e378d39..6933f165 100644 --- a/compiler/tests/Makefile +++ b/compiler/tests/Makefile @@ -42,15 +42,13 @@ tests: %.ok: %.py @echo "Running $*" @mkdir -p $(TOP_DIR)/compiler/tests/results/$* - @docker run -v $(TOP_DIR):/openram \ - -v $(SKY130_PDK):$(SKY130_PDK) \ - -e PDK_ROOT=$(PDK_ROOT) \ - -e OPENRAM_HOME=/openram/compiler \ - -e OPENRAM_TECH=/openram/technology \ - -e OPENRAM_TMP=/openram/compiler/tests/results/$* \ + @docker run \ + -v $(TOP_DIR):/openram \ + -v $(FREEPDK45):/pdk/freepdk45\ + -v $(PDK_ROOT):/pdk \ --user $(UID):$(GID) \ - vlsida/openram-ubuntu:latest \ - python3 -u /openram/compiler/tests/$*.py $(ARGS) && touch $@ + vlsida/openram-ubuntu:latest \ + sh -c ". ~/.bashrc && python3 -u /openram/compiler/tests/$*.py $(ARGS) && touch $@" .DELETE_ON_ERROR: $(TEST_STAMPS) @@ -58,18 +56,38 @@ TECHS := scn4m_subm freepdk45 #sky130 $(TECHS): - @docker run -v $(TOP_DIR):/openram \ - -e OPENRAM_HOME=/openram/compiler \ - -e OPENRAM_TECH=/openram/technology \ + docker run \ + -v $(TOP_DIR):/openram \ + -v $(FREEPDK45):/pdk/freepdk45 \ + -v $(PDK_ROOT):/pdk \ --user $(UID):$(GID) \ -e OPENRAM_TMP=/openram/compiler/tests/tmp_$@/$* \ vlsida/openram-ubuntu:latest \ - sh -c "python3 -u /openram/compiler/tests/regress.py $(ARGS) -t $@" + sh -c ". ~/.bashrc && python3 -u /openram/compiler/tests/regress.py $(ARGS) -t $@" .PHONY: $(TECHS) regress: $(TECHS) .PHONY: regress +foo: + docker run \ + -v $(TOP_DIR):/openram \ + -v $(FREEPDK45):/pdk/freepdk45 \ + -v $(PDK_ROOT):/pdk \ + --user $(UID):$(GID) \ + vlsida/openram-ubuntu:latest \ + sh -c ". ~/.bashrc && env" +.PHONY: foo + +mount: + docker run -it \ + -v $(TOP_DIR):/openram \ + -v $(FREEPDK45):/pdk/freepdk45 \ + -v $(PDK_ROOT):/pdk \ + --user $(UID):$(GID) \ + vlsida/openram-ubuntu:latest +.PHONY: mount + clean: @rm -rf $(TEST_STAMPS) @rm -rf $(TEST_DIRS) diff --git a/docker/set-paths.sh b/docker/set-paths.sh index 5d6e76cc..40bfaeb8 100644 --- a/docker/set-paths.sh +++ b/docker/set-paths.sh @@ -17,6 +17,13 @@ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$XYCE_LIB export XYCE_NO_TRACKING="anything at all" # PDKs -export FREEPDK45=/home/PDKs/FreePDK45 +export FREEPDK45=/PDK/freepdk45 # Set to the PDK you want to use export PDK_DIR=$FREEPDK45 + +# Skywater PDK +export PDK_ROOT=/pdk + +# OpenRAM +export OPENRAM_HOME=/openram/compiler +export OPENRAM_TECH=/openram/technology diff --git a/technology/freepdk45/__init__.py b/technology/freepdk45/__init__.py index b86b17be..6d9e759d 100644 --- a/technology/freepdk45/__init__.py +++ b/technology/freepdk45/__init__.py @@ -13,13 +13,17 @@ the trunk import sys import os +import debug TECHNOLOGY = "freepdk45" ########################## # FreePDK45 paths -PDK_DIR=os.path.abspath(os.environ.get("FREEPDK45")) +PDK_PATH=os.environ.get("FREEPDK45") +if PDK_PATH==None: + debug.error("Must define FREEPDK45 to point to PDK.", -1) +PDK_DIR=os.path.abspath(PDK_PATH) os.environ["PDK_DIR"] = PDK_DIR os.environ["SYSTEM_CDS_LIB_DIR"] = "{0}/ncsu_basekit/cdssetup".format(PDK_DIR) os.environ["CDS_SITE"] = PDK_DIR