Skip to content

asap7/tinyRocket: behavioral models of the memories the generator leaves out - #4643

Merged
maliberty merged 3 commits into
The-OpenROAD-Project:masterfrom
oharboe:asap7-tinyrocket-memories
Oct 10, 2026
Merged

maliberty merged 3 commits into
The-OpenROAD-Project:masterfrom
oharboe:asap7-tinyrocket-memories

Conversation

@oharboe

@oharboe oharboe commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

asap7/tinyRocket does not build today, it is not in CI, but very useful, fast and unique for local testing.

Why it breaks

The Rocket Chip generator leaves the cache memories as black boxes: data_arrays_0_ext, data_arrays_0_0_ext and tag_array_ext. The generic sources define none of them.

  • nangate45 maps them onto hand-made fakeram macros.

  • asap7 relies on AUTO_MEMORIES, which only detects a memory yosys infers. Only tag_array, which its .memories override forces, got a macro, and canonicalization stops:

    ERROR: Module `\data_arrays_0_ext' referenced in module `\data_arrays_0' in cell `\data_arrays_0_ext' is not part of the design.
    

    With the slang frontend, memory extraction stops earlier on the same unknown modules.

asap7/tinyRocket is not in CI (nangate45's tinyRocket is), so nothing caught it.

The fix

  • memories.v defines behavioural models of the three memories, in firtool's read-write port convention with the read address registered. yosys infers each one as a clocked-read memory, and AUTO_MEMORIES decides what it becomes:

    memory shape becomes
    data_arrays_0_ext 64 x 32, 4 byte lanes FakeRAM macro
    data_arrays_0_0_ext 64 x 32 FakeRAM macro
    tag_array_ext 4 x 25 flip-flops (below the macro floors)
    Rocket._T_288, the integer register file 31 x 32, 2 combinational reads, 1 write flip-flops (an inline array), unchanged
  • tag_array.memories is deleted. With a behavioural model, the gate's own choice stands.

    • The AutoMemories.md override example no longer names it.
    • schema_test.py's tag_array case, whose fixture it was, goes too. test_merge_new_entry_taken_whole still covers an override taken whole.
  • A README.md says what makes the design unique:

    • its memories are found by AUTO_MEMORIES, not mapped by hand;
    • it has SRAMs and a register file, both identified by yosys in one inventory;
    • it goes from synthesis to global route in minutes.

Tested

Synthesis through global route with the default (yosys) frontend:

  • 2 macros placed;
  • the inventory as listed above;
  • synthesis about 30 s, floorplan to global route a few minutes.

It also builds with the slang frontend. schema_test.py passes.

Suggestion: adding asap7/tinyRocket to CI would keep AUTO_MEMORIES covered end to end.

🤖 Generated with Claude Code

…ves out

asap7/tinyRocket did not build. The Rocket Chip generator leaves its
cache memories as black boxes (data_arrays_0_ext, data_arrays_0_0_ext,
tag_array_ext) and the generic tinyRocket sources define none of them.
nangate45 maps them onto hand-made fakeram macros; asap7 relies on
AUTO_MEMORIES, which only detects a memory yosys infers, so only
tag_array, forced by its .memories override, got a macro, and
canonicalization stopped: "Module data_arrays_0_ext referenced in module
data_arrays_0 is not part of the design". With the slang frontend the
memory extraction stops earlier on the same unknown modules.

memories.v defines the three in firtool's read-write port convention,
the read address registered as firtool writes it, so yosys infers each
as a clocked-read memory and AUTO_MEMORIES decides: the two data arrays
become FakeRAM macros, the 4 x 25 tag array flip-flops by the gate's own
choice, and tag_array.memories goes. The docs' override example no
longer names it, and schema_test's tag_array case, whose fixture it was,
goes too; test_merge_new_entry_taken_whole still covers an override
taken whole.

README.md says what makes the design unique: its memories found rather
than hand-mapped, SRAMs and a register file identified by yosys in one
inventory, and minutes from synthesis to global route.

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 replaces the manual .memories override for tag_array in the tinyRocket design on asap7 with behavioral models in a new memories.v file, allowing AUTO_MEMORIES to detect and handle the memories automatically. It also adds a README explaining this setup, updates the design configuration, and removes the obsolete override file and its associated schema tests. Feedback on the changes suggests declaring the loop variable integer i locally within a named always block in memories.v to avoid potential simulation race conditions or synthesis warnings.

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 7, 2026 •

Copy link
Copy Markdown
Member

🔍 QoR check

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

Commit c7875f5 · Jenkins build #4 · Baseline: build · View build on dashboard

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

oharboe added a commit to The-OpenROAD-Project/bazel-orfs that referenced this pull request Oct 9, 2026
asap7/tinyRocket, ORFS's AUTO_MEMORIES design, had not canonicalized:
the Rocket Chip generator leaves its cache memories as black boxes
(data_arrays_0_ext, data_arrays_0_0_ext, tag_array_ext), the generic
sources define none, and AUTO_MEMORIES only detects a memory yosys
infers. Only tag_array, forced by an override, got a macro;
data_arrays_0_ext was "not part of the design". Under slang the
memory extraction stopped earlier on the same unknown modules. Nothing
built the design, in ORFS CI (nangate45's tinyRocket maps the memories
by hand) or here (auto_memories_outputs_test only analyses it).

ORFS patch 0092 adds behavioral models of the three in firtool's
read-write convention: the two data arrays become FakeRAM macros, the
4 x 25 tag array flip-flops by the gate's own choice, and its override
goes. It also carries the design's README. tinyrocket_synth_build_test
builds the synthesis, detection and macro generation included.

0092 is The-OpenROAD-Project/OpenROAD-flow-scripts#4643 at its head,
review changes included; it retires at a bump onto an ORFS that has it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
@maliberty
maliberty enabled auto-merge October 10, 2026 05:00
@maliberty
maliberty merged commit 5a76f84 into The-OpenROAD-Project:master Oct 10, 2026
12 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