Skip to content

AUTO_MEMORIES_REGFILES: register files as macros of placed standard cells - #1207

Merged
oharboe merged 1 commit into
mainfrom
auto-memories-regfiles
Oct 9, 2026
Merged

oharboe merged 1 commit into
mainfrom
auto-memories-regfiles

Conversation

@oharboe

@oharboe oharboe commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

What a user sees

  • New: AUTO_MEMORIES_REGFILES lists register-file spec files, one per RTL module. During canonicalization OpenROAD's generate_regfile builds each file from placed standard cells: a netlist, an abstract LEF and a timing model, which sit beside the FakeRAM views. In mode netlist the file is a macro through synthesis and macro placement, and then dissolves into its cells: the core stays FIRM where the macro was placed, and the address decode is left to placement.
  • New: AUTO_MEMORIES_MACRO_PLACE lists the register files that are placed as macros. Any other listed file is inlined: synthesis reads its generated netlist in place of the module.
  • New OpenROAD command: generate_regfile, in the ram module.
  • Works with a keep threshold: each register file's line in blackboxes.txt carries the area its .lib states, so SYNTH_MINIMUM_KEEP_SIZE can cost it (the format AUTO_MEMORIES: a macro's blackbox costs its view's area #1205 introduced).
  • Breaking: STRUCTURED_MEMORIES and STRUCTURED_PLACEMENT, which were bazel-orfs's own carried ORFS patches 0071/0078/0082/0084, are retired. A flow that still sets either one fails, and the error names the replacement. In arguments/sources it fails at load time; in user_arguments, or on a stage rule directly, it fails at analysis. ORFS ignores variables it does not know, so a silent removal would have built without the register files the flow asked for.

Carried patches

patch upstream content
OpenROAD 0010 The-OpenROAD-Project/OpenROAD#11669 the PR's net diff at its head (691d8e15), all eight commits in one patch
ORFS 0089 The-OpenROAD-Project/OpenROAD-flow-scripts#4651, commit 1 AUTO_MEMORIES_REGFILES
ORFS 0091 #4651, commit 2 AUTO_MEMORIES_MACRO_PLACE
ORFS 0099 #4651, commit 3 inline a register file in place of a parameterized module

The ORFS patches are #4651's commits as rebuilt on #4650, with the example designs left out (flow/designs/asap7/regfile, flow/designs/asap7/riscv32i-regfile and flow/designs/src/regfile). Here the flow is tested on a fixture of our own, test/regfile, which is the 16×8 2R2W example as a bazel-orfs orfs_flow. They apply after 0090, #4650, which #1205 merged. With 0071 retired, 0090 loses the hunks it carried for 0071 only (the DEF-die area of STRUCTURED_MEMORIES files); the rest of it is unchanged. Each patch retires at a bump onto an upstream that carries it.

OpenROAD's own src/ram/test targets: bazel-orfs does not build or test them: CI runs bazelisk test ..., this repository's own targets. Run here anyway, the seven generate_regfile_*_asap7 tests fail to build, because a patch applied by archive_override cannot create the src/ram/test/asap7 symlink that #11669 adds, so their LEF and Liberty inputs are missing. The openroad binary is unaffected, and the four older make_* ram tests pass. The generate_regfile tests run in OpenROAD's own CI on #11669.

Migrated

test/structured_netlist, test/planned_parent, the XiangShan flows and tools/structured_gen/test move to the new variables. tools/macro_select/plan_floorplan.py now places the plan's register files by instance in place_macros.tcl, so it no longer writes netlists.txt. The FIRM stand-aside dance around rtl_macro_placer is gone.

Tests

bazelisk test over //test/regfile/..., //tools/structured_gen/..., //tools/macro_select/..., //test/planned_parent/..., //test/structured_netlist/..., //test/auto_memories/..., the XiangShan package and //test:all, plus @openroad//src/ram/test/...: 172 pass. The 7 failures are the OpenROAD generate_regfile tests described above.

  • //test/regfile: the dissolve, every register clocked (macro and inlined), global route on both, simulation of both write styles against riscv32i/regfile.v, and synthesis with SYNTH_MINIMUM_KEEP_SIZE=1, including a RegFile <area> line in blackboxes.txt.
  • //test:retired_structured_*_refused_test: the two refusals.
  • //:fix_lint, //:public_surface and //:host_tools pass.
  • The manual //test/planned_parent:mini_top_grt stops on DRT-0073 (no access point for u_block*/din[0]). It stops the same way on main at 7519e7c, so this PR doesn't cause it.

This is split out of #1187, which stays the integration and scaffolding branch: the register-file campaign, the ladder designs and the study variants.

🤖 Generated with Claude Code

…ells

AUTO_MEMORIES_REGFILES lists register-file specs; OpenROAD's
generate_regfile builds each as placed standard cells during
canonicalization. In mode netlist a file is a macro through synthesis
and macro placement and then dissolves into its cells.
AUTO_MEMORIES_MACRO_PLACE names the files placed as macros; the others
are inlined in synthesis.

Carried:
- OpenROAD 0010: The-OpenROAD-Project/OpenROAD#11669, its net diff at
  its head, as one patch.
- ORFS 0089, 0091, 0099: the three commits of
  The-OpenROAD-Project/OpenROAD-flow-scripts#4651 as rebuilt on #4650
  (blackboxes.txt lines carry each register file's area), without its
  example designs (asap7/regfile, asap7/riscv32i-regfile, src/regfile).
  They apply after 0090 (#4650, #1205).

0090 loses the hunks it carried for the retired 0071 (its register
files' DEF die area); the rest of it is unchanged.

STRUCTURED_MEMORIES and STRUCTURED_PLACEMENT (ORFS patches 0071, 0078,
0082, 0084) are retired. A flow that still sets either one fails and
the error names the replacement: at load time in arguments or sources,
and at analysis in user_arguments or on a stage rule.

test/structured_netlist, test/planned_parent, the XiangShan flows,
tools/structured_gen/test and tools/macro_select move to the new
variables. test/regfile is the flow's own fixture: the dissolve, every
register clocked (macro and inlined), global route, simulation
against the RTL, and synthesis with SYNTH_MINIMUM_KEEP_SIZE=1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@oharboe
oharboe merged commit 1644583 into main Oct 9, 2026
1 check passed
@oharboe
oharboe deleted the auto-memories-regfiles branch October 9, 2026 11:46
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