Fix AXI4 write strobe handling and optimize byte enable#74
Merged
eyck merged 7 commits intoMinres:developfrom Sep 30, 2025
Merged
Fix AXI4 write strobe handling and optimize byte enable#74eyck merged 7 commits intoMinres:developfrom
eyck merged 7 commits intoMinres:developfrom
Conversation
C++20 compatibility
Commit 4a6c2aa introduced a bug in write strobe handling. This change: - Reverts to the original correct strobe implementation - Disables byte_enable_len when not needed for better efficiency
Contributor
|
Many THX for the PR! I will have a look into this. |
Contributor
Author
Contributor
|
Actually the PR works well for aligned AXI accesses. I had to extend it to also cover unaligned accesses. |
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.

Commit
4a6c2aaintroduced an issue in AXI4 write strobe handling.This patch:
byte_enable_lenwhen unnecessary, improving efficiencyRoot Cause
The transfer size was incorrectly derived from simply counting the number of
0xFFstrobes.This works only when the valid bytes are aligned at the lower address boundary, but fails otherwise.
For example:
✅ Correct case (transfer size = 2 bytes, last two bytes masked off):
❌ Incorrect case (transfer size incorrectly computed as 2 bytes, but we actually need 4 bytes to cover byte 2 and byte 3):
The correct behavior should instead use the byte enable mask (as in the pre-
4a6c2aaimplementation), ensuring the full valid byte range is included.My Bug Example
When a verilated CPU writes 128 bytes starting from address
0x60000004, the SCC AXI4 target produces the following 3 write transactions. Note that the first transaction is incorrect:With the original implementation (before commit
4a6c2aa), the result is correct: