🐛 [rtl] fix iCache block error bug #457
Merged
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.
Bug Description
Whenever the instruction cache detects a "miss" it fetches a complete block from main memory. If any address within that block does not assert a bus access ACKNOWLEDGE, or if any address within that block asserts a bus accesses ERROR, the whole cache block is invalidated and the CPU receives an ERROR - regardless of the actually accessed address.
Example:
0x00001008
, which triggers an i-cache miss0x00001000
)0x00001000
asserts an ERROR while all other addresses inside the block assert an ACKNOWLEDGE0x00001000
reported an ERRORA more real-world example:
The same error occurs if the instruction cache is fetching a block from a memory that is smaller than the instruction cache block size: if the block size is configured to 64 bytes and the cache tries to access a "freestanding" memory module that implements 32 bytes (starting at a 64-byte-aligned address) then accesses to the upper 32 byte will result a bus ERROR marking the whole block as "faulty" even if the lower 32 bytes are just fine.
Fix Description
Add an additional status bit to each cache word that shows the bus access status (failed/succeed).