Skip to content

AUTO_MEMORIES: stop when a module to blackbox is not a black box - #4661

Merged
maliberty merged 4 commits into
The-OpenROAD-Project:masterfrom
oharboe:auto-memories-blackbox-check
Oct 22, 2026
Merged

maliberty merged 4 commits into
The-OpenROAD-Project:masterfrom
oharboe:auto-memories-blackbox-check

Conversation

@oharboe

@oharboe oharboe commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

read_slang's --blackboxed-module ignores a name it does not know. When a name in blackboxes.txt is not a module definition, the memory's behavioral body is synthesized, and the flow says so only later, as a memory over SYNTH_MEMORY_MAX_BITS with no hint of why. asap7/tage_update (#4595) hit this with slang's per-instance names, <definition>$<instance path>.

After read_slang, every name in blackboxes.txt must now be a module with the blackbox attribute; synthesis stops otherwise, naming the modules. The test reads a design that instances one memory module twice: the definition name passes, the per-instance names and an unknown name stop. It is skipped without a yosys that has read_slang. The yosys Verilog frontend is not checked: slang is the supported frontend for AUTO_MEMORIES.

Interacts with #4650: this reads names through auto_memories_blackboxes; once blackboxes.txt carries an area column, that proc takes the first column. Whichever lands second rebases.

🤖 Generated with Claude Code

read_slang's --blackboxed-module ignores a name it does not know. When
a name in blackboxes.txt is not a module definition -- slang names a
module per instance, `<definition>$<instance path>`, and a detector
that reports those names hands read_slang names it never matches --
the memory's behavioral body is synthesized, and the flow says so only
later, as a memory over SYNTH_MEMORY_MAX_BITS with no hint of why.

After read_slang, every name in blackboxes.txt must now be a module
with the blackbox attribute; synthesis stops otherwise, naming the
modules. Tested with a design that instances one memory module twice:
the definition name passes, the per-instance names and an unknown name
stop. The test is skipped without a yosys that has read_slang. The
yosys Verilog frontend is not checked: slang is the supported frontend
for AUTO_MEMORIES.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
read_slang blackboxes the escaped module `\1d_ram` given
`--blackboxed-module 1d_ram`, and yosys then lists it as `\1d_ram`; the
check compared the two as they stood and stopped a design whose memory
was blackboxed. The listed names now lose yosys's leading backslash
before the comparison. The test design gains an escaped memory module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>

@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 introduces a validation step to ensure that modules requested to be blackboxed during synthesis are correctly recognized as blackboxes after reading the design sources, preventing silent failures. This is implemented via a new Tcl script check_blackboxed.tcl integrated into the synthesis preamble, and is supported by a comprehensive Python unit test suite. The review feedback suggests optimizing the validation procedure by returning early when no names are provided and improving the robustness of parsing the Yosys output.

Review: return before the select when blackboxes.txt is empty, and trim
each line of the module list, skipping empty ones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@openroad-ci

openroad-ci commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

🔍 QoR check

Metrics reflect the PR merge build — i.e. what will land on the target branch.

Commit f9d5fa0 · Jenkins build #5 · Baseline: build · View build on dashboard

62 design(s) checked — 0 with regression(s), 0 without a comparable baseline.

@maliberty

Copy link
Copy Markdown
Member

merge conflict

…box-check

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@oharboe

oharboe commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator Author

merge conflict

fixed

@oharboe
oharboe requested a review from maliberty October 18, 2026 10:24
@maliberty
maliberty merged commit 0b56643 into The-OpenROAD-Project:master Oct 22, 2026
13 checks 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.

3 participants