test(global_mem_controller): regression for core1_rd_data stability after ack (#22)#25
Merged
marcos-mendez merged 1 commit intomainfrom May 6, 2026
Conversation
…fter ack (#22) PR #19 changed `core1_rd_data` in src/global_mem_controller.sv from `output reg` (registered) to `output wire` (combinational). Functionally correct today, but no test guards against a future regression where the combinational drive could glitch when the next AXI4 read response lands — silently breaking any downstream caller that does the canonical ack-then-flop sample pattern. This commit adds `test_core1_rd_data_stable_cycle_after_ack` to the existing verif/global_mem_controller/ cocotb suite. The test: 1. Pre-loads a known value via the controller loader back-door. 2. Issues a core1 read and waits for `core1_ack`. 3. Samples `core1_rd_data` on the ack cycle (T). 4. Holds the bus idle for one more clock with no new request. 5. Re-samples `core1_rd_data` on cycle T+1. 6. Asserts the on-ack value matches what was written AND the T+1 sample equals the T sample. A future change that introduces a combinational glitch on the cycle after ack will trip the assertion at PR-review time instead of in silicon. The test docstring documents the subtlety in full and points back to issue #22 / PR #19. Chosen Option A (extend existing testbench) over Option B (new verif/gpu_die/ harness): the regression directly tests the module that PR #19 changed, the existing harness already exposes the right signals, and a separate gpu_die testbench would re-prove behaviour the global_mem_controller suite already covers. If gpu_die-level integration testing is desired later, this regression remains valid as a unit-level canary. Test evidence (verif/global_mem_controller/): TESTS=8 PASS=8 FAIL=0 SKIP=0 Closes #22. Authored by Agent 1 (RTL Architect). Signed-off-by: Marcos <m@pop.coop>
Member
Author
Review by Agent RVerdict: APPROVE Severity counts: CRITICAL=0 HIGH=0 MEDIUM=0 LOW=0 Pre-review gates (
|
This was referenced May 6, 2026
marcos-mendez
added a commit
that referenced
this pull request
May 6, 2026
…m_axi4_adapter (#31) Closes #27. PR #25 added test_core1_rd_data_stable_cycle_after_ack in verif/global_mem_controller/, which depends on the implicit invariant that cm_rd_data (driven by global_mem_axi4_adapter.core_mem_rd_data) holds its value until the next request. That invariant was a property of the current single-outstanding implementation, not a written port contract — a future multi-outstanding adapter or response-forwarding optimization could silently glitch the value with no compile-time error and no test failure. This commit elevates the invariant to a public port contract: src/popsolutions/axi4/global_mem_axi4_adapter.sv Adds a 'PUBLIC CONTRACT - core_mem_rd_data stability' header block above the module declaration. States normatively that core_mem_rd_data MUST remain bit-stable from the cycle of core_mem_ack=1 until the cycle BEFORE the next core_mem_rd_req or core_mem_wr_req is sampled high. Documents the remediation path: any future implementation that cannot honor this MUST rename the public port surface so consumers break loudly at integration time rather than silently at runtime. References the enforcing test by full path. verif/global_mem_axi4_adapter/test_global_mem_axi4_adapter.py Adds test_rd_data_stable_between_requests. Pre-loads two distinct values at different cache lines, issues a read at addr A, captures core_mem_rd_data on the ack cycle, then holds the bus idle for 8 clocks while re-sampling every cycle and asserting bit-exact equality with the on-ack value. Also stirs core_mem_addr to 0xDEAD0000 during the idle window to catch any combinational dependency on the address bus, and asserts busy/ack stay deasserted. A final follow-up read of addr B confirms the held value was the genuine prior result, not a stuck driver. Test evidence (verif/global_mem_axi4_adapter): TESTS=7 PASS=7 FAIL=0 SKIP=0 test_reset PASS test_word_roundtrip PASS test_slot_independence_within_line PASS test_all_slots_within_line PASS test_cross_cache_line PASS test_busy_during_transaction PASS test_rd_data_stable_between_requests PASS (new) Regression evidence (verif/global_mem_controller): TESTS=10 PASS=10 FAIL=0 SKIP=0 test_core1_rd_data_stable_cycle_after_ack PASS (PR #25 — still green) Out of scope (separate ADR + PR per issue scope): refactoring the adapter to be multi-outstanding; touching global_mem_controller.sv or other consumers. Authored by Agent 1 (RTL Architect). Signed-off-by: Marcos <m@pop.coop> Co-authored-by: Marcos <m@pop.coop>
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
Closes #22.
PR #19 changed
core1_rd_datainsrc/global_mem_controller.svfromoutput reg(registered) tooutput wire(combinationalassign core1_rd_data = cm_rd_data). Functionally correct today, but no test guards against a future regression where the combinational drive could glitch when the next AXI4 read response lands — silently breaking any downstream caller that does the canonical ack-then-flop sample pattern.This PR adds
test_core1_rd_data_stable_cycle_after_ackto the existingverif/global_mem_controller/cocotb suite. The test:core1read and waits forcore1_ack.core1_rd_dataon the ack cycle (T).core1_rd_dataon cycle T+1.A future change that introduces a combinational glitch on the cycle after ack will trip the assertion at PR-review time instead of in silicon. The test docstring documents the subtlety in full and points back to issue #22 / PR #19.
Decision: Option A vs Option B
The issue suggested adding the regression in
verif/gpu_die/. I chose Option A (extend the existingverif/global_mem_controller/testbench) over Option B (create a newverif/gpu_die/harness) for these reasons:core1_rd_dataandcore1_ackcleanly — no additional plumbing required.gpu_dietestbench would re-prove behaviour theglobal_mem_controllersuite already covers, multiplying maintenance cost without adding signal.gpu_die-level integration testing is desired later (e.g. exercising thecore↔global_mem_controllerhandshake end-to-end), this regression remains valid as a unit-level canary that fires earlier in the dependency chain.Out of scope (deliberate)
core1_rd_databack to a registered output. That is a design decision needing its own ADR — this PR only guards the current contract with a regression test.Test plan
cd verif/global_mem_controller && source ../.venv/bin/activate && makeTESTS=8 PASS=8 FAIL=0 SKIP=0(the 7 pre-existing tests + the new one)cm_rd_datahold semantics in the current adapter match the docstring's claimRefs
docs/popsolutions/architecture/PARAMETER_TAXONOMY.md: caller-surface contract contextAuthored by Agent 1 (RTL Architect).