diff --git a/pipelined/src/hazard/hazard.sv b/pipelined/src/hazard/hazard.sv index 98a7ff28b..3cee7b037 100644 --- a/pipelined/src/hazard/hazard.sv +++ b/pipelined/src/hazard/hazard.sv @@ -82,7 +82,7 @@ module hazard( assign FirstUnstalledW = ~StallW & StallM; // Each stage flushes if the previous stage is the last one stalled (for cause) or the system has reason to flush - assign Fence = InvalidateICacheM; // | sfencevmaM; // fences flush Fetch stage ***why + assign Fence = InvalidateICacheM; // | sfencevmaM; // Fences should flush the pipeline and restart *** sfence not working assign PrivilegedFlush = TrapM | RetM | Fence; // privileged stage change and fences flush pipeline assign FlushF = BPPredWrongE | Fence; assign FlushD = FirstUnstalledD | PrivilegedFlush | BPPredWrongE; diff --git a/pipelined/src/ieu/controller.sv b/pipelined/src/ieu/controller.sv index 41bad29e0..501c3d59a 100644 --- a/pipelined/src/ieu/controller.sv +++ b/pipelined/src/ieu/controller.sv @@ -174,7 +174,6 @@ module controller( assign {RegWriteD, ImmSrcD, ALUSrcAD, ALUSrcBD, MemRWD, ResultSrcD, BranchD, ALUOpD, JumpD, ALUResultSrcD, W64D, CSRReadD, PrivilegedD, FenceD, MDUD, AtomicD, unused} = IllegalIEUInstrFaultD ? `CTRLW'b0 : ControlsD; - // *** move Privileged, CSRwrite?? Or move controller out of IEU into datapath and handle all instructions assign CSRZeroSrcD = InstrD[14] ? (InstrD[19:15] == 0) : (Rs1D == 0); // Is a CSR instruction using zero as the source? assign CSRWriteD = CSRReadD & !(CSRZeroSrcD & InstrD[13]); // Don't write if setting or clearing zeros