Skip to content

Commit bed22db

Browse files
authored
Merge pull request The-OpenROAD-Project#3430 from The-OpenROAD-Project-staging/versions-check
make: check if binaries are valid before continuing
2 parents c840243 + ecd2a17 commit bed22db

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

flow/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,9 @@ $(foreach block,$(BLOCKS),$(eval $(WORK_HOME)/results/$(PLATFORM)/$(DESIGN_NICKN
184184
.PHONY: versions.txt
185185
versions.txt:
186186
mkdir -p $(OBJECTS_DIR)
187-
@echo "yosys $(if $(YOSYS_EXE),$(shell $(YOSYS_EXE) -V 2>&1),not available)" > $(OBJECTS_DIR)/$@
188-
@echo "openroad $(if $(OPENROAD_EXE),$(shell $(OPENROAD_EXE) -version 2>&1),not available)" >> $(OBJECTS_DIR)/$@
189-
@echo "klayout $(if $(KLAYOUT_CMD),$(shell $(KLAYOUT_CMD) -zz -v 2>&1),not available)" >> $(OBJECTS_DIR)/$@
187+
@echo "yosys $(shell $(YOSYS_EXE) -V 2>&1)" > $(OBJECTS_DIR)/$@
188+
@echo "openroad $(shell $(OPENROAD_EXE) -version 2>&1)" >> $(OBJECTS_DIR)/$@
189+
@echo "klayout $(shell $(KLAYOUT_CMD) -zz -v 2>&1)" >> $(OBJECTS_DIR)/$@
190190

191191
# Pre-process libraries
192192
# ==============================================================================

flow/scripts/variables.mk

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ else
9797
export OPENSTA_EXE ?= $(abspath $(FLOW_HOME)/../tools/install/OpenROAD/bin/sta)
9898
endif
9999

100+
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
104+
100105
export OPENROAD_ARGS = -no_init -threads $(NUM_CORES) $(OR_ARGS)
101106
export OPENROAD_CMD = $(OPENROAD_EXE) -exit $(OPENROAD_ARGS)
102107
export OPENROAD_NO_EXIT_CMD = $(OPENROAD_EXE) $(OPENROAD_ARGS)
@@ -109,6 +114,11 @@ else
109114
endif
110115
export YOSYS_EXE
111116

117+
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
121+
112122
# Use locally installed and built klayout if it exists, otherwise use klayout in path
113123
KLAYOUT_DIR = $(abspath $(FLOW_HOME)/../tools/install/klayout/)
114124
KLAYOUT_BIN_FROM_DIR = $(KLAYOUT_DIR)/klayout

0 commit comments

Comments
 (0)