Skip to content

synth: stop on a SYNTH_KEEP_MODULES name that is not in the design - #4745

Open
oharboe wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
oharboe:keep-modules-missing
Open

oharboe wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
oharboe:keep-modules-missing

Conversation

@oharboe

@oharboe oharboe commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

A SYNTH_KEEP_MODULES name that matches no module of the design now stops synthesis, naming it. Before, it was a yosys warning, and synthesis went on with that module flattened.

This is how the keep list in the coralnpu work in progress (#4653) went stale unnoticed. The current RTL renamed DispatchV1, LsuV1 and DBus2AxiV1 to DispatchV2, LsuV3 and DBus2AxiV2, and a full flow ran with three of its ten kept units flattened, its timing results wrong, before anything showed it.

Each name must select a module by one of the two patterns the code already uses: the name itself, or slang's uniquified name$.... The SYNTH_KEEP_MODULES entry in variables.yaml says so.

Checked with ORFS's make:

  • asap7/riscv32i, SYNTH_KEEP_MODULES=datapth: stops with SYNTH_KEEP_MODULES: no module datapth in the design.
  • asap7/riscv32i, SYNTH_KEEP_MODULES=datapath: passes.
  • asap7/chi_async_bridge, whose kept modules have slang's uniquified names: passes unchanged.
  • Every name in the three designs that set SYNTH_KEEP_MODULES (chi_async_bridge, swerv_wrapper, and coralnpu in [DO NOT REVIEW] asap7/coralnpu: current RTL from source, SRAMs and register files generated #4653) is a module of its design.

🤖 Generated with Claude Code

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the synthesis script (synth.tcl) to throw an error if a module specified in SYNTH_KEEP_MODULES does not match any module in the design, preventing silent failures due to typos or renamed modules. It also updates the corresponding documentation in FlowVariables.md, variables.json, and variables.yaml to reflect this new behavior. There are no review comments to address, and the changes look solid and well-documented.

A SYNTH_KEEP_MODULES name that matched no module was a yosys warning
and nothing else: synthesis went on with that module flattened. A
misspelled name, or a module the RTL has renamed, changed the result
without a word.

That is how asap7/coralnpu's keep list went stale in The-OpenROAD-Project#4653: the current
RTL renamed DispatchV1, LsuV1 and DBus2AxiV1 to DispatchV2, LsuV3 and
DBus2AxiV2, and a full flow ran with three of its ten units flattened
before anything noticed.

Each name now has to select a module, by either of the two patterns
already used (the name itself, or slang's uniquified name$...);
synthesis stops otherwise, naming it. On asap7/riscv32i a misspelled
name stops synthesis and the real one passes; asap7/chi_async_bridge,
whose kept modules have slang's uniquified names, passes unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@oharboe
oharboe force-pushed the keep-modules-missing branch from 733cb9b to 0bc1a7d Compare October 27, 2026 08:04
@oharboe
oharboe marked this pull request as ready for review October 27, 2026 08:07
@oharboe
oharboe requested a review from jhkim-pii October 27, 2026 11:08
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.

2 participants