mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-07 04:05:19 +00:00
added #1 delays to Stalls and Flushes in hazard unit
This commit is contained in:
parent
1d41e98504
commit
38382e3a11
@ -69,11 +69,11 @@ module hazard(
|
|||||||
assign StallMCause = wfiM & (~TrapM & ~IntPendingM);
|
assign StallMCause = wfiM & (~TrapM & ~IntPendingM);
|
||||||
assign StallWCause = LSUStallM | IFUStallF;
|
assign StallWCause = LSUStallM | IFUStallF;
|
||||||
|
|
||||||
assign StallF = StallFCause | StallD;
|
assign #1 StallF = StallFCause | StallD;
|
||||||
assign StallD = StallDCause | StallE;
|
assign #1 StallD = StallDCause | StallE;
|
||||||
assign StallE = StallECause | StallM;
|
assign #1 StallE = StallECause | StallM;
|
||||||
assign StallM = StallMCause | StallW;
|
assign #1 StallM = StallMCause | StallW;
|
||||||
assign StallW = StallWCause;
|
assign #1 StallW = StallWCause;
|
||||||
|
|
||||||
assign FirstUnstalledD = ~StallD & StallF;
|
assign FirstUnstalledD = ~StallD & StallF;
|
||||||
assign FirstUnstalledE = ~StallE & StallD;
|
assign FirstUnstalledE = ~StallE & StallD;
|
||||||
@ -81,11 +81,11 @@ module hazard(
|
|||||||
assign FirstUnstalledW = ~StallW & StallM;
|
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
|
// Each stage flushes if the previous stage is the last one stalled (for cause) or the system has reason to flush
|
||||||
assign FlushF = BPPredWrongE;
|
assign #1 FlushF = BPPredWrongE;
|
||||||
assign FlushD = FirstUnstalledD | TrapM | RetM | BPPredWrongE;
|
assign #1 FlushD = FirstUnstalledD | TrapM | RetM | BPPredWrongE;
|
||||||
assign FlushE = FirstUnstalledE | TrapM | RetM | BPPredWrongE; // *** why is BPPredWrongE here, but not needed in simple processor
|
assign #1 FlushE = FirstUnstalledE | TrapM | RetM | BPPredWrongE; // *** why is BPPredWrongE here, but not needed in simple processor
|
||||||
assign FlushM = FirstUnstalledM | TrapM | RetM;
|
assign #1 FlushM = FirstUnstalledM | TrapM | RetM;
|
||||||
// on Trap the memory stage should be flushed going into the W stage,
|
// on Trap the memory stage should be flushed going into the W stage,
|
||||||
// except if the instruction causing the Trap is an ecall or ebreak.
|
// except if the instruction causing the Trap is an ecall or ebreak.
|
||||||
assign FlushW = FirstUnstalledW | (TrapM & ~(BreakpointFaultM | EcallFaultM));
|
assign #1 FlushW = FirstUnstalledW | (TrapM & ~(BreakpointFaultM | EcallFaultM));
|
||||||
endmodule
|
endmodule
|
||||||
|
Loading…
Reference in New Issue
Block a user