Repository navigation
asap7/tinyRocket: behavioral models of the memories the generator leaves out - #4643
Conversation
…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>
There was a problem hiding this comment.
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>
🔍 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), 0 without a comparable baseline. |
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>
asap7/tinyRocketdoes 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_extandtag_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. Onlytag_array, which its.memoriesoverride forces, got a macro, and canonicalization stops: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.vdefines 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, andAUTO_MEMORIESdecides what it becomes:data_arrays_0_extdata_arrays_0_0_exttag_array_extRocket._T_288, the integer register filetag_array.memoriesis deleted. With a behavioural model, the gate's own choice stands.AutoMemories.mdoverride example no longer names it.schema_test.py's tag_array case, whose fixture it was, goes too.test_merge_new_entry_taken_wholestill covers an override taken whole.A
README.mdsays what makes the design unique:AUTO_MEMORIES, not mapped by hand;Tested
Synthesis through global route with the default (yosys) frontend:
It also builds with the slang frontend.
schema_test.pypasses.Suggestion: adding
asap7/tinyRocketto CI would keepAUTO_MEMORIEScovered end to end.🤖 Generated with Claude Code