Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 22 additions & 13 deletions flow/scripts/variables.mk
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ export NUM_CORES
# that does not exist in a Bazel sandbox). A bare `export` preserves the
# original origin (environment when bazel-orfs supplies it, file when the
# local default fills in), so the value survives UNSET_VARS.
PYTHON_EXE ?= $(shell command -v python3)
ifeq ($(origin PYTHON_EXE), undefined)
PYTHON_EXE := $(shell command -v python3)
endif
export PYTHON_EXE

export RUN_CMD = $(PYTHON_EXE) $(FLOW_HOME)/scripts/run_command.py
Expand All @@ -91,15 +93,20 @@ export RUN_CMD = $(PYTHON_EXE) $(FLOW_HOME)/scripts/run_command.py
# 2 either
# 2.1 if in Nix shell: openroad, yosys from the environment
# 2.2 ORFS compiled tools: openroad, yosys
ifneq (${IN_NIX_SHELL},)
OPENROAD_EXE ?= $(shell command -v openroad)
else
OPENROAD_EXE ?= $(abspath $(FLOW_HOME)/../tools/install/OpenROAD/bin/openroad)
ifeq ($(origin OPENROAD_EXE), undefined)
ifneq (${IN_NIX_SHELL},)
OPENROAD_EXE := $(shell command -v openroad)
else
OPENROAD_EXE := $(abspath $(FLOW_HOME)/../tools/install/OpenROAD/bin/openroad)
endif
endif
ifneq (${IN_NIX_SHELL},)
OPENSTA_EXE ?= $(shell command -v sta)
else
OPENSTA_EXE ?= $(abspath $(FLOW_HOME)/../tools/install/OpenROAD/bin/sta)

ifeq ($(origin OPENSTA_EXE), undefined)
ifneq (${IN_NIX_SHELL},)
OPENSTA_EXE := $(shell command -v sta)
else
OPENSTA_EXE := $(abspath $(FLOW_HOME)/../tools/install/OpenROAD/bin/sta)
endif
endif

# See dragons comment near PYTHON_EXE: bare `export`, not `export VAR := $(VAR)`.
Expand All @@ -114,10 +121,12 @@ export OPENROAD_NO_EXIT_CMD = $(OPENROAD_EXE) $(OPENROAD_ARGS)
export OPENROAD_GUI_CMD = $(OPENROAD_EXE) -gui -threads $(NUM_CORES) $(OR_ARGS)
export OPENROAD_WEB_CMD = $(OPENROAD_EXE) -web -threads $(NUM_CORES) $(OR_ARGS)

ifneq (${IN_NIX_SHELL},)
YOSYS_EXE ?= $(shell command -v yosys)
else
YOSYS_EXE ?= $(abspath $(FLOW_HOME)/../tools/install/yosys/bin/yosys)
ifeq ($(origin YOSYS_EXE), undefined)
ifneq (${IN_NIX_SHELL},)
YOSYS_EXE := $(shell command -v yosys)
else
YOSYS_EXE := $(abspath $(FLOW_HOME)/../tools/install/yosys/bin/yosys)
endif
endif

# See dragons comment near PYTHON_EXE: bare `export`, not `export VAR := $(VAR)`.
Expand Down
Loading