Orfs pr fixes#715
Merged
Merged
Conversation
orfs_design.bzl auto-injects SYNTH_NUM_PARTITIONS into the orfs_flow arguments dict whenever SYNTH_HIERARCHICAL=1, but check_variables() walks every key in arguments and fails on anything not in the downstream variables.yaml -- so the validator complains about a variable bazel-orfs put there itself. ORFS doesn't read SYNTH_NUM_PARTITIONS, so adding it to ORFS variables.yaml would be wrong; it belongs in the bazel-orfs internal var registry. Populate BAZEL_VARIABLE_TO_STAGES with SYNTH_NUM_PARTITIONS and merge BAZEL_STAGE_TO_VARIABLES into ALL_STAGE_TO_VARIABLES (it was declared as an empty dict and never used until now). Signed-off-by: Øyvind Harboe <oyvind@ascenium.com>
ORFS variables.yaml defaults SYNTH_SKIP_KEEP to 0, and defaults.py emits 'export SYNTH_SKIP_KEEP?=0'. The script tested with '[ -n "$SYNTH_SKIP_KEEP" ]', which is true for any non-empty string including "0", so the skip-keep branch ran when it shouldn't have. That branch then grepped for 1_1_yosys_canonicalize.rtlil that the partition action's sandbox doesn't have, killing every SYNTH_HIERARCHICAL=1 design that didn't also set SYNTH_KEEP_MODULES. Test for the literal "1" instead. Signed-off-by: Øyvind Harboe <oyvind@ascenium.com>
The sed-based parser used 's/.*\[//;s/\].*//;...' which is greedy. Slang elaborates parameterised instances into names that contain '[' and ']' (e.g. tcdm_adapter\$mempool_group.gen_tiles[0].i_tile.gen_banks[0]), so 's/.*\[//' strips up to the LAST '[' and 's/\].*//' strips from the FIRST ']' -- leaving a single garbage module name like "0". nangate45/mempool_group hit this, with the partition action printing 'synthesizing 1 modules: 0' and then 'Module \`0' not found'. Module names cannot contain '"', so 'grep -oE "\\\"[^\\\"]+\\\""' followed by 'tail -n +2' (skip the "modules" key) is a safe parse without greedy backtracking. Signed-off-by: Øyvind Harboe <oyvind@ascenium.com>
orfs_flow already accepts a user_arguments dict that bypasses the
variables.yaml validator -- intended for project-specific env vars
read only by user-supplied .tcl/.mk. orfs_design didn't expose that,
so config.mk vars like FP_PDN_RAIL_OFFSET (read by a design's own
pdn.cfg, not by ORFS) were rejected as "Unknown ORFS variable".
Add a user_arguments parameter to orfs_design that takes a list of
config.mk variable names to lift out of the validated arguments dict
and forward as orfs_flow's user_arguments. Designs that need it call:
orfs_design(
designs = DESIGNS,
user_arguments = ["FP_PDN_RAIL_OFFSET", "FP_PDN_RAIL_WIDTH"],
)
Signed-off-by: Øyvind Harboe <oyvind@ascenium.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.