| # Top-level module |
| export DESIGN_NAME ?= wrapper |
| |
| .PHONY: deps.syn check_design.syn lookup.syn clean.syn |
| |
| dirs.syn: |
| $(eval RESULTS_DIR := $(RESULTS_PATH)/dc) |
| $(eval REPORT_DIR := $(REPORT_PATH)/dc) |
| $(eval LOG_DIR := $(LOG_PATH)/dc) |
| $(eval BUILD_DIR := $(RESULTS_DIR)/$(TB).$(CFG)) |
| |
| $(shell mkdir -p $(LOG_DIR)) |
| $(shell mkdir -p $(REPORT_DIR)) |
| |
| # Check if the design is synthesizable. This is not an actual synthesis run, |
| # but rather runs analysis and elaboration on the design without linking any |
| # specific process. This is significantly quicker than running a full synthesis |
| # run and doesn't require any design constraints. Instead, this let's RTL |
| # designers catch issues with the design such as non-synthesizable code. The |
| # wildcard in the target. |
| |
| check_design.syn: CHK_LOG ?= $(LOG_DIR)/$(TB).$(CFG).check_design.log |
| check_design.syn: CHK_REPORT ?= $(REPORT_DIR)/$(TB).$(CFG).check_design.rpt |
| check_design.syn: CHK_ERROR ?= $(REPORT_DIR)/$(TB).$(CFG).check_design.err |
| check_design.syn: dirs.syn |
| $(shell mkdir -p $(BUILD_DIR)) |
| $(eval include $(TB_PATH)/$(TB)/Makefile.frag) |
| -@sed "s/BP_CFG_FLOWVAR/$(CFG)/g" $(TB_PATH)/$(TB)/wrapper.v > $(BUILD_DIR)/wrapper.v |
| -@grep -v -e "^\#" $(SYN_PATH)/flist.vcs > $(BUILD_DIR)/flist.vcs |
| -@echo $(BUILD_DIR)/wrapper.v >> $(BUILD_DIR)/flist.vcs |
| cd $(BUILD_DIR); \ |
| $(DC_SHELL) -64bit -f $(BP_COMMON_DIR)/syn/tcl/dc_elab.tcl | tee -i $(CHK_LOG) |
| -@grep --color "^Error" $(CHK_LOG) | tee $(CHK_ERROR) |
| -@grep --color "Complex logic will not be considered" $(CHK_LOG) | tee -a $(CHK_ERROR) |
| -@grep --color -B 3 "*** Presto compilation terminated" $(CHK_LOG) | tee -a $(CHK_ERROR) |
| -@grep --color "unresolved references." $(CHK_LOG) | tee -a $(CHK_ERROR) |
| -@grep --color "Cannot find the design" $(CHK_LOG) | tee -a $(CHK_ERROR) |
| -@grep --color "undeclared symbol" $(CHK_LOG) | tee -a $(CHK_ERROR) |
| -@grep --color "(ELAB-395)" $(CHK_LOG) | tee -a $(CHK_ERROR) |
| -@test -s $(CHK_ERROR) && echo "Design Compiler check_synth: FAILED" > $(CHK_REPORT) \ |
| || (echo "Design Compiler check_synth: PASSED" > $(CHK_REPORT) && rm $(CHK_ERROR)) |
| |
| # This target allows users to look up commands and message codes for |
| # DesignCompiler. If there is a message with a code (e.g. LINT-1) then you can |
| # replace the wildcard with the code (e.g. make LINT-1.lookup.syn) to query |
| # DesignCompiler for a detailed explaination of the message code. You can also |
| # use this for DesignCompiler commands and application variables. |
| |
| lookup.syn: |
| $(DC_SHELL) -64bit -x "set_app_var sh_command_log_file /dev/null; man $*; exit" |
| |
| # Cleanup all files generated by DesignCompiler |
| |
| clean.syn: |
| @rm -rf results/dc |
| @rm -rf reports/dc |
| @rm -rf logs/dc |
| |