Skip to content

frontend: Make the reg-frontend config-bus CPUIF selectable#148

Merged
DanielKellerM merged 1 commit into
develfrom
frontend/reg-cpuif-select
Jul 8, 2026
Merged

frontend: Make the reg-frontend config-bus CPUIF selectable#148
DanielKellerM merged 1 commit into
develfrom
frontend/reg-cpuif-select

Conversation

@DanielKellerM

@DanielKellerM DanielKellerM commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

What

The register frontend (idma_reg32_* / idma_reg64_*) config bus becomes a selectable PeakRDL CPUIF via IDMA_REG_CPUIF (default apb4-flat) instead of a hardcoded protocol. Supported today: apb4-flat (default), obi-flat, axi4-lite-flat.

Supersedes #131 (which made the reg frontend APB-only): the default apb4-flat reproduces #131 exactly, while OBI / AXI-Lite come for free.

Why

Since the SystemRDL/PeakRDL migration (#73) the generated idma_*_reg_top is a peakrdl-regblock block, so the CPU interface is a generation-time choice. Hardcoding APB would force an OBI/reg_bus bridge in Snitch/Cheshire-style SoCs — the opposite of what removing the reg_to_apb shim is meant to save. OBI is a native CPUIF in peakrdl>=1.5.0, so this needs no new dependency.

How

  • IDMA_REG_CPUIF ?= apb4-flat (idma.mk) threads into both peakrdl regblock --cpuif and the wrapper generation (gen_idma.py / frontend.py).
  • idma_reg.sv.tpl gains a per-CPUIF branch that packs the reg_top flat CPUIF signals into the matching req/rsp struct (apb_req_t / obi_req_t / axi_lite_req_t).
  • The reg_to_apb shim is removed and register_interface dropped (it was its sole consumer); the launch-stall rides the protocol-agnostic rd_ack & arb_ready gate.
  • desc64 keeps its static hand-written APB wrappers and is pinned to apb4-flat.

Verification

All three CPUIFs regenerate cleanly and elaborate (Verilator, real apb_req_t / obi_req_t / axi_lite_req_t plus an ND dma_req_t) with zero width/pin errors on the CPUIF connections. The OBI branch overrides the reg_top ID_WIDTH so s_obi_aid / s_obi_rid are not truncated for OBI IdWidth>1.

Breaking (0.7.0)

Downstream reg_bus integrators must now wire APB (or select obi-flat / axi4-lite-flat) — the same port-type break as #131. There are no in-repo instantiation sites (the reg frontend is a library module).

PeakRDL regblock --cpuif becomes the IDMA_REG_CPUIF make variable
(default apb4-flat). The wrapper packs the reg_top's flat CPUIF signals
into the matching req/rsp struct: apb, obi, and axi4-lite. The reg_to_apb
shim is dropped and register_interface with it (its sole consumer); the
launch-stall moves to the protocol-agnostic rd_ack gate. desc64 stays
apb-native (static wrappers).
Copilot AI review requested due to automatic review settings July 6, 2026 08:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@DanielKellerM DanielKellerM merged commit d1737bb into devel Jul 8, 2026
35 of 37 checks passed
@DanielKellerM DanielKellerM deleted the frontend/reg-cpuif-select branch July 8, 2026 08:47
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.

2 participants