@@ -267,8 +267,9 @@ endif
267267
268268# The following determine the executable location for each tool used by this flow.
269269# Priority is given to
270- # 1 user include path to the executable prior to running make
271- # 2 user explicit set with variable in Makefile or command line
270+ # 1 user explicit set with variable in Makefile or command line, for instance setting OPENROAD_EXE
271+ # 2 user include PATH to the executable prior to running make
272+ # 3 ORFS compiled tools: openroad, yosys
272273export OPENROAD_EXE ?= $(shell command -v openroad)
273274ifeq ($(OPENROAD_EXE ) ,)
274275 export OPENROAD_EXE = $(abspath $(FLOW_HOME ) /../tools/install/OpenROAD/bin/openroad)
@@ -278,17 +279,20 @@ OPENROAD_CMD = $(OPENROAD_EXE) -exit $(OPENROAD_ARGS)
278279OPENROAD_NO_EXIT_CMD = $(OPENROAD_EXE ) $(OPENROAD_ARGS )
279280OPENROAD_GUI_CMD = $(OPENROAD_EXE ) -gui $(OR_ARGS )
280281
282+ YOSYS_OLDEST_VERSION = 0.13
281283YOSYS_CMD ?= $(shell command -v yosys)
282- YOSYS_VER := $(shell $(YOSYS_CMD ) -V | sed -n 's/^Yosys \([0-9]* \.[0-9]* \) .*/\1/p')
283-
284- # Semantic Versioning Comparison
285- VERSION_GTEQ := $(shell echo -e "$(YOSYS_VER ) \n0.13" | sort -V | head -n1)
286- ifeq ($(VERSION_GTEQ ) ,0.13)
287- $(info Using Yosys $(YOSYS_VER) found in path, it is newer or equal to 0.13)
288- else
289- YOSYS_CMD = $(abspath $(FLOW_HOME ) /../tools/install/yosys/bin/yosys)
290- $(info Using $(YOSYS_CMD) instead of $(YOSYS_VER) found in path, minimum Yosys 0.13)
284+ ifneq ($(YOSYS_CMD ) ,)
285+ YOSYS_VER := $(shell $(YOSYS_CMD ) -V | sed -n 's/^Yosys \([0-9]* \.[0-9]* \) .*/\1/p')
286+ # Semantic Versioning Comparison
287+ VERSION_GTEQ := $(shell echo -e "$(YOSYS_VER ) \n$(YOSYS_OLDEST_VERSION ) " | sort -V | head -n1)
288+ ifeq ($(VERSION_GTEQ),$(YOSYS_OLDEST_VERSION))
289+ $(info Using Yosys $(YOSYS_VER) found in path, it is newer or equal to $(YOSYS_OLDEST_VERSION))
290+ else
291+ $(info Yosys $(YOSYS_VER) is too old, using $(abspath $(FLOW_HOME)/../tools/install/yosys/bin/yosys))
292+ undefine YOSYS_CMD
293+ endif
291294endif
295+ YOSYS_CMD ?= $(abspath $(FLOW_HOME ) /../tools/install/yosys/bin/yosys)
292296
293297KLAYOUT_CMD ?= $(shell command -v klayout)
294298
0 commit comments