From 4eb2777d401e1f5faf908e7f354bf99b4e0a285d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Fri, 3 Jan 2025 08:11:13 +0100 Subject: [PATCH 1/2] makefile: make RUN_LOG_NAME_STEM=foo run to specify name of log MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Short explanation: simpler scripting, better impedance match with makefiles and bazel. Signed-off-by: Øyvind Harboe --- flow/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/flow/Makefile b/flow/Makefile index 6ab41d8812..31c4f376e7 100644 --- a/flow/Makefile +++ b/flow/Makefile @@ -1051,10 +1051,12 @@ test-unset-and-make-%: ; $(UNSET_AND_MAKE) $* klayout: $(KLAYOUT_CMD) +export RUN_LOG_NAME_STEM ?= run + .phony: run run: @mkdir -p $(RESULTS_DIR) $(LOG_DIR) $(REPORTS_DIR) $(OBJECTS_DIR) - ($(OPENROAD_CMD) -no_splash $(if $(filter %.py,$(RUN_SCRIPT)),-python) $(RUN_SCRIPT) 2>&1 | tee $(abspath $(LOG_DIR)/run.log)) + ($(OPENROAD_CMD) -no_splash $(if $(filter %.py,$(RUN_SCRIPT)),-python) $(RUN_SCRIPT) 2>&1 | tee $(abspath $(LOG_DIR)/$(RUN_LOG_NAME_STEM).log)) # Utilities #------------------------------------------------------------------------------- From c5bdd905ec5a8eaa67b287c6376155b6dfb9b399 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Fri, 3 Jan 2025 08:34:34 +0100 Subject: [PATCH 2/2] variables: document make run variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Øyvind Harboe --- flow/Makefile | 2 -- flow/scripts/variables.yaml | 9 +++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/flow/Makefile b/flow/Makefile index 31c4f376e7..3e00b99ff3 100644 --- a/flow/Makefile +++ b/flow/Makefile @@ -1051,8 +1051,6 @@ test-unset-and-make-%: ; $(UNSET_AND_MAKE) $* klayout: $(KLAYOUT_CMD) -export RUN_LOG_NAME_STEM ?= run - .phony: run run: @mkdir -p $(RESULTS_DIR) $(LOG_DIR) $(REPORTS_DIR) $(OBJECTS_DIR) diff --git a/flow/scripts/variables.yaml b/flow/scripts/variables.yaml index eb2453ad6b..39a1893d66 100644 --- a/flow/scripts/variables.yaml +++ b/flow/scripts/variables.yaml @@ -875,3 +875,12 @@ GDS_ALLOW_EMPTY: Regular expression of module names of macros that have no .gds file stages: - final +RUN_SCRIPT: + description: > + Path to script to run from `make run`, python or tcl script detected by + .py or .tcl extension. +RUN_LOG_NAME_STEM: + description: > + Stem of the log file name, the log file will be named + `$(LOG_DIR)/$(RUN_LOG_NAME_STEM).log`. + default: run