fix(axi4_bfm): fix _captureWriteData and _respondWrite in Axi4MemorySubordinate#289
Open
caflore1 wants to merge 2 commits into
Open
fix(axi4_bfm): fix _captureWriteData and _respondWrite in Axi4MemorySubordinate#289caflore1 wants to merge 2 commits into
caflore1 wants to merge 2 commits into
Conversation
…ubordinate _captureWriteData previously read wIntf.data.value directly, capturing only the last beat's data for multi-beat bursts. The W-channel monitor fires once per burst with all beats aggregated in packet.data via rswizzle(); unpack individual beats using getRange(i*dw, (i+1)*dw) instead. Also clear _writeDataQueue[mapIdx] before unpacking to remove any beat-0 entry that _receiveWrite may have added during simultaneous AW+W handshake, and set _writeReadyToOccur unconditionally (monitor fires only on WLAST). In _respondWrite, clear _writeDataQueue[mapIdx] after processing to prevent stale entries from accumulating across back-to-back transactions. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
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
Axi4SubordinateMemoryAgent._captureWriteDatawas readingwIntf.data.valuedirectly to build each
Axi4DataPacket. The W-channel monitor fires once perburst with all beats already aggregated in
packet.datavia_dataBuf.rswizzle(), sowIntf.data.valueholds only the last beat'sdata at that point. Every address in a multi-beat write burst ended up storing
the last beat's value.
Bugs Fixed
Multi-beat burst data corruption — read
packet.dataand unpack eachbeat with
getRange(i*dw, (i+1)*dw)instead of readingwIntf.data.value.Stale beat-0 entry on simultaneous AW+W —
_receiveWritecan enqueue abeat-0 packet when AW and the first W beat arrive together; clear the queue
before unpacking so the complete authoritative burst data is used.
Queue accumulation across back-to-back bursts —
_writeDataQueuewasnever cleared after
_respondWritecompleted, causing stale entries tocorrupt subsequent transactions. Added a
clear()call after the responseis sent.
Changes
lib/src/models/amba/amba4_bfm/axi4_memory_subordinate.dart— surgical fixto
_captureWriteDataand_respondWritetest/amba/amba4/axi4_bfm_test.dart— new testmulti-beat write burst stores each beat at its own addressverifies a4-beat INCR burst writes distinct data to each consecutive address
Testing
All 1354 tests pass (
dart test). The new test explicitly exercises the bugthat was previously silent.