Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Makefile targets to run specific checks #385

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 50 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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) && \
Expand Down Expand Up @@ -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-<block> 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/ && \
Expand Down
20 changes: 20 additions & 0 deletions docs/source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,26 @@ make caravel-sta

A summary of timing results is provided at the end.

## Running standalone checks

To run the DRC (Design Rule Check) for a specific macro, use the target:

```bash
make drc-<macro_name>
```

Replace <macro_name> with the name of the macro you want to check. For example, if your macro is named `user_project_wrapper`, you can run:

```bash
make drc-user_project_wrapper
```

The OEB (Output Enable Bar) check ensures proper GPIO output configurations. To run the OEB check, use:

```bash
make run-oeb
```

## Checklist for Shuttle Submission

- ✔️ The project repo follows the directory structure in this repo.
Expand Down
Loading