-
Notifications
You must be signed in to change notification settings - Fork 554
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] Guard against false memory responses for secure configurations #2166
Conversation
ba476ed
to
2e34f95
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.
I think this change looks reasonable to me, although it would be good to get more people to approve before merging.
2e34f95
to
74e2196
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.
Very nice work, many thanks @GregAC !
rtl/ibex_ex_block.sv
Outdated
assign sva_multdiv_fsm_idle = 1'b1; | ||
end | ||
|
||
// Mark the sva_multduv_fsm_idle as unused to avoid lint issues |
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.
Mintor typo: sva_multduv_fsm_idle -> sva_multdiv_fsm_idle
@@ -1810,6 +1839,9 @@ module ibex_core import ibex_pkg::*; #( | |||
// Certain parameter combinations are not supported | |||
`ASSERT_INIT(IllegalParamSecure, !(SecureIbex && (RV32M == RV32MNone))) | |||
|
|||
// If the ID stage signals its ready the mult/div FSMs must be idle in the following cycle | |||
`ASSERT(MultDivFSMIdleOnIdReady, id_in_ready |=> ex_block_i.sva_multdiv_fsm_idle) |
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.
ex_block_i.sva_multdiv_fsm_idle is not accessible if INC_ASSERT is not defined
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 is true but ASSERT
is just an empty macro when INC_ASSERT
isn't defined so this doesn't cause an issue.
74e2196
to
8fe62ea
Compare
With this change all memory responses are only acted on if Ibex is expecting them for all secure configurations. Previously an error response that was injected onto the bus would trigger an exception that shouldn't occur (in particular breaking the functioning of the multiply state machine). In addition for configurations without the writeback stage an injected load data response could trigger an incorrect write to the register file. This is only applied to the secure configurations, non-secure configurations assume correct adherence to the bus protocol meaning a response will only be seen if a request is outstanding.
8fe62ea
to
2fc670d
Compare
With this change all memory responses are only acted on if Ibex is expecting them for all secure configurations. Previously an error response that was injected onto the bus would trigger an exception that shouldn't occur (in particular breaking the functioning of the multiply state machine). In addition for configurations without the writeback stage an injected load data response could trigger an incorrect write to the register file.
This is only applied to the secure configurations, non-secure configurations assume correct adherence to the bus protocol meaning a response will only be seen if a request is outstanding.
Fixes #2144