Skip to content

frontend: Drive the inst64 buffer stall events - #230

Merged
DanielKellerM merged 2 commits into
develfrom
fix/inst64-buffer-stall-events
Sep 16, 2026
Merged

DanielKellerM merged 2 commits into
develfrom
fix/inst64-buffer-stall-events

Conversation

@DanielKellerM

Copy link
Copy Markdown
Collaborator

buf_w_stall and buf_r_stall have been undriven since #187, so the Snitch cluster performance counters dma_buf_w_stall (0xe) and dma_buf_r_stall (0xf) read zero in every cluster.

#187 fixed a real bug: r_stall and w_stall were each assigned twice in the same always_comb with opposite polarity, and the second pair won. That second pair was computing the buffer metrics, so removing it restored the documented stall polarity but left the buffer fields with no driver.

The expressions here are the ones snitch_cluster_peripheral_reg.rdl documents for those counters:

dma_buf_w_stall = 14: "Incremented whenever w_ready = 1 but w_valid = 0"
dma_buf_r_stall = 15: "Incremented whenever r_valid = 1 but r_ready = 0"

dma_events_t is a parameter type, so writing a member an integrator's struct does not have is an elaboration error. idma_inst64_tb_pkg.sv gains the two members here; snitch_cluster already declares them.

Verified: idma_lint_sv, idma_lint_inst64 and tb_idma_inst64_axi_copy (Questa, 0 errors) pass.

Relates to snitch_cluster#330, where the ownership of dma_events_t is being discussed.

#187 fixed r_stall and w_stall, which were each assigned twice with opposite
polarity, but it deleted the buffer expressions instead of moving them to the
fields they describe. Nothing has driven buf_w_stall and buf_r_stall since, so
the Snitch cluster performance counters 0xe and 0xf read zero.

The expressions are the ones the cluster documents for those counters:
w_ready high with w_valid low, and r_valid high with r_ready low.

Integrators whose dma_events_t lacks the two members will not elaborate, so
the inst64 testbench package gains them here.
Copilot AI lite review requested due to automatic review settings September 16, 2026 10:02

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.

🟡 Changes recommended

Regression coverage does not verify either new buffer-stall field.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds AXI buffer-stall event generation for inst64 performance counters and updates the testbench event type.

Changes:

  • Drives buf_r_stall and buf_w_stall from AXI handshake conditions.
  • Adds both fields to the testbench dma_events_t.
File summaries
File Summary Review note
test/frontend/idma_inst64_tb_pkg.sv Extends the testbench event structure. Add pin-level checks for both buffer-stall fields.
src/frontend/inst64/idma_inst64_events.sv Drives buffer-stall event signals. Add per-cycle checks with stimulus covering relevant ready/valid combinations.
Review details

Suppressed comments (1)

src/frontend/inst64/idma_inst64_events.sv:75

  • The new buffer-stall outputs are not covered by tb_idma_inst64_axi_copy: its ev_field_e/ev_field_ok table stops at r_stall/w_stall, so either new expression could be removed or inverted and the advertised regression would still pass. Add per-cycle checks for both buf_r_stall and buf_w_stall, with stimulus that reaches their relevant ready/valid combinations.
        events_o.buf_r_stall = !axi_req_i.r_ready && axi_rsp_i.r_valid;
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +106 to +107
logic r_valid, r_ready, r_done, r_bw, r_stall, buf_r_stall;
logic w_valid, w_ready, w_done, w_stall, buf_w_stall;
DanielKellerM added a commit that referenced this pull request Sep 16, 2026
The inst64 frontend drives every member of dma_events_t from
idma_inst64_events, but each integrator declares the struct itself, so a
member iDMA stopped driving or never drove goes unnoticed. Publish the
driven set, including the two buffer stall fields #230 restores.
tb_idma_inst64_axi_copy left buf_r_stall and buf_w_stall out of the
per-field pin comparison, so either assignment could be stuck at zero
and the sim still passed.

The sim memory answers a read and accepts a write every cycle, so the
DMA buffer never fills or drains and neither event ever asserts. The
harness gains an optional antiphase R/W stall between the DUT and the
memory, following the shim in tb_idma_mxrand: the read buffer
alternately backs up (the DUT drops r_ready under r_valid) and runs dry
(the memory holds w_ready with no w_valid). A go bit only falls after
its channel handshake, so no valid is withdrawn.

Both events now assert, are compared against the pins every cycle, and
a stuck-at-zero count fails the test.
@DanielKellerM
DanielKellerM merged commit 2dcecca into devel Sep 16, 2026
37 of 38 checks passed
@DanielKellerM
DanielKellerM deleted the fix/inst64-buffer-stall-events branch September 16, 2026 15:18
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