Skip to content

Commit 310b641

Browse files
authored
Merge pull request #3449 from Pinata-Consulting/makefile-check-yosys-openroad-explicitly
makefile: add explicit check-yosys/openroad targets
2 parents 2d85a03 + ee80773 commit 310b641

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

flow/Makefile

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ MAKEFLAGS += --no-builtin-rules
132132

133133
#-------------------------------------------------------------------------------
134134
# Default target when invoking without specific target.
135-
.DEFAULT_GOAL := finish
135+
.DEFAULT_GOAL := all
136136

137137
#-------------------------------------------------------------------------------
138138
# Proper way to initiate SHELL for make
@@ -182,7 +182,7 @@ $(foreach block,$(BLOCKS),$(eval $(WORK_HOME)/results/$(PLATFORM)/$(DESIGN_NICKN
182182
# Utility to print tool version information
183183
#-------------------------------------------------------------------------------
184184
.PHONY: versions.txt
185-
versions.txt:
185+
versions.txt: check-yosys check-openroad
186186
mkdir -p $(OBJECTS_DIR)
187187
@echo "yosys $(shell $(YOSYS_EXE) -V 2>&1)" > $(OBJECTS_DIR)/$@
188188
@echo "openroad $(shell $(OPENROAD_EXE) -version 2>&1)" >> $(OBJECTS_DIR)/$@
@@ -746,8 +746,22 @@ clean_finish:
746746
#
747747
# ==============================================================================
748748

749+
.PHONY: check-openroad
750+
check-openroad:
751+
@if [ "$(strip $(OPENROAD_IS_VALID))" != "true" ]; then \
752+
echo "OPENROAD_EXE is set to '$(OPENROAD_EXE)', but it is either not found or not executable."; \
753+
exit 1; \
754+
fi
755+
756+
.PHONY: check-yosys
757+
check-yosys:
758+
@if [ "$(strip $(YOSYS_IS_VALID))" != "true" ]; then \
759+
echo "YOSYS_EXE is set to '$(YOSYS_EXE)', but it is either not found or not executable."; \
760+
exit 1; \
761+
fi
762+
749763
.PHONY: all
750-
all: synth floorplan place cts route finish
764+
all: check-yosys check-openroad synth floorplan place cts route finish
751765

752766
.PHONY: clean
753767
clean:

flow/scripts/variables.mk

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@ else
9898
endif
9999

100100
OPENROAD_IS_VALID := $(if $(OPENROAD_EXE),$(shell test -x $(OPENROAD_EXE) && echo "true"),)
101-
ifneq ($(strip $(OPENROAD_IS_VALID)),true)
102-
$(error OPENROAD_EXE is set to '$(OPENROAD_EXE)', but it is either not found or not executable.)
103-
endif
104101

105102
export OPENROAD_ARGS = -no_init -threads $(NUM_CORES) $(OR_ARGS)
106103
export OPENROAD_CMD = $(OPENROAD_EXE) -exit $(OPENROAD_ARGS)
@@ -115,9 +112,6 @@ endif
115112
export YOSYS_EXE
116113

117114
YOSYS_IS_VALID := $(if $(YOSYS_EXE),$(shell test -x $(YOSYS_EXE) && echo "true"),)
118-
ifneq ($(strip $(YOSYS_IS_VALID)),true)
119-
$(error YOSYS_EXE is set to '$(YOSYS_EXE)', but it is either not found or not executable.)
120-
endif
121115

122116
# Use locally installed and built klayout if it exists, otherwise use klayout in path
123117
KLAYOUT_DIR = $(abspath $(FLOW_HOME)/../tools/install/klayout/)

0 commit comments

Comments
 (0)