rtl: PopRoCCRouter v1 — funct7 decode + dispatch + per-source ordering #107

Merged
navigator merged 1 commit from auto/issue-104-20260526T163428Z_issue104 into main 2026-05-26 13:50:46 -03:00
Owner

Summary

Lifts rtl/src/pop/PopRoCCRouter.scala from the elaborate-only skeleton (PR #69) into the v1 behaviour pinned by the Draft SPEC (#96):

  • funct7 top-2-bit gemmini-id decode (ADR-006 Consequences).
  • Per-tile dispatch on Vec(numTiles, Decoupled(_)) (default 4 for Edu per ADR-001).
  • In-flight tracking table keyed by (originating-core-id, rd, xd) per tile.
  • Per-source response ordering via a per-core dispatch-order FIFO that pops strictly in cmd-issue order; cross-source ordering deliberately not preserved (ADR-006 independent commit machines).
  • xd=0 retires silently; xd=1 pairs with resp.valid.

Open questions kept as parameter defaults / comments per the issue:

  • inFlightDepth: Int = 8 with // Open question per SPEC §Behavior next to it.
  • Cross-source arbitration: round-robin (default choice, not a pinned ADR decision; annotated).
  • Exception path: TBD per SPEC §Interface — exception path, no port surfaced.

No edits outside rtl/src/pop/PopRoCCRouter.scala and rtl/tests/PopRoCCRouter/.

Test plan

  • sbt -no-colors compile green from rtl/.
  • sbt -no-colors test green from rtl/ — 8/8 suites pass, including three new scenarios in PopRoCCRouterSpec:
    • cmd.valid with xd=1resp.valid arrives with matching rd within inFlightDepth + 2 cycles.
    • cmd.valid with xd=0 → no resp.valid on the same-core port across a generous window.
    • Two parallel cmd streams: tile 1 dispatch fires while tile 0 stays back-pressured (no-deadlock).

Closes #104

## Summary Lifts `rtl/src/pop/PopRoCCRouter.scala` from the elaborate-only skeleton (PR #69) into the v1 behaviour pinned by the Draft SPEC (#96): - `funct7` top-2-bit gemmini-id decode (ADR-006 Consequences). - Per-tile dispatch on `Vec(numTiles, Decoupled(_))` (default 4 for Edu per ADR-001). - In-flight tracking table keyed by `(originating-core-id, rd, xd)` per tile. - Per-source response ordering via a per-core dispatch-order FIFO that pops strictly in `cmd`-issue order; cross-source ordering deliberately not preserved (ADR-006 independent commit machines). - `xd=0` retires silently; `xd=1` pairs with `resp.valid`. Open questions kept as parameter defaults / comments per the issue: - `inFlightDepth: Int = 8` with `// Open question per SPEC §Behavior` next to it. - Cross-source arbitration: round-robin (default choice, not a pinned ADR decision; annotated). - Exception path: `TBD per SPEC §Interface — exception path`, no port surfaced. No edits outside `rtl/src/pop/PopRoCCRouter.scala` and `rtl/tests/PopRoCCRouter/`. ## Test plan - [x] `sbt -no-colors compile` green from `rtl/`. - [x] `sbt -no-colors test` green from `rtl/` — 8/8 suites pass, including three new scenarios in `PopRoCCRouterSpec`: - `cmd.valid` with `xd=1` → `resp.valid` arrives with matching `rd` within `inFlightDepth + 2` cycles. - `cmd.valid` with `xd=0` → no `resp.valid` on the same-core port across a generous window. - Two parallel `cmd` streams: tile 1 dispatch fires while tile 0 stays back-pressured (no-deadlock). Closes #104
rtl: PopRoCCRouter v1 — funct7 decode + dispatch + per-source ordering
All checks were successful
build / scalafmt-check (pull_request) Successful in 4s
build / sbt-compile (pull_request) Successful in 3s
build / shell-lint (pull_request) Successful in 1m12s
03986776dd
Lifts the elaborate-only skeleton at rtl/src/pop/PopRoCCRouter.scala
into the v1 behaviour pinned by the Draft SPEC: funct7 top-2-bit
gemmini-id decode (ADR-006), per-tile dispatch on a parameterised
Vec(N) attach (default N=4 for Edu per ADR-001), and an in-flight
tracking table keyed by (originating-core-id, rd, xd) keyed per tile
so per-tile completions restore the writeback register on resp.

Per-source ordering is preserved on resp via a per-core dispatch-order
FIFO that pops strictly in cmd-issue order; cross-source ordering is
deliberately not preserved (ADR-006: independent commit machines).
xd=0 retires silently in the table; xd=1 pairs with resp.valid.

Open questions kept as parameter defaults / comments per the issue:
in-flight depth (inFlightDepth=8), cross-source arbitration (RR), and
exception-path port (TBD pending the trap-cause ADR called out in
docs/spec/fluidpop-isa.md §9).

Three chiseltest scenarios extend PopRoCCRouterSpec to close §12.3
verification floor: xd=1 round-trip within inFlightDepth+2 cycles,
xd=0 fire-and-forget with no resp.valid, and forward progress on a
second tile when one tile is back-pressured (no-deadlock contract).
Author
Owner

VERDICT: PASS

PR #107 lifts PopRoCCRouter from the elaborate-only skeleton (PR #69) into a v1 implementation pinned by the Draft SPEC (PR #96), scoped cleanly to Issue #104. Mechanical guardrails pass: SPDX headers preserved (CHARRUA-1.2 source, AGPL-3.0-or-later test), both files in package pop, no AI/Anthropic attribution, no off-limits paths, scope bounded to two files. Rule 4 is handled correctly: RoCCCommand/RoCCResponse (canonical local mirrors from PR #69) materialised in Vec(numCores, Flipped(Decoupled(...))) / Vec(numCores, Decoupled(...)), per-tile fan-out materialised as paired tileCmd/tileResp Vecs of numTiles, and the exception path stays unimplemented because its cause-encoding is genuinely Open per SPEC §Interface and docs/spec/fluidpop-isa.md §9 — the inline comment forward-links exactly the right ADR-pending sources rather than inventing an mcause value. Rule 7 is meticulously handled across the behaviour commit: numCores=2 and numTiles=4 defaults pin to ADR-006/ADR-001 Edu; xLen=64 matches RV64GC; numTiles <= 4 is a hard require constraint with the explicit message that Pro 16-tile gating awaits the future funct7-encoding ADR (matching the §Interface Open question); inFlightDepth=8 is annotated inline as // Open question per SPEC §Behavior; the cross-source arbitration policy uses RRArbiter with an explicit "Default choice ... Open question per SPEC §Behavior — not pinned by any ADR" annotation; funct7 decode extracts inst.funct(6, 5) (top 2 bits), consistent with PR #77's fluidpop-isa.md §2 "top 2 bits reserved for gemmini-id" and SPEC §Behavior. The implementation faithfully realises SPEC §Behavior: funct7 decode and tile-id extraction, dispatch to selected per-tile attach via per-tile-ready handshake, in-flight tracking table keyed by (origCore, rd, xd) per tile, per-source response ordering via per-core dispatch-order FIFO popping in cmd-issue order, cross-source unordered per ADR-006 independent commit machines, xd=0 silent retire / xd=1 paired with resp.valid. Test coverage maps cleanly to SPEC §Invariants: the xd=1 round-trip test verifies the single-response and per-source-ordering invariants within inFlightDepth + 2 cycles; the xd=0 fire-and-forget test verifies no spurious resp.valid; the back-pressure test exercises the no-deadlock invariant by showing tile 1 makes forward progress while tile 0 is back-pressured. The funct7 lower-5-bits and rd flow-through is checked inline (rd field "did not flow through unchanged onto tile 1"). The 8-test suite passes per the PR body. No invented MSI-X counts, no fabricated latency / area claims, no vendor commitments. Comment cleanup is contained to the SPEC-aligned scope; the omitted-status rationale was moved out but the cmd/resp bundles still carry the canonical-rocket-chip forward-link header at the file level.

Findings

None.

<!-- agent:review verdict=PASS ts=1779814156 --> **VERDICT:** PASS PR #107 lifts `PopRoCCRouter` from the elaborate-only skeleton (PR #69) into a v1 implementation pinned by the Draft SPEC (PR #96), scoped cleanly to Issue #104. Mechanical guardrails pass: SPDX headers preserved (`CHARRUA-1.2` source, `AGPL-3.0-or-later` test), both files in `package pop`, no AI/Anthropic attribution, no off-limits paths, scope bounded to two files. Rule 4 is handled correctly: `RoCCCommand`/`RoCCResponse` (canonical local mirrors from PR #69) materialised in `Vec(numCores, Flipped(Decoupled(...)))` / `Vec(numCores, Decoupled(...))`, per-tile fan-out materialised as paired `tileCmd`/`tileResp` Vecs of `numTiles`, and the exception path stays unimplemented because its cause-encoding is genuinely Open per SPEC §Interface and `docs/spec/fluidpop-isa.md §9` — the inline comment forward-links exactly the right ADR-pending sources rather than inventing an `mcause` value. Rule 7 is meticulously handled across the behaviour commit: `numCores=2` and `numTiles=4` defaults pin to ADR-006/ADR-001 Edu; `xLen=64` matches RV64GC; `numTiles <= 4` is a hard `require` constraint with the explicit message that Pro 16-tile gating awaits the future funct7-encoding ADR (matching the §Interface Open question); `inFlightDepth=8` is annotated inline as `// Open question per SPEC §Behavior`; the cross-source arbitration policy uses `RRArbiter` with an explicit "Default choice ... Open question per SPEC §Behavior — not pinned by any ADR" annotation; `funct7` decode extracts `inst.funct(6, 5)` (top 2 bits), consistent with PR #77's `fluidpop-isa.md §2` "top 2 bits reserved for gemmini-id" and SPEC §Behavior. The implementation faithfully realises SPEC §Behavior: funct7 decode and tile-id extraction, dispatch to selected per-tile attach via per-tile-ready handshake, in-flight tracking table keyed by `(origCore, rd, xd)` per tile, per-source response ordering via per-core dispatch-order FIFO popping in `cmd`-issue order, cross-source unordered per ADR-006 independent commit machines, `xd=0` silent retire / `xd=1` paired with `resp.valid`. Test coverage maps cleanly to SPEC §Invariants: the `xd=1` round-trip test verifies the single-response and per-source-ordering invariants within `inFlightDepth + 2` cycles; the `xd=0` fire-and-forget test verifies no spurious `resp.valid`; the back-pressure test exercises the no-deadlock invariant by showing tile 1 makes forward progress while tile 0 is back-pressured. The funct7 lower-5-bits and `rd` flow-through is checked inline (`rd` field "did not flow through unchanged onto tile 1"). The 8-test suite passes per the PR body. No invented MSI-X counts, no fabricated latency / area claims, no vendor commitments. Comment cleanup is contained to the SPEC-aligned scope; the omitted-`status` rationale was moved out but the cmd/resp bundles still carry the canonical-rocket-chip forward-link header at the file level. ## Findings _None._
fluidpop-bot approved these changes 2026-05-26 13:50:00 -03:00
Dismissed
fluidpop-bot left a comment
Collaborator

CI green (head 03986776dd), auto-approving

CI green (head 03986776dd5dd4f2bb821d332876b01d31ae8599), auto-approving
navigator force-pushed auto/issue-104-20260526T163428Z_issue104 from 03986776dd
All checks were successful
build / scalafmt-check (pull_request) Successful in 4s
build / sbt-compile (pull_request) Successful in 3s
build / shell-lint (pull_request) Successful in 1m12s
to 777f895723
All checks were successful
build / scalafmt-check (pull_request) Successful in 4s
build / sbt-compile (pull_request) Successful in 3s
build / shell-lint (pull_request) Successful in 11s
2026-05-26 13:50:02 -03:00
Compare
fluidpop-bot left a comment
Collaborator

CI green (head 777f895723), auto-approving

CI green (head 777f8957230baaa115fb929ce6451d77d59055c9), auto-approving
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Fluid/fluidpop-v1!107
No description provided.