-
Notifications
You must be signed in to change notification settings - Fork 547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[rtl] Fix NAPOT address matching (#1178) #1179
Conversation
- Generate correct masks for NAPOT range addresses covering the entire granule. When PMPGranularity > 0, then a NAPOT range can span the whole granule, which requires the next-lowest bit (i.e. highest bit that is not part of the granule) to be 0. - Fixes lowRISC#1178
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with this - thanks for the fix
Hi @tomroberts-lowrisc and @michael-platzer . Please consider line 68: Here is an example that demonstrates my point.
As said, G>=1 is ok, but try it with G=0. I think it is a bug. But since there are so many nuances of the PMP spec that I might have misunderstood, I thought it best to ask if you guys agree or not. |
Hi there and thanks for the message. We might take a couple of weeks to get back to this properly because most lowRISC employees are having a Christmas break at the moment. See you in the new year! |
Btw, 3 more comments to my post above. This seemingly only fails when Above, the merge says "3 checks passed", but if you open it up At a first glance, it seems like a quick (but not so elegant) fix is as follows.
|
Hi @byllgrim , thanks for pointing this out and apologies for overlooking the consequences this change would have for a PMPGranularity of 0! Changing the indexing of However, as you wrote, this change breaks the behavior for a PMPGranularity of 0, which now includes bit 1 of The fix that you propose seems fine to me. About the error messages in the merge checks: I do not know why these appear, but I do not think that they have been introduced by this merge, since they already appear in earlier merges (for instances in 1171 and 1177). |
Hi @byllgrim thanks for raising this and providing a fix. I have opened a PR #1234 to implement the fix. In general please do submit a PR when you have a fix like this. In this instance I needed the fix for some other work I was doing (Implementing extended PMP behaviour #1232) so did the PR myself. With regards to the checks passed message along with errors this is an issue with the compliance suite expecting an exception on unaligned accesses (where Ibex deals with these in hardware which is spec compliant), so the errors are ignored for the checks, see here for more details: #100 |
Generate correct masks for NAPOT range addresses covering the entire granule. When PMPGranularity > 0, then a NAPOT range can span the whole granule, which requires the next-lowest bit (i.e. highest bit that is not part of the granule) to be 0. Fixes #1178