Repository navigation
make: immediately expand deferred vars, v2 - #4589
Conversation
Previous approach apparently caused some externally-defined variables to become overwritten, and modifications made in 72eca88 effectively reverted back to the old behaviour of spawning a huge number of shells for each `make` invocation. Try to cut that number down again by requiring that the runtime environment provide appropriate values for PYTHON_EXE, OPENROAD_EXE, OPENSTA_EXE and YOSYS_EXE, otherwise use ORFS-built tools. Signed-off-by: ctkiku <kim.kuparinen@tuni.fi>
There was a problem hiding this comment.
Code Review
This pull request refactors flow/scripts/variables.mk to optimize performance by avoiding deferred shell commands that spawn excessive shell instances. It simplifies the definitions of OPENROAD_EXE, OPENSTA_EXE, and YOSYS_EXE, and checks if PYTHON_EXE is undefined before running a shell command to locate it. Feedback suggests using $(strip $(PYTHON_EXE)) instead of checking $(origin PYTHON_EXE) against undefined to more robustly handle cases where the variable is defined but empty.
| ifeq ($(origin PYTHON_EXE), undefined) | ||
| PYTHON_EXE := $(shell command -v python3) | ||
| endif |
There was a problem hiding this comment.
Checking $(origin PYTHON_EXE) against undefined will not detect cases where PYTHON_EXE is defined but empty (e.g., if exported as an empty string from the environment or a wrapper script). Using $(strip $(PYTHON_EXE)) is more robust as it handles both undefined and empty values gracefully.
ifeq ($(strip $(PYTHON_EXE)),)
PYTHON_EXE := $(shell command -v python3)
endif
|
Just noticed that grepping for |
Keep it. Sometimes we use it to create standalone opensta test cases and also in power simulation, it can be handy. openroad normally executes .tcl scripts that opensta could have run. |
|
LGTM @hzeller ? |
🔍 QoR checkMetrics reflect the PR merge build — i.e. what will land on the target branch. Commit 62 design(s) checked — 0 with regression(s), 0 without a comparable baseline. |
|
@maliberty A nice simplification. |
3fb51dc
into
The-OpenROAD-Project:master
Previous approach apparently caused some externally-defined variables to become overwritten, and modifications made in 72eca88 effectively reverted back to the old behaviour of spawning a huge number of shells for each
makeinvocation. Try to cut that number down again by requiring that the runtime environment provide appropriate values for PYTHON_EXE, OPENROAD_EXE, OPENSTA_EXE and YOSYS_EXE, otherwise use ORFS-built tools.Related PR from which this was split: #4573. Weak dependency on #4588, as the Nix flake will not pass in the expected vars otherwise. Although, as mentioned in #4573, the flake is currently a bit broken anyway.
@oharboe