Skip to content

Commit a04105f

Browse files
committed
makefile: do not use outdated yosys binaries
Signed-off-by: Øyvind Harboe <[email protected]>
1 parent 9a5de46 commit a04105f

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

flow/Makefile

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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
272273
export OPENROAD_EXE ?= $(shell command -v openroad)
273274
ifeq ($(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)
278279
OPENROAD_NO_EXIT_CMD = $(OPENROAD_EXE) $(OPENROAD_ARGS)
279280
OPENROAD_GUI_CMD = $(OPENROAD_EXE) -gui $(OR_ARGS)
280281

282+
YOSYS_OLDEST_VERSION = 0.13
281283
YOSYS_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
291294
endif
295+
YOSYS_CMD ?= $(abspath $(FLOW_HOME)/../tools/install/yosys/bin/yosys)
292296

293297
KLAYOUT_CMD ?= $(shell command -v klayout)
294298

0 commit comments

Comments
 (0)