Skip to content

Commit bb1ed2f

Browse files
committed
update harden make target to have the user project wrapper fixed configs separated from the user modifiable configs
1 parent 474952a commit bb1ed2f

File tree

2 files changed

+25
-17
lines changed

2 files changed

+25
-17
lines changed

Makefile

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export PDK?=sky130A
3434
export PDKPATH?=$(PDK_ROOT)/$(PDK)
3535

3636
.PHONY: setup
37-
setup: check_dependencies install-mcw install-frigate pdk-with-volare setup-cocotb
37+
setup: check_dependencies install-mgmt install-frigate pdk-with-volare setup-cocotb
3838

3939
.PHONY: check_dependencies
4040
check_dependencies:
@@ -59,8 +59,8 @@ install-volare:
5959
./venv/bin/$(PYTHON_BIN) -m pip install --upgrade --no-cache-dir volare
6060

6161
# Include mgmt
62-
.PHONY: install-mcw
63-
install-mcw:
62+
.PHONY: install-mgmt
63+
install-mgmt:
6464
if [ -d "$(MGMT_ROOT)" ]; then\
6565
MAKE_DIR="$(PWD)"; \
6666
echo "Updating $(MGMT_ROOT)"; \
@@ -117,13 +117,12 @@ echo-var:
117117

118118

119119
# Harden with Openlane2
120-
OPENLANE2_TAG ?= 2.3.3
120+
OPENLANE2_TAG ?= 2.3.5
121121
OPENLANE2_IMAGE_NAME ?= efabless/openlane:$(OPENLANE2_TAG)
122122
OPENLANE2_RUN_TAG = $(shell date '+%y_%m_%d_%H_%M')
123123
OPENLANE2_USE_NIX ?= 1
124124
ROOTLESS ?= 0
125125
USER_ARGS = -u $$(id -u $$USER):$$(id -g $$USER)
126-
designs = $(shell cd $(PROJECT_ROOT)/openlane && find * -maxdepth 0 -type d)
127126
current_design = null
128127

129128
ifeq ($(ROOTLESS), 1)
@@ -182,21 +181,29 @@ list:
182181
@echo $(designs)
183182

184183
# export PYTHONPATH=$(PROJECT_ROOT)/openlane_plugin_Frigate:\$$PYTHONPATH
185-
.PHONY: $(designs)
186-
$(designs) : export current_design=$@
187-
$(designs) : % : $(PROJECT_ROOT)/openlane/%/config.yaml
188-
# $(current_design)
189-
@rm -rf $(PROJECT_ROOT)/openlane/$*/runs/$(OPENLANE2_RUN_TAG)
190-
ifeq ($(current_design),user_project_wrapper)
191-
openlane_args += $(PROJECT_ROOT)/openlane/$(current_design)/fixed_dont_change/fixed_config.yaml
192-
endif
193-
184+
designs = $(shell cd $(PROJECT_ROOT)/openlane && find * -maxdepth 0 -type d ! -name "user_project_wrapper")
194185
ifeq ($(OPENLANE2_USE_NIX),1)
195-
nix develop --command openlane $(openlane_args) $(openlane_extra_args)
186+
openlane_cmd=nix develop --command openlane $(openlane_args) $(openlane_extra_args)
196187
else
197-
$(PROJECT_ROOT)/openlane2-venv/bin/python3 -m openlane $(docker_mounts) $(openlane_extra_args) --dockerized $(openlane_args) $(openlane_extra_args)
188+
openlane_cmd=$(PROJECT_ROOT)/openlane2-venv/bin/python3 -m openlane $(docker_mounts) $(openlane_extra_args) --dockerized $(openlane_args) $(openlane_extra_args)
198189
endif
199-
@sh $(PROJECT_ROOT)/openlane/copy_views.sh $(PROJECT_ROOT) $* $(OPENLANE2_RUN_TAG)
190+
191+
define run_openlane
192+
rm -rf $(PROJECT_ROOT)/openlane/$*/runs/$(OPENLANE2_RUN_TAG)
193+
$(openlane_cmd) $1
194+
endef
195+
196+
.PHONY: user_project_wrapper
197+
user_project_wrapper: % : $(PROJECT_ROOT)/openlane/user_project_wrapper/config.yaml
198+
$(call run_openlane,$(PROJECT_ROOT)/openlane/user_project_wrapper/fixed_config.yaml)
199+
# $(openlane_cmd) $(PROJECT_ROOT)/openlane/user_project_wrapper/fixed_config.yaml -c "step"=Frigate.CustomApplyDEFTemplate
200+
sh $(PROJECT_ROOT)/openlane/copy_views.sh $(PROJECT_ROOT) $* $(OPENLANE2_RUN_TAG)
201+
202+
.PHONY: $(designs)
203+
$(designs) : export current_design=$@
204+
$(designs) : % : $(PROJECT_ROOT)/openlane/%/config.yaml
205+
$(call run_openlane)
206+
sh $(PROJECT_ROOT)/openlane/copy_views.sh $(PROJECT_ROOT) $* $(OPENLANE2_RUN_TAG)
200207

201208
.PHONY: harden
202209
harden: $(designs)

openlane/user_project_wrapper/fixed_dont_change/fixed_config.yaml renamed to openlane/user_project_wrapper/fixed_config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ FP_TEMPLATE_PINS:
4343
- vssa1
4444
- vdda2
4545
- vssa2
46+
4647
meta:
4748
flow: Classic
4849
substituting_steps:

0 commit comments

Comments
 (0)