Skip to content

Commit a3327a9

Browse files
oharboeclaude
andcommitted
flow: make vars leaves out the command_is_valid function
command_is_valid is the make function the OPENROAD_EXE and YOSYS_EXE checks call, not a flow variable, but get_variables listed it with the variables, so make vars wrote an empty command_is_valid entry to vars.sh, vars.tcl and vars.gdb. It is now in get_variables' exclusion list, beside OPENROAD_IS_VALID. test_vars_leave_out_the_check_function runs make vars and checks none of the three files has the entry; it failed on all three before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
1 parent 8ea9f34 commit a3327a9

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

‎flow/scripts/variables.mk‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ export RESULTS_V = $(notdir $(sort $(wildcard $(RESULTS_DIR)/*.v)))
198198
export GDS_MERGED_FILE = $(RESULTS_DIR)/6_1_merged.$(STREAM_SYSTEM_EXT)
199199

200200
define get_variables
201-
$(foreach V, $(.VARIABLES),$(if $(filter-out $(1), $(origin $V)), $(if $(filter-out .% %QT_QPA_PLATFORM% KLAYOUT% OPENROAD_EXE OPENROAD_ARGS OPENROAD_CMD OPENROAD_NO_EXIT_CMD OPENROAD_GUI_CMD OPENROAD_WEB_CMD OPENROAD_IS_VALID OPENSTA% PYTHON% YOSYS% GENERATE_ABSTRACT_RULE% do-step% do-copy% OPEN_GUI% OPEN_GUI_SHORTCUT% SUB_MAKE% UNSET_VARS% export%, $(V)), $V$ )))
201+
$(foreach V, $(.VARIABLES),$(if $(filter-out $(1), $(origin $V)), $(if $(filter-out .% %QT_QPA_PLATFORM% KLAYOUT% OPENROAD_EXE OPENROAD_ARGS OPENROAD_CMD OPENROAD_NO_EXIT_CMD OPENROAD_GUI_CMD OPENROAD_WEB_CMD OPENROAD_IS_VALID command_is_valid OPENSTA% PYTHON% YOSYS% GENERATE_ABSTRACT_RULE% do-step% do-copy% OPEN_GUI% OPEN_GUI_SHORTCUT% SUB_MAKE% UNSET_VARS% export%, $(V)), $V$ )))
202202
endef
203203

204204
export UNSET_VARIABLES_NAMES := $(call get_variables,command% line environment% default automatic)

‎flow/test/test_openroad_exe.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,20 @@ def test_gdb_and_valgrind_are_not_switches(self):
241241
self.assertEqual(result.stdout, expected.stdout)
242242
self.assertEqual(calls, expected_calls)
243243

244+
def test_vars_leave_out_the_check_function(self):
245+
# command_is_valid is a make function the check uses, not a flow
246+
# variable: make vars writes no entry for it
247+
result, _ = self.make("vars", env={"OPENROAD_EXE": self.openroad})
248+
self.assertEqual(result.returncode, 0, result.stderr)
249+
objects = os.path.join(
250+
self.work_home, "objects", "nangate45", "gcd", "openroad_exe"
251+
)
252+
for ext in ("sh", "tcl", "gdb"):
253+
with self.subTest(ext=ext):
254+
with open(os.path.join(objects, f"vars.{ext}")) as f:
255+
found = "command_is_valid" in f.read()
256+
self.assertFalse(found, f"vars.{ext} has a command_is_valid entry")
257+
244258

245259
if __name__ == "__main__":
246260
unittest.main()

0 commit comments

Comments
 (0)