mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
Modified the preformance counter's InstRet to include ECALL and EBREAK by changing the hazard logic so these instructions don't self flush the W stage.
This commit is contained in:
parent
97653e1aea
commit
bb3e94d68a
@ -34,6 +34,7 @@ module hazard(
|
|||||||
input logic LSUStall, ICacheStallF,
|
input logic LSUStall, ICacheStallF,
|
||||||
input logic FPUStallD, FStallD,
|
input logic FPUStallD, FStallD,
|
||||||
input logic DivBusyE,FDivBusyE,
|
input logic DivBusyE,FDivBusyE,
|
||||||
|
input logic EcallFaultM, BreakpointFaultM,
|
||||||
// Stall & flush outputs
|
// Stall & flush outputs
|
||||||
output logic StallF, StallD, StallE, StallM, StallW,
|
output logic StallF, StallD, StallE, StallM, StallW,
|
||||||
output logic FlushF, FlushD, FlushE, FlushM, FlushW
|
output logic FlushF, FlushD, FlushE, FlushM, FlushW
|
||||||
@ -79,5 +80,7 @@ module hazard(
|
|||||||
assign FlushD = FirstUnstalledD | TrapM | RetM | BPPredWrongE;
|
assign FlushD = FirstUnstalledD | TrapM | RetM | BPPredWrongE;
|
||||||
assign FlushE = FirstUnstalledE | TrapM | RetM | BPPredWrongE;
|
assign FlushE = FirstUnstalledE | TrapM | RetM | BPPredWrongE;
|
||||||
assign FlushM = FirstUnstalledM | TrapM | RetM;
|
assign FlushM = FirstUnstalledM | TrapM | RetM;
|
||||||
assign FlushW = FirstUnstalledW | TrapM;
|
// 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.
|
||||||
|
assign FlushW = FirstUnstalledW | (TrapM & ~(BreakpointFaultM | EcallFaultM));
|
||||||
endmodule
|
endmodule
|
||||||
|
@ -75,7 +75,9 @@ module privileged (
|
|||||||
output logic [1:0] STATUS_MPP,
|
output logic [1:0] STATUS_MPP,
|
||||||
output var logic [7:0] PMPCFG_ARRAY_REGW[`PMP_ENTRIES-1:0],
|
output var logic [7:0] PMPCFG_ARRAY_REGW[`PMP_ENTRIES-1:0],
|
||||||
output var logic [`XLEN-1:0] PMPADDR_ARRAY_REGW [`PMP_ENTRIES-1:0],
|
output var logic [`XLEN-1:0] PMPADDR_ARRAY_REGW [`PMP_ENTRIES-1:0],
|
||||||
output logic [2:0] FRM_REGW
|
output logic [2:0] FRM_REGW,
|
||||||
|
output logic BreakpointFaultM, EcallFaultM
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
logic [1:0] NextPrivilegeModeM;
|
logic [1:0] NextPrivilegeModeM;
|
||||||
@ -94,7 +96,6 @@ module privileged (
|
|||||||
logic InstrAccessFaultD, InstrAccessFaultE, InstrAccessFaultM;
|
logic InstrAccessFaultD, InstrAccessFaultE, InstrAccessFaultM;
|
||||||
logic IllegalInstrFaultM, TrappedSRETM;
|
logic IllegalInstrFaultM, TrappedSRETM;
|
||||||
|
|
||||||
logic BreakpointFaultM, EcallFaultM;
|
|
||||||
logic MTrapM, STrapM, UTrapM;
|
logic MTrapM, STrapM, UTrapM;
|
||||||
logic InterruptM;
|
logic InterruptM;
|
||||||
|
|
||||||
|
@ -167,6 +167,7 @@ module wallypipelinedhart
|
|||||||
logic PendingInterruptM;
|
logic PendingInterruptM;
|
||||||
logic DCacheMiss;
|
logic DCacheMiss;
|
||||||
logic DCacheAccess;
|
logic DCacheAccess;
|
||||||
|
logic BreakpointFaultM, EcallFaultM;
|
||||||
|
|
||||||
|
|
||||||
ifu ifu(.InstrInF(InstrRData),
|
ifu ifu(.InstrInF(InstrRData),
|
||||||
|
Loading…
Reference in New Issue
Block a user