Skip to content

Commit 9663a8e

Browse files
committed
makefile: add explicit check-yosys/openroad targets
make all checks for yosys/openroad being installed correctly, but it is possible to invoke the targets directly, bypassing this safety check for use-cases where e.g. only synthesis is run without yosys or a netlist is cached and no yosys is needed Signed-off-by: Øyvind Harboe <[email protected]>
1 parent 1592c42 commit 9663a8e

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

flow/Makefile

Lines changed: 16 additions & 2 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
@@ -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)