AUTO_MEMORIES detection cannot run as shipped - #4544
Merged
maliberty merged 2 commits intoSep 22, 2026
Merged
Conversation
AUTO_MEMORIES is a two step flow and flow/Makefile orders it that way. extract_memories.tcl produces results/memories_inferred.json, and gen_memories.py turns that into results/memories/, which includes blackboxes.txt, the list of modules synthesis is to blackbox. extract_memories.tcl reads its sources through synth_preamble.tcl's read_design_sources, and every frontend branch of that proc calls auto_memories_blackboxes, which errors when results/memories/blackboxes.txt is absent: ERROR: AUTO_MEMORIES=1 but .../results/memories/blackboxes.txt is missing; the do-auto-memories step must run before synthesis So the pass whose output that list is derived from fails because the list does not exist yet. The guard is right for synthesis, where reaching it without a blackbox list means a step was skipped, and wrong for the detection pass, which is the one caller that has to tolerate its absence. Clear AUTO_MEMORIES for the extraction process only. Nothing else clears it, so the guard keeps its full strength everywhere else. Blackboxing during detection would be wrong on its own terms: a blackboxed module has no memory to infer, so the pass would inventory nothing. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
extract_memories.tcl runs under yosys's Tcl shell and asks for the
process conversion pass by writing
proc
memory -nomap
yosys -import (synth_preamble.tcl line 1) imports yosys commands into
the Tcl namespace, but it cannot shadow a Tcl built-in, and proc is the
one that defines a procedure. The bare word reaches Tcl instead of
yosys and the pass dies:
ERROR: TCL interpreter returned an error:
wrong # args: should be "proc name args body"
memory -nomap on the next line is unaffected because memory is not a
Tcl built-in, which is why only one of the two needs qualifying.
The yosys prefix is how the rest of the flow already disambiguates:
synth_preamble.tcl calls yosys read_slang for the same reason.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the extract_memories.tcl script to temporarily disable AUTO_MEMORIES by setting set ::env(AUTO_MEMORIES) 0 before reading design sources, preventing errors when the blackboxes file does not yet exist. Additionally, it replaces the bare proc command with yosys proc to ensure the Yosys command is executed rather than defining a Tcl procedure. There are no review comments, and I have no feedback to provide.
Member
🔍 QoR checkMetrics reflect the PR merge build — i.e. what will land on the target branch. Commit 62 design(s) checked — 0 with regression(s), 1 without a comparable baseline. |
maliberty
approved these changes
Sep 22, 2026
maliberty
merged commit Sep 22, 2026
2d29bda
into
The-OpenROAD-Project:master
10 of 12 checks passed
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.
AUTO_MEMORIES detection cannot run as shipped. Two bugs in
extract_memories.tcl, one commit each, in the order the flow hits them.flow/Makefileorders the two steps correctly. Detection runs first andproduces the inventory, and
gen_memories.pyturns that intoresults/memories/, which includesblackboxes.txt, the list of modulessynthesis is to blackbox:
1. The blackbox guard fires on the step that produces the blackbox
list.
extract_memories.tclreads its sources throughsynth_preamble.tcl'sread_design_sources, and every frontend branchof that proc calls
auto_memories_blackboxes, which errors whenresults/memories/blackboxes.txtis absent. So the pass whose outputthat list is derived from fails because the list does not exist yet.
The first commit clears
AUTO_MEMORIESfor the extraction process only.2.
procreaches Tcl, not yosys.yosys -importcannot shadow a Tclbuilt-in, and
procis the one that defines a procedure, so the bareword defines a procedure instead of running the pass:
memory -nomapon the next line is unaffected, becausememoryis nota Tcl built-in. The second commit qualifies the call as
yosys proc,which is how the flow already disambiguates elsewhere
(
yosys read_slanginsynth_preamble.tcl).Either bug stops the pass on its own, and the second is reached on every
run, so the detection pass cannot have completed as shipped.
🤖 Generated with Claude Code