RVFI - Code for rvfi_trap needs explanation
Created by: Silabs-ArjanB
The following code needs explanation:
The following needs to be addressed:
- Why is an 'if' stage signal used here? It is not necessarily incorrect, but it needs to be explained why/how the 'if' stage signal is guaranteed to be valid when wb_valid_i = 1.
- It is my understanding from https://cv32e40x-user-manual.readthedocs.io/en/latest/rvfi.html#compatibility that rvfi_trap will only be used for synchronous traps; how is it guaranteed that debug_taken_if only related to synchronous (debug) traps?
- The usage of exception_in_wb seems wrong; shouldn't this be qualified by excluding higher priority controller events (e.g. NMIs)? Thinking of this again, this might actually be correct because likely wb_valid_i = 0 in this case, but if that is why it works it needs to be documented in the RVFI code.