-
Notifications
You must be signed in to change notification settings - Fork 781
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
[flash_ctrl] Pop read pipeline FIFOs for data and mask in sync #22571
Conversation
This commit fixes a bug in the read pipeline where the data and the mask storage FIFO could get out of sync in case of the mask computation running behind the actual Flash read (e.g. due to back pressure in the shared scrambling logic). To avoid the FIFOs getting out of sync, the design now tracks whether for reads that don't require descrambling, a mask was still computed. This can happen if for scramble enabled locations that are being erased. In case a mask computation has been started, the FIFOs are now only popped if both the data and the mask FIFO contain a valid entry (i.e. the mask computation for the data to be popped has finished). This resolves lowRISC#22443 Signed-off-by: Pirmin Vogel <[email protected]>
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.
Looks good. I am afraid this interface is getting a bit messy. Do you think it should be implemented by a state machine or in some other cleaner fashion at some point?
Thanks @matutem ! Regarding implementing a state machine for this: I don't know if this would improve things to be honest as the read pipeline is pipelined: Multiple requests can be in flight and there is even a small cache. I believe this is always going to be a bit messy. What would maybe help is a more thorough cleanup (of code and comments - some are no longer aligned with the RTL) but I fear this would introduce risk again which is undesirable at this stage. |
Regression results are here, things look good:
|
This commit fixes a bug in the read pipeline where the data and the mask storage FIFO could get out of sync in case of the mask computation running behind the actual Flash read (e.g. due to back pressure in the shared scrambling logic).
To avoid the FIFOs getting out of sync, the design now tracks whether for reads that don't require descrambling, a mask was still computed. This can happen if for scramble enabled locations that are being erased. In case a mask computation has been started, the FIFOs are now only popped if both the data and the mask FIFO contain a valid entry (i.e. the mask computation for the data to be popped has finished).
This resolves #22443