You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test(rtl): canary for back-to-back contr_rd_en single-deep latch limitation (#40)
Adds `test_back_to_back_contr_rd_drops_second` to
verif/global_mem_controller/test_global_mem_controller.py — the CANARY
demanded by MAST issue #21.
The arbiter in src/global_mem_controller.sv defers a contr_rd_en pulse
that arrives during a busy cycle into a single-deep `contr_rd_pending`
latch. Today's caller (gpu_controller.sv) holds each request pending its
own ack handshake, so depth-1 is sufficient AT THIS MOMENT. When
gpu_controller.sv migrates to AXI4 (Phase 3 of the parameter-taxonomy
plan), or any future caller can issue back-to-back contr_rd_en pulses,
this assumption breaks: a second pulse arriving while pending is set
will silently overwrite the first.
The new test pins this behaviour:
* Pre-loads distinct sentinels at addr_a / addr_b / addr_c
* Holds the AXI4 adapter busy with a core1 read at addr_c
* Pulses contr_rd_en for addr_a then addr_b on consecutive cycles
* Asserts BOTH acks land — the post-fix behaviour
* `@cocotb.test(expect_fail=True)` flips the assertion failure into a
regression PASS today, so the suite stays green while the gap is
documented in-place
The test fires the assertion exactly as predicted (saw 1 ack carrying
word_b=0xBBBBBBBB; word_a=0xAAAAAAAA was lost), proving the depth-1 gap
empirically. After a future fix widens the latch to a FIFO (depth N>=2)
or adds a contr_rd_busy back-pressure output, the test will start
passing functionally — at which point the expect_fail=True marker must
be removed (instructions are in the test docstring).
Out of scope per issue #21: widening the latch, redesigning the arbiter,
ADR work. This PR is canary-only.
Refs: MAST #21, MAST #19 (the merged arbiter), MAST #24/#26 (the SVA
invariant that already guards the inflight/pending mutual exclusion).
TESTS=11 PASS=11 FAIL=0 SKIP=0
Authored by Agent 1 (RTL Architect).
Signed-off-by: Marcos <m@pop.coop>
Co-authored-by: Marcos <m@pop.coop>
0 commit comments