From 2d2620d21a64f2b48e8a4ee9d5833bee7da12453 Mon Sep 17 00:00:00 2001 From: mrg Date: Wed, 2 Feb 2022 07:11:13 -0800 Subject: [PATCH 1/6] Remove dir from bad tests --- compiler/tests/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/tests/Makefile b/compiler/tests/Makefile index 854f531d..d384d52f 100644 --- a/compiler/tests/Makefile +++ b/compiler/tests/Makefile @@ -70,7 +70,7 @@ WORKING_TECH_TEST_STAMPS=$(filter-out $(BROKEN_STAMPS), $(TECH_TEST_STAMPS)) # Run all technologies all: $(WORKING_TECH_TEST_STAMPS) - @ls $(TOP_DIR)/compiler/tests/results/*/*.bad 1> /dev/null 2>&1 && echo "FAILING TESTS" && ls $(TOP_DIR)/compiler/tests/results/*/*.bad && exit 1 + @ls $(TOP_DIR)/compiler/tests/results/*/*.bad 1> /dev/null 2>&1 && echo "FAILING TESTS" && ls $(TOP_DIR)/compiler/tests/results/*/*.bad && sed -e "s/^.*\/results\///" && exit 1 .PHONY: all # Run a given technology From 8fdd4966a79121b437c8d11b08d042491a7efd73 Mon Sep 17 00:00:00 2001 From: mrg Date: Wed, 2 Feb 2022 09:36:05 -0800 Subject: [PATCH 2/6] Initial update of new psdm/nsdm implants --- compiler/pgates/pgate.py | 58 +++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/compiler/pgates/pgate.py b/compiler/pgates/pgate.py index 19a027e9..68e8a883 100644 --- a/compiler/pgates/pgate.py +++ b/compiler/pgates/pgate.py @@ -208,8 +208,9 @@ class pgate(design.design): # from the top of the well # OR align the active with the top of PMOS active. max_y_offset = self.height + 0.5 * self.m1_width - contact_yoffset = min(pmos_pos.y + pmos.active_height - pmos.active_contact.first_layer_height, - max_y_offset - pmos.active_contact.first_layer_height / 2 - self.nwell_enclose_active) + contact_yoffset = self.height - 0.5 * self.implant_width \ + - pmos.active_contact.first_layer_height \ + - self.implant_enclose_active contact_offset = vector(contact_xoffset, contact_yoffset) # Offset by half a contact in x and y contact_offset += vector(0.5 * pmos.active_contact.first_layer_width, @@ -276,24 +277,34 @@ class pgate(design.design): rightx=rightx, topy=self.height) - try: - ntap_insts = [self.nwell_contact] - self.add_enclosure(ntap_insts, - layer="nimplant", - extend=self.implant_enclose_active, - rightx=self.width, - topy=self.height) - except AttributeError: - pass - try: - ptap_insts = [self.pwell_contact] - self.add_enclosure(ptap_insts, - layer="pimplant", - extend=self.implant_enclose_active, - rightx=self.width, - boty=0) - except AttributeError: - pass + self.add_rect(layer="pimplant", + offset=vector(0, self.height - 0.5 * self.implant_width), + width=self.width, + height=self.implant_width) + self.add_rect(layer="nimplant", + offset=vector(0, -0.5 * self.implant_width), + width=self.width, + height=self.implant_width) + + +# try: +# ntap_insts = [self.nwell_contact] +# self.add_enclosure(ntap_insts, +# layer="nimplant", +# extend=self.implant_enclose_active, +# rightx=self.width, +# topy=self.height) +# except AttributeError: +# pass +# try: +# ptap_insts = [self.pwell_contact] +# self.add_enclosure(ptap_insts, +# layer="pimplant", +# extend=self.implant_enclose_active, +# rightx=self.width, +# boty=0) +# except AttributeError: +# pass def add_pwell_contact(self, nmos, nmos_pos): """ Add an pwell contact next to the given nmos device. """ @@ -303,11 +314,8 @@ class pgate(design.design): # To the right a spacing away from the nmos right active edge contact_xoffset = nmos_pos.x + nmos.active_width \ + self.active_space - # Must be at least an well enclosure of active up - # from the bottom of the well - contact_yoffset = max(nmos_pos.y, - self.nwell_enclose_active \ - - nmos.active_contact.first_layer_height / 2) + # Allow an nimplant below it under the rail + contact_yoffset = 0.5 * self.implant_width + self.implant_enclose_active contact_offset = vector(contact_xoffset, contact_yoffset) # Offset by half a contact From 39f1199b63fa830bcb4f5e0ef81c3a0a6dd5f694 Mon Sep 17 00:00:00 2001 From: mrg Date: Wed, 2 Feb 2022 09:36:19 -0800 Subject: [PATCH 3/6] Always delete result subdir to prevent bad and ok simultaneously --- compiler/tests/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/tests/Makefile b/compiler/tests/Makefile index d384d52f..cbe79439 100644 --- a/compiler/tests/Makefile +++ b/compiler/tests/Makefile @@ -3,6 +3,7 @@ include $(TOP_DIR)/openram.mk .DEFAULT_GOAL := all +RM ?= "rm -rf" ARGS ?= TECH ?= scn4m_subm TECHS = scn4m_subm freepdk45 @@ -88,6 +89,7 @@ $(TEST_BASES): # To run a test in a given technology %.ok: # @echo "Running $(gettech) $(getfile) ... " + @rm -rf results/$* @mkdir -p results/$*/tmp @docker run \ -v $(TOP_DIR):/openram \ @@ -102,7 +104,8 @@ $(TEST_BASES): vlsida/openram-ubuntu:latest \ sh -c ". /home/cad-user/.bashrc && python3 -u $(OPENRAM_DIR)/$(getfile).py \ -t $(gettech) -k $(ARGS) -p $(OPENRAM_DIR)/results/$* > $(OPENRAM_DIR)/results/$*.out 2>&1 && touch $(OPENRAM_DIR)/results/$*.ok || touch $(OPENRAM_DIR)/results/$*.bad" - @test -f $(TOP_DIR)/compiler/tests/results/$*.ok && echo "$* ... PASS!" && rm -rf $(TOP_DIR)/compiler/tests/results/$* || echo "$* ... FAIL!" + @test -f $(TOP_DIR)/compiler/tests/results/$*.ok && echo "$* ... PASS!" && \ + $(RM) $(TOP_DIR)/compiler/tests/results/$* || echo "$* ... FAIL!" .DELETE_ON_ERROR: $(TEST_STAMPS) # Mount environment for debug From 51097b2c8b94c3f1e436d950d2e1a26f3b44bd82 Mon Sep 17 00:00:00 2001 From: mrg Date: Wed, 2 Feb 2022 09:38:27 -0800 Subject: [PATCH 4/6] Revert rm in makefile --- compiler/tests/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/tests/Makefile b/compiler/tests/Makefile index cbe79439..9a90d16d 100644 --- a/compiler/tests/Makefile +++ b/compiler/tests/Makefile @@ -3,7 +3,6 @@ include $(TOP_DIR)/openram.mk .DEFAULT_GOAL := all -RM ?= "rm -rf" ARGS ?= TECH ?= scn4m_subm TECHS = scn4m_subm freepdk45 @@ -105,7 +104,7 @@ $(TEST_BASES): sh -c ". /home/cad-user/.bashrc && python3 -u $(OPENRAM_DIR)/$(getfile).py \ -t $(gettech) -k $(ARGS) -p $(OPENRAM_DIR)/results/$* > $(OPENRAM_DIR)/results/$*.out 2>&1 && touch $(OPENRAM_DIR)/results/$*.ok || touch $(OPENRAM_DIR)/results/$*.bad" @test -f $(TOP_DIR)/compiler/tests/results/$*.ok && echo "$* ... PASS!" && \ - $(RM) $(TOP_DIR)/compiler/tests/results/$* || echo "$* ... FAIL!" + rm -rf $(TOP_DIR)/compiler/tests/results/$* || echo "$* ... FAIL!" .DELETE_ON_ERROR: $(TEST_STAMPS) # Mount environment for debug From c471823626c87c6c416ce406c3904c628dbce7f5 Mon Sep 17 00:00:00 2001 From: mrg Date: Thu, 10 Feb 2022 11:18:52 -0800 Subject: [PATCH 5/6] Run individual tests on all technologies by default --- compiler/tests/Makefile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/compiler/tests/Makefile b/compiler/tests/Makefile index 9a90d16d..6649cc34 100644 --- a/compiler/tests/Makefile +++ b/compiler/tests/Makefile @@ -4,9 +4,8 @@ include $(TOP_DIR)/openram.mk .DEFAULT_GOAL := all ARGS ?= -TECH ?= scn4m_subm -TECHS = scn4m_subm freepdk45 -ALL_TECHS = scn4m_subm freepdk45 sky130 +TEST_TECHS = scn4m_subm freepdk45 +TECHS ?= scn4m_subm freepdk45 sky130 TEST_DIR = $(TOP_DIR)/compiler/tests TEST_SRCS = $(sort $(notdir $(wildcard $(TEST_DIR)/*_test.py))) @@ -62,7 +61,7 @@ BROKEN_STAMPS = \ gettech = $(word 1,$(subst /, ,$*)) getfile = $(word 2,$(subst /, ,$*)) -TECH_TEST_STAMPS=$(foreach T, $(TECHS), $(addprefix $T/, $(TEST_STAMPS))) +TECH_TEST_STAMPS=$(foreach T, $(TEST_TECHS), $(addprefix $T/, $(TEST_STAMPS))) # Filter out the tests after creating the tech stamps WORKING_TECH_TEST_STAMPS=$(filter-out $(BROKEN_STAMPS), $(TECH_TEST_STAMPS)) @@ -75,14 +74,14 @@ all: $(WORKING_TECH_TEST_STAMPS) # Run a given technology # e.g. make freepdk45 -$(ALL_TECHS): +$(TECHS): @$(MAKE) --no-print-directory $(filter-out $(BROKEN_STAMPS), $(addprefix $@/, $(TEST_STAMPS))) .PHONY: $(TECHS) -# Targets for each individual test +# Targets for each individual test in all technologies # e.g. make 04_pinv_1x_test $(TEST_BASES): - @$(MAKE) --no-print-directory $(TECH)/$@.ok + @$(MAKE) --no-print-directory $(foreach T, $(TECHS), $(addprefix $T/, $@.ok)) .PHONY: $(TEST_BASES) # To run a test in a given technology From a35ab45843e710ddf79ef319d93de93ac01ee9bd Mon Sep 17 00:00:00 2001 From: mrg Date: Thu, 10 Feb 2022 11:30:20 -0800 Subject: [PATCH 6/6] Conditionally set TEST_TECHS. Skip pand4 for sky130. --- compiler/tests/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/tests/Makefile b/compiler/tests/Makefile index 6649cc34..c18e1f98 100644 --- a/compiler/tests/Makefile +++ b/compiler/tests/Makefile @@ -4,7 +4,7 @@ include $(TOP_DIR)/openram.mk .DEFAULT_GOAL := all ARGS ?= -TEST_TECHS = scn4m_subm freepdk45 +TEST_TECHS ?= scn4m_subm freepdk45 TECHS ?= scn4m_subm freepdk45 sky130 TEST_DIR = $(TOP_DIR)/compiler/tests @@ -25,6 +25,7 @@ BROKEN_STAMPS = \ sky130/04_dummy_pbitcell_test.ok \ sky130/04_pbitcell_test.ok \ sky130/04_pnand4_test.ok \ + sky130/04_pand4_test.ok \ sky130/04_precharge_pbitcell_test.ok \ sky130/04_replica_pbitcell_test.ok \ sky130/05_pbitcell_array_test.ok \