From 5cdd3d57c79d9c5efc65898eb650dac96dfe6e59 Mon Sep 17 00:00:00 2001 From: David Harris Date: Fri, 7 Apr 2023 21:27:13 -0700 Subject: [PATCH] Commented WFI non-flush in writeback stage of hazard unit --- src/hazard/hazard.sv | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hazard/hazard.sv b/src/hazard/hazard.sv index 11efacffa..224ff8b37 100644 --- a/src/hazard/hazard.sv +++ b/src/hazard/hazard.sv @@ -71,6 +71,7 @@ module hazard ( // Similarly, CSR writes and fences flush all subsequent instructions and refetch them in light of the new operating modes and cache/TLB contents // Branch misprediction is found in the Execute stage and must flush the next two instructions. // However, an active division operation resides in the Execute stage, and when the BP incorrectly mispredicts the divide as a taken branch, the divde must still complete + // When a WFI is interrupted and causes a trap, it flushes the rest of the pipeline but not the W stage, because the WFI needs to commit assign FlushDCause = TrapM | RetM | CSRWriteFenceM | BPWrongE; assign FlushECause = TrapM | RetM | CSRWriteFenceM |(BPWrongE & ~(DivBusyE | FDivBusyE)); assign FlushMCause = TrapM | RetM | CSRWriteFenceM;