Fix AXI4 write strobe handling and optimize byte enable #74
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: