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
detect pma load/store fault, use in assert #2332
detect pma load/store fault, use in assert #2332
Conversation
ba42eb6
to
ecf2c83
Compare
Signed-off-by: Robin Pedersen <Robin.Pedersen@silabs.com>
ecf2c83
to
6a1f2f7
Compare
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.
Adding some comments in an attempt to ease the review.
@@ -174,6 +182,16 @@ module uvmt_cv32e40s_pma_assert | |||
); | |||
|
|||
|
|||
// PMA-deny on instr, no mem op (vplan: Not a vplan item. Inspo from a_failure_denies_subsequents.) | |||
|
|||
a_failure_denies_memops: assert property ( |
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.
Here is the old assert, with a new name, because it was somewhat useful still.
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.
If this assertion is necessary shouldnt we add it to the vplan? Or is it somehow a support assert for another assert (listed in a vplan)?
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.
In principle it could be added to the vplan.
But since this is a very minor extra check, I don't think it is worth the effort.
|-> | ||
(rvfi_instr_if.rvfi_mem_wmask != rvfi_instr_if.rvfi_mem_wmask_intended) | ||
|| | ||
(rvfi_instr_if.rvfi_mem_wmask == 'd 0) |
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.
Luckily, we had the rvfi_mem_wmask_intended
signal from before. 🙇
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.
is || (rvfi_instr_if.rvfi_mem_wmask == 'd 0) necessary?
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.
This might be unnecessary, but not breaking, so we let it lie.
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.
is || (rvfi_instr_if.rvfi_mem_wmask == 'd 0) necessary?
It would look more sensible if it said:
|| (rvfi_instr_if.rvfi_mem_wmask_intended == 'd 0)
The point is:
Either "actual" is short of "intended", or nothing was intended at all.
Or, it might have been a better fit to have it as a constraint in the antecedent.
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.
It is not unnecessary. It was found by a CEX.
@@ -146,12 +146,20 @@ module uvmt_cv32e40s_pma_assert | |||
|
|||
// After PMA-deny, subsequent accesses are also suppressed (vplan:"Multi-memory operation instructions") | |||
|
|||
a_failure_denies_subsequents: assert property ( | |||
rvfi_instr_if.is_pma_instr_fault | |||
a_failure_denies_subsequents_loads: assert property ( |
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.
I see you have changed the assertion name. Is this something that should be updated in link to coverage in a vplan?
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.
That kind of work is better suited for a machine than a human.
And we are in the process of revising the vplan system to facilitate more automation.
Can this be the first challenge for a new automated system to sort out?
Or is the benefit of doing it manually today so big that it is warranted?
(Note that the name's prefix is the same, so the linkage is not 100% broken.)
(Note also that no testing has been removed, so the vplan is not more lacking after this PR.)
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.
A few reasonable comments here, but as they are non-functional objections and we want to merge now, we defer these until Robin has time to revisit, and approve as is.
|-> | ||
(rvfi_instr_if.rvfi_mem_wmask != rvfi_instr_if.rvfi_mem_wmask_intended) | ||
|| | ||
(rvfi_instr_if.rvfi_mem_wmask == 'd 0) |
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.
This might be unnecessary, but not breaking, so we let it lie.
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.
Approving, @silabs-robin please update vplan accordingly
This PR fixes an erronous assert, and two TODOs within it.
Test status: