From 59411f04bc32dbdbf8fb4b2c016f2dfed2260548 Mon Sep 17 00:00:00 2001 From: Marwan Abbas <67271180+marwaneltoukhy@users.noreply.github.com> Date: Mon, 23 Dec 2024 01:13:14 +0530 Subject: [PATCH] Update Makefile --- Makefile | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 53 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 3a874d335..34591305f 100644 --- a/Makefile +++ b/Makefile @@ -247,7 +247,7 @@ precheck: @docker pull efabless/mpw_precheck:latest .PHONY: run-precheck -run-precheck: check-pdk check-precheck enable-lvs-pdk +run-precheck: check-pdk check-precheck @if [ "$$DISABLE_LVS" = "1" ]; then\ $(eval INPUT_DIRECTORY := $(shell pwd)) \ cd $(PRECHECK_ROOT) && \ @@ -260,7 +260,7 @@ run-precheck: check-pdk check-precheck enable-lvs-pdk -e PDK_ROOT=$(PDK_ROOT) \ -e PDKPATH=$(PDKPATH) \ -u $(shell id -u $(USER)):$(shell id -g $(USER)) \ - efabless/mpw_precheck:latest bash -c "cd $(PRECHECK_ROOT) ; python3 mpw_precheck.py --input_directory $(INPUT_DIRECTORY) --pdk_path $(PDK_ROOT)/$(PDK) license makefile default documentation consistency gpio_defines xor magic_drc klayout_feol klayout_beol klayout_offgrid klayout_met_min_ca_density klayout_pin_label_purposes_overlapping_drawing klayout_zeroarea"; \ + efabless/mpw_precheck:latest bash -c "cd $(PRECHECK_ROOT) ; python3 mpw_precheck.py --input_directory $(INPUT_DIRECTORY) --pdk_path $(PDK_ROOT)/$(PDK) --skip_checks LVS"; \ else \ $(eval INPUT_DIRECTORY := $(shell pwd)) \ cd $(PRECHECK_ROOT) && \ @@ -291,6 +291,55 @@ $(LVS_BLOCKS): lvs-% : ./lvs/%/lvs_config.json check-pdk check-precheck -u $(shell id -u $(USER)):$(shell id -g $(USER)) \ efabless/mpw_precheck:latest bash -c "export PYTHONPATH=$(PRECHECK_ROOT) ; cd $(PRECHECK_ROOT) ; python3 checks/lvs_check/lvs.py --pdk_path $(PDK_ROOT)/$(PDK) --design_directory $(INPUT_DIRECTORY) --output_directory $(INPUT_DIRECTORY)/lvs --design_name $* --config_file $(INPUT_DIRECTORY)/lvs/$*/lvs_config.json" +.PHONY: run-oeb +run-oeb: check-pdk check-precheck + @$(eval INPUT_DIRECTORY := $(shell pwd)) + @cd $(PRECHECK_ROOT) && \ + docker run -it -v $(PRECHECK_ROOT):$(PRECHECK_ROOT) \ + -v $(INPUT_DIRECTORY):$(INPUT_DIRECTORY) \ + -v $(PDK_ROOT):$(PDK_ROOT) \ + -v $(HOME)/.ipm:$(HOME)/.ipm \ + -e INPUT_DIRECTORY=$(INPUT_DIRECTORY) \ + -e PDK_PATH=$(PDK_ROOT)/$(PDK) \ + -e PDK_ROOT=$(PDK_ROOT) \ + -e PDKPATH=$(PDKPATH) \ + -u $(shell id -u $(USER)):$(shell id -g $(USER)) \ + efabless/mpw_precheck:latest bash -c "cd $(PRECHECK_ROOT) ; python3 mpw_precheck.py --input_directory $(INPUT_DIRECTORY) --pdk_path $(PDK_ROOT)/$(PDK) OEB"; + +# Define individual drc- targets +BLOCKS = $(shell cd gds && find *.gds -maxdepth 0 -type f | sed 's/.gds//') +DRC_BLOCKS = $(foreach block, $(BLOCKS), drc-$(block)) +$(DRC_BLOCKS): drc-% : gds/%.gds check-pdk check-precheck + @mkdir -p drc/logs + @$(eval INPUT_DIRECTORY := $(shell pwd)) + @echo "Running DRC check for $*..." + @cd $(PRECHECK_ROOT) && \ + docker run -v $(PRECHECK_ROOT):$(PRECHECK_ROOT) \ + -v $(INPUT_DIRECTORY):$(INPUT_DIRECTORY) \ + -v $(PDK_ROOT):$(PDK_ROOT) \ + -u $(shell id -u $(USER)):$(shell id -g $(USER)) \ + efabless/mpw_precheck:latest bash -c "export PYTHONPATH=$(PRECHECK_ROOT) ; cd $(PRECHECK_ROOT) ; python3 checks/drc_checks/klayout/klayout_gds_drc_check.py --pdk $(PDK) --gds_input_file_path $(INPUT_DIRECTORY)/gds/$*.gds --output_directory $(INPUT_DIRECTORY)/drc --feol --beol --off_grid" + +.PHONY: run-checks +run-checks: check-pdk check-precheck + @if [ -z "$(CHECKS)" ]; then \ + echo "Error: No checks specified. Please provide a list of checks using 'make run-checks CHECKS=\"check1 check2\"'."; \ + exit 1; \ + fi + @$(eval INPUT_DIRECTORY := $(shell pwd)) + @echo "Running precheck with checks: $(CHECKS)..." + @cd $(PRECHECK_ROOT) && \ + docker run -it -v $(PRECHECK_ROOT):$(PRECHECK_ROOT) \ + -v $(INPUT_DIRECTORY):$(INPUT_DIRECTORY) \ + -v $(PDK_ROOT):$(PDK_ROOT) \ + -v $(HOME)/.ipm:$(HOME)/.ipm \ + -e INPUT_DIRECTORY=$(INPUT_DIRECTORY) \ + -e PDK_PATH=$(PDK_ROOT)/$(PDK) \ + -e PDK_ROOT=$(PDK_ROOT) \ + -e PDKPATH=$(PDKPATH) \ + -u $(shell id -u $(USER)):$(shell id -g $(USER)) \ + efabless/mpw_precheck:latest bash -c "cd $(PRECHECK_ROOT) ; python3 mpw_precheck.py --input_directory $(INPUT_DIRECTORY) --pdk_path $(PDK_ROOT)/$(PDK) $(CHECKS)" + .PHONY: clean clean: cd ./verilog/dv/ && \ @@ -360,13 +409,13 @@ cocotb-verify-all-rtl: .PHONY: cocotb-verify-all-gl cocotb-verify-all-gl: - @(cd $(PROJECT_ROOT)/verilog/dv/cocotb && $(PROJECT_ROOT)/venv-cocotb/bin/caravel_cocotb -tl user_proj_tests/user_proj_tests_gl.yaml -sim GL) + @(cd $(PROJECT_ROOT)/verilog/dv/cocotb && $(PROJECT_ROOT)/venv-cocotb/bin/caravel_cocotb -tl user_proj_tests/user_proj_tests_gl.yaml -verbosity quiet) $(cocotb-dv-targets-rtl): cocotb-verify-%-rtl: @(cd $(PROJECT_ROOT)/verilog/dv/cocotb && $(PROJECT_ROOT)/venv-cocotb/bin/caravel_cocotb -t $* ) $(cocotb-dv-targets-gl): cocotb-verify-%-gl: - @(cd $(PROJECT_ROOT)/verilog/dv/cocotb && $(PROJECT_ROOT)/venv-cocotb/bin/caravel_cocotb -t $* -sim GL) + @(cd $(PROJECT_ROOT)/verilog/dv/cocotb && $(PROJECT_ROOT)/venv-cocotb/bin/caravel_cocotb -t $* -verbosity quiet) ./verilog/gl/user_project_wrapper.v: $(error you don't have $@)