rvfi: fix non-zero mem_rmask on non-memory instructions - #2489
Open
devtyagi3909 wants to merge 1 commit into
Open
rvfi: fix non-zero mem_rmask on non-memory instructions#2489devtyagi3909 wants to merge 1 commit into
devtyagi3909 wants to merge 1 commit into
Conversation
When an instruction performs no memory access, its rvfi_mem_rmask should be zero. Previously, it defaulted to 4'b1111 (via lsu_type defaulting to 2'b00) and was only zeroed out for stores (data_we_o). This meant every non-memory instruction reported a read mask of 4'b1111, which formally violates the RVFI specification by claiming four bytes were read from an arbitrary address. This gates the assignment of both rvfi_stage_mem_rmask and rvfi_stage_mem_wmask with lsu_req, ensuring they are strictly zeroed when the instruction does not actually issue a memory request. Fixes lowRISC#2476
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.
Fixes #2476.
As outlined in the issue, non-memory instructions previously defaulted to an
rvfi_mem_rmaskof4'b1111becauselsu_typedefaulted to word encoding and the mask was only gated to zero for stores (data_we_o). This violates the RVFI spec by formally claiming 4 bytes were read from an arbitrary address.This PR gates the application of
rvfi_mem_mask_intto both the read and write masks withlsu_req, guaranteeing they evaluate to4'b0000when the instruction doesn't issue a memory request.Note: CLA is already signed from my previous PR today.