axi_to_detailed_mem: Parenthesize read active-bank mask#427
Closed
niwis wants to merge 1 commit into
Closed
Conversation
`meta_buf_size_enable` restricts the per-bank read-error reduction
(`resp_r_err = |(m2s_resp.err & meta_buf_size_enable)`) to the banks
actually covered by the access. Operator precedence broke its computation:
meta_buf.addr % DataWidth/8 parses as (meta_buf.addr % DataWidth) / 8
... + 1<<meta_buf.size parses as (... + 1) << meta_buf.size
instead of the intended `meta_buf.addr % (DataWidth/8)` and
`... + (1<<meta_buf.size)`.
The mask happens to be correct for beat-aligned reads but is wrong for
sub-beat address offsets. Example: a 4-byte read of the last 32-bit
register of a small register block over a 64-bit bus wrongly marks the
upper bank as active. An over-read of the adjacent unmapped word (as
emitted under devmode error reporting) then poisons the whole beat's
`r.resp` with SLVERR.
Parenthesize both sub-expressions: `% (DataWidth/8)` and `(1<<size)`.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Nils Wistoff <nwistoff@iis.ee.ethz.ch>
Contributor
Author
|
Just realised that this is a duplicate of #426. |
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.
Claudio and I stumbled across the following:
Problem
meta_buf_size_enablerestricts the per-bank read-error reduction (resp_r_err = |(m2s_resp.err & meta_buf_size_enable)) to the banks actually covered by the access. Operator precedence broke its computation:instead of the intended
meta_buf.addr % (DataWidth/8)and... + (1<<meta_buf.size).Impact
The mask happens to be correct for beat-aligned reads but is wrong for sub-beat address offsets. Example: a 4-byte read of the last 32-bit register of a small register block over a 64-bit bus wrongly marks the upper bank as active. An over-read of the adjacent unmapped word (as emitted under devmode error reporting) then poisons the whole beat's
r.respwith SLVERR.Fix
Parenthesize both sub-expressions:
% (DataWidth/8)and(1<<size).