|
| 1 | +diff --git a/private/orfs_design.bzl b/private/orfs_design.bzl |
| 2 | +--- a/private/orfs_design.bzl |
| 3 | ++++ b/private/orfs_design.bzl |
| 4 | +@@ -47,7 +47,7 @@ |
| 5 | + result[var] = converted |
| 6 | + return result |
| 7 | + |
| 8 | +-def orfs_design(name = None, config = "config.mk", platform = None, design = None, designs = None, mock_openroad = None, mock_yosys = None, user_arguments = []): # buildifier: disable=unused-variable |
| 9 | ++def orfs_design(name = None, config = "config.mk", platform = None, design = None, designs = None, mock_openroad = None, mock_yosys = None, user_arguments = [], local_arguments = []): # buildifier: disable=unused-variable |
| 10 | + """Create orfs_flow() targets for a design based on its parsed config.mk. |
| 11 | + |
| 12 | + Usage: |
| 13 | +@@ -79,6 +79,12 @@ |
| 14 | + Routed through orfs_flow(user_arguments=...) to bypass the |
| 15 | + variables.yaml validator instead of being checked as known |
| 16 | + ORFS arguments. |
| 17 | ++ local_arguments: List of variable names that are only used for |
| 18 | ++ $(VAR) expansion within the same config.mk and are not read |
| 19 | ++ by ORFS or by any user .tcl/.mk (e.g. VERILOG_FILES_BLACKBOX, |
| 20 | ++ which appears verbatim inside VERILOG_FILES). These are |
| 21 | ++ dropped entirely before orfs_flow() is invoked — neither |
| 22 | ++ validated against variables.yaml nor exposed as env vars. |
| 23 | + """ |
| 24 | + if designs == None: |
| 25 | + fail("orfs_design() requires designs: load orfs_design from @orfs_designs//:designs.bzl") |
| 26 | +@@ -172,6 +178,16 @@ |
| 27 | + # Real flow — uses Docker image with real OpenROAD/Yosys |
| 28 | + arguments = dict(config["arguments"]) |
| 29 | + |
| 30 | ++ # Drop caller-flagged local helper vars used only via $(VAR) |
| 31 | ++ # expansion within the same config.mk (e.g. VERILOG_FILES_BLACKBOX). |
| 32 | ++ # They must not reach orfs_flow — they would either fail validation |
| 33 | ++ # or be exposed as noise env vars. The config.mk parser may classify |
| 34 | ++ # such helpers as either arguments or sources (e.g. when they expand |
| 35 | ++ # to file globs), so drop from both. |
| 36 | ++ for var in local_arguments: |
| 37 | ++ arguments.pop(var, None) |
| 38 | ++ sources.pop(var, None) |
| 39 | ++ |
| 40 | + # Move caller-flagged design-specific knobs out of arguments and into |
| 41 | + # user_arguments so they bypass the variables.yaml validator. |
| 42 | + user_args = {} |
0 commit comments