Skip to content

Orfs pr fixes#715

Merged
oharboe merged 4 commits into
mainfrom
orfs-pr-fixes
May 5, 2026
Merged

Orfs pr fixes#715
oharboe merged 4 commits into
mainfrom
orfs-pr-fixes

Conversation

@oharboe
Copy link
Copy Markdown
Collaborator

@oharboe oharboe commented May 5, 2026

No description provided.

oharboe added 4 commits May 5, 2026 10:36
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>
@oharboe oharboe merged commit 5c89e35 into main May 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant