Skip to content

test: Drive OBI backend ports with native obi_sim_mem#139

Closed
DanielKellerM wants to merge 1 commit into
pulp-platform:develfrom
DanielKellerM:test/obi-native-mem
Closed

test: Drive OBI backend ports with native obi_sim_mem#139
DanielKellerM wants to merge 1 commit into
pulp-platform:develfrom
DanielKellerM:test/obi-native-mem

Conversation

@DanielKellerM

Copy link
Copy Markdown
Collaborator

Problem

The vsim-sim-random OBI tests (rw_obi, r_obi_w_axi, r_axi_w_obi, snitch_*) hang on rw-decoupled transfers ≳512 B. Root cause is in the testbench, not the iDMA RTL: the OBI path converts each backend OBI port to AXI via idma_obi2axi_bridge (the vendored per2axi peripheral converter), joins read+write with axi_rw_join, and shares one axi_sim_mem. Under rw-decoupled burst traffic the per2axi bridge stops accepting memory responses (b_ready=0/r_ready=0 while the memory holds b_valid/r_valid), so the transfer never completes and the OBI watchdog trips (e.g. rw_obi seed 1 at ~217710 ns). The backend's native OBI write is independently proven deadlock-free against a responsive memory.

Fix

Drive the backend's OBI ports with a native obi_sim_mem instead:

  • Attach obi_sim_mem directly to the OBI read/write ports (separate read/write memories; scoreboard seeds the read mem and checks the write mem).
  • Drop the idma_obi2axi_bridge pair, axi_rw_join, and the AXI throttle/multicut for OBI (kept for AXI).
  • Repoint the OBI signal highlighters and watchdog to the native OBI handshakes.

The AXI memory path is unchanged.

Validation (Questa)

  • rw_obi seed 1 (the case that hung at 217710 ns): completes, Errors: 0, data matches.
  • rw_obi / r_obi_w_axi / r_axi_w_obi canonical job suites: all green.
  • rw_axi (pure AXI) suites: green — AXI path unbroken.
  • INIT+OBI snitch variants: green.

A standalone proof testbench (test/idma_tb_native_obi.sv) drives the backend with obi_sim_mem and replays the hanging geometry to confirm it completes.

Copilot AI review requested due to automatic review settings June 22, 2026 13:59

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 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

fix

Comment thread test/tpl/tb_idma_backend.sv.tpl Outdated
Comment on lines +1104 to +1107
// obi_sim_mem commits writes synchronously on the granted request,
// so memory is up to date once the iDMA rsp_valid fires (already
// awaited by ack_tf). No outstanding-write tracking needed; the
// backend does not necessarily drain every write response.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

verbose comments, should be single line max

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Addressed in d3d3659 — condensed to a single line.

Comment thread test/tpl/tb_idma_backend.sv.tpl Outdated
Comment on lines +1199 to +1200
// OBI dst writes commit synchronously in obi_sim_mem (no response
// tracking); other protocols wait for their outstanding writes

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

verbose comments, should be single line max

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Addressed in d3d3659 — condensed to a single line.

Comment thread test/tpl/tb_idma_backend.sv.tpl Outdated
Comment on lines +413 to +415
// Native OBI: separate read/write obi_sim_mem (per-port response queue,
// no head-of-line coupling). Scoreboard seeds src in the read mem
// (i_obi_read_sim_mem) and checks dst in the write mem (i_obi_axi_sim_mem).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

verbose comments, should be single line max

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Addressed in d3d3659 — condensed to a single line.

Comment thread test/tpl/tb_idma_backend.sv.tpl Outdated
Comment on lines +103 to +104
// OBI native sim-memory config. UseRReady=1 so the mem honors the backend's
// rready (else auto-popped responses can be missed -> lost write tracking).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

verbose comments, should be single line max

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Addressed in d3d3659 — condensed to a single line.

Comment thread test/include/tb_tasks.svh Outdated
Comment on lines +345 to +347
// obi_sim_mem gates reads on the word-base address; seed partial-word
// pad bytes (0xff: defined, compare-omitted, model-agnostic) so reads
// of unaligned src words return the real in-range bytes instead of x

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

verbose comments, should be single line max

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Addressed in d3d3659 — condensed to a single line.

The OBI test path converted each backend OBI port to AXI via idma_obi2axi_bridge
(per2axi), joined read+write with axi_rw_join, and shared one axi_sim_mem. The
per2axi bridge wedges on rw-decoupled OBI transfers >512 B (stops accepting
memory responses), hanging the vsim-sim-random OBI tests. The iDMA RTL is
correct; the wedge is in the testbench bridge.

Attach obi_sim_mem directly to the backend OBI ports (separate read/write mems,
scoreboard seeds the read mem and checks the write mem), drop the per2axi
bridges / axi_rw_join / AXI throttle+multicut for OBI, and repoint the OBI
highlighters and watchdog to the native OBI handshakes. AXI path unchanged.
@DanielKellerM

Copy link
Copy Markdown
Collaborator Author

Superseded by #140 — same fix from an upstream branch so the GitLab sims actually run in CI (fork PRs skip them).

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