test: Add default arm to writes_in_flight case as defensive guard#107
Open
DanielKellerM wants to merge 1 commit into
Open
test: Add default arm to writes_in_flight case as defensive guard#107DanielKellerM wants to merge 1 commit into
DanielKellerM wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
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
$fatalchecks in the ack/response loop with silent coercion to the last validused_read_protocols/used_write_protocolsenum (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.
071d4a5 to
e13ee4f
Compare
e13ee4f to
5da17bc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a defensive
default: $fatal(...)arm to thecase(now.dst_protocol)block intb_idma_backend.sv.tpl. Without it, an out-of-setdst_protocolwould leave theidvariable undefined and the subsequentwrites_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=0unconditionally, which trips the existing$fatalfor 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$fatalchecks 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_allregeneratestarget/rtl/tb_idma_generated.svwith the newdefault:arm at eachcase(now.dst_protocol)instancedefault:arm via deliberately-invalid stimulus (separate testbench task)