Merge branch 'klayout' into dev

This commit is contained in:
mrg 2022-02-10 11:30:32 -08:00
commit ed5765ea87
2 changed files with 44 additions and 34 deletions

View File

@ -208,8 +208,9 @@ class pgate(design.design):
# from the top of the well # from the top of the well
# OR align the active with the top of PMOS active. # OR align the active with the top of PMOS active.
max_y_offset = self.height + 0.5 * self.m1_width 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, contact_yoffset = self.height - 0.5 * self.implant_width \
max_y_offset - pmos.active_contact.first_layer_height / 2 - self.nwell_enclose_active) - pmos.active_contact.first_layer_height \
- self.implant_enclose_active
contact_offset = vector(contact_xoffset, contact_yoffset) contact_offset = vector(contact_xoffset, contact_yoffset)
# Offset by half a contact in x and y # Offset by half a contact in x and y
contact_offset += vector(0.5 * pmos.active_contact.first_layer_width, contact_offset += vector(0.5 * pmos.active_contact.first_layer_width,
@ -276,24 +277,34 @@ class pgate(design.design):
rightx=rightx, rightx=rightx,
topy=self.height) topy=self.height)
try: self.add_rect(layer="pimplant",
ntap_insts = [self.nwell_contact] offset=vector(0, self.height - 0.5 * self.implant_width),
self.add_enclosure(ntap_insts, width=self.width,
layer="nimplant", height=self.implant_width)
extend=self.implant_enclose_active, self.add_rect(layer="nimplant",
rightx=self.width, offset=vector(0, -0.5 * self.implant_width),
topy=self.height) width=self.width,
except AttributeError: height=self.implant_width)
pass
try:
ptap_insts = [self.pwell_contact] # try:
self.add_enclosure(ptap_insts, # ntap_insts = [self.nwell_contact]
layer="pimplant", # self.add_enclosure(ntap_insts,
extend=self.implant_enclose_active, # layer="nimplant",
rightx=self.width, # extend=self.implant_enclose_active,
boty=0) # rightx=self.width,
except AttributeError: # topy=self.height)
pass # 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): def add_pwell_contact(self, nmos, nmos_pos):
""" Add an pwell contact next to the given nmos device. """ """ 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 # To the right a spacing away from the nmos right active edge
contact_xoffset = nmos_pos.x + nmos.active_width \ contact_xoffset = nmos_pos.x + nmos.active_width \
+ self.active_space + self.active_space
# Must be at least an well enclosure of active up # Allow an nimplant below it under the rail
# from the bottom of the well contact_yoffset = 0.5 * self.implant_width + self.implant_enclose_active
contact_yoffset = max(nmos_pos.y,
self.nwell_enclose_active \
- nmos.active_contact.first_layer_height / 2)
contact_offset = vector(contact_xoffset, contact_yoffset) contact_offset = vector(contact_xoffset, contact_yoffset)
# Offset by half a contact # Offset by half a contact

View File

@ -4,9 +4,8 @@ include $(TOP_DIR)/openram.mk
.DEFAULT_GOAL := all .DEFAULT_GOAL := all
ARGS ?= ARGS ?=
TECH ?= scn4m_subm TEST_TECHS ?= scn4m_subm freepdk45
TECHS = scn4m_subm freepdk45 TECHS ?= scn4m_subm freepdk45 sky130
ALL_TECHS = scn4m_subm freepdk45 sky130
TEST_DIR = $(TOP_DIR)/compiler/tests TEST_DIR = $(TOP_DIR)/compiler/tests
TEST_SRCS = $(sort $(notdir $(wildcard $(TEST_DIR)/*_test.py))) TEST_SRCS = $(sort $(notdir $(wildcard $(TEST_DIR)/*_test.py)))
@ -26,6 +25,7 @@ BROKEN_STAMPS = \
sky130/04_dummy_pbitcell_test.ok \ sky130/04_dummy_pbitcell_test.ok \
sky130/04_pbitcell_test.ok \ sky130/04_pbitcell_test.ok \
sky130/04_pnand4_test.ok \ sky130/04_pnand4_test.ok \
sky130/04_pand4_test.ok \
sky130/04_precharge_pbitcell_test.ok \ sky130/04_precharge_pbitcell_test.ok \
sky130/04_replica_pbitcell_test.ok \ sky130/04_replica_pbitcell_test.ok \
sky130/05_pbitcell_array_test.ok \ sky130/05_pbitcell_array_test.ok \
@ -62,7 +62,7 @@ BROKEN_STAMPS = \
gettech = $(word 1,$(subst /, ,$*)) gettech = $(word 1,$(subst /, ,$*))
getfile = $(word 2,$(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 # Filter out the tests after creating the tech stamps
WORKING_TECH_TEST_STAMPS=$(filter-out $(BROKEN_STAMPS), $(TECH_TEST_STAMPS)) WORKING_TECH_TEST_STAMPS=$(filter-out $(BROKEN_STAMPS), $(TECH_TEST_STAMPS))
@ -70,24 +70,25 @@ WORKING_TECH_TEST_STAMPS=$(filter-out $(BROKEN_STAMPS), $(TECH_TEST_STAMPS))
# Run all technologies # Run all technologies
all: $(WORKING_TECH_TEST_STAMPS) 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 .PHONY: all
# Run a given technology # Run a given technology
# e.g. make freepdk45 # e.g. make freepdk45
$(ALL_TECHS): $(TECHS):
@$(MAKE) --no-print-directory $(filter-out $(BROKEN_STAMPS), $(addprefix $@/, $(TEST_STAMPS))) @$(MAKE) --no-print-directory $(filter-out $(BROKEN_STAMPS), $(addprefix $@/, $(TEST_STAMPS)))
.PHONY: $(TECHS) .PHONY: $(TECHS)
# Targets for each individual test # Targets for each individual test in all technologies
# e.g. make 04_pinv_1x_test # e.g. make 04_pinv_1x_test
$(TEST_BASES): $(TEST_BASES):
@$(MAKE) --no-print-directory $(TECH)/$@.ok @$(MAKE) --no-print-directory $(foreach T, $(TECHS), $(addprefix $T/, $@.ok))
.PHONY: $(TEST_BASES) .PHONY: $(TEST_BASES)
# To run a test in a given technology # To run a test in a given technology
%.ok: %.ok:
# @echo "Running $(gettech) $(getfile) ... " # @echo "Running $(gettech) $(getfile) ... "
@rm -rf results/$*
@mkdir -p results/$*/tmp @mkdir -p results/$*/tmp
@docker run \ @docker run \
-v $(TOP_DIR):/openram \ -v $(TOP_DIR):/openram \
@ -102,7 +103,8 @@ $(TEST_BASES):
vlsida/openram-ubuntu:latest \ vlsida/openram-ubuntu:latest \
sh -c ". /home/cad-user/.bashrc && python3 -u $(OPENRAM_DIR)/$(getfile).py \ 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" -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 -rf $(TOP_DIR)/compiler/tests/results/$* || echo "$* ... FAIL!"
.DELETE_ON_ERROR: $(TEST_STAMPS) .DELETE_ON_ERROR: $(TEST_STAMPS)
# Mount environment for debug # Mount environment for debug