Skip to content

test: Add default arm to writes_in_flight case as defensive guard#107

Open
DanielKellerM wants to merge 1 commit into
develfrom
fix/tb-generated-protocol-coerce
Open

test: Add default arm to writes_in_flight case as defensive guard#107
DanielKellerM wants to merge 1 commit into
develfrom
fix/tb-generated-protocol-coerce

Conversation

@DanielKellerM
Copy link
Copy Markdown
Collaborator

@DanielKellerM DanielKellerM commented May 21, 2026

Summary

Adds a defensive default: $fatal(...) arm to the case(now.dst_protocol) block in tb_idma_backend.sv.tpl. Without it, an out-of-set dst_protocol would leave the id variable undefined and the subsequent writes_in_flight[now.dst_protocol][id] lookup would index with X bits.

Context

The underlying bug that surfaced the need for this guard — random job-file generator (in nonfree) emitting src_protocol=0/dst_protocol=0 unconditionally, which trips the existing $fatal for variants where AXI isn't a valid source/destination — is fixed at the source in a companion nonfree commit (gen_random_jobs: Emit per-variant protocol IDs, not hardcoded 0). After that, the existing $fatal checks at the request and ack loops are the canonical correctness gate. This PR adds the case-default arm as belt-and-suspenders for any future codepath that bypasses those checks.

Test plan

  • make idma_hw_all regenerates target/rtl/tb_idma_generated.sv with the new default: arm at each case(now.dst_protocol) instance
  • Internal CI run: existing variants continue to pass; coverage of the new default: arm via deliberately-invalid stimulus (separate testbench task)

Copilot AI review requested due to automatic review settings May 21, 2026 11:36
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the tb_idma_backend testbench template so the response/ack loop handles out-of-set src_protocol / dst_protocol values the same way as the existing request-dispatch and watchdog paths, preventing unnecessary $fatal terminations in variants where the default protocol enum value is not part of the supported protocol set.

Changes:

  • Replaced $fatal checks in the ack/response loop with silent coercion to the last valid used_read_protocols / used_write_protocols enum (matching the request and watchdog loops).
  • Ensures randomized job runs don’t fail solely due to default-initialized protocol enums not being legal for a given variant.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@DanielKellerM DanielKellerM force-pushed the fix/tb-generated-protocol-coerce branch from 071d4a5 to e13ee4f Compare May 21, 2026 12:51
@DanielKellerM DanielKellerM force-pushed the fix/tb-generated-protocol-coerce branch from e13ee4f to 5da17bc Compare May 21, 2026 12:59
@DanielKellerM DanielKellerM changed the title test: Coerce out-of-set protocol IDs in tb_idma_backend rsp loop test: Add default arm to writes_in_flight case as defensive guard May 21, 2026
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