forked from Github_Repos/cvw
privileged pc mux cleanup.
This commit is contained in:
parent
97593e8a6f
commit
80be2e7be5
@ -100,8 +100,8 @@ module csr #(parameter
|
|||||||
logic [`XLEN-1:0] TVec, TrapVector, NextFaultMtvalM;
|
logic [`XLEN-1:0] TVec, TrapVector, NextFaultMtvalM;
|
||||||
logic MTrapM, STrapM;
|
logic MTrapM, STrapM;
|
||||||
|
|
||||||
logic [`XLEN-1:0] PrivilegedNextPCM;
|
logic [`XLEN-1:0] XEPC_REG;
|
||||||
|
logic RetM;
|
||||||
|
|
||||||
logic InstrValidNotFlushedM;
|
logic InstrValidNotFlushedM;
|
||||||
assign InstrValidNotFlushedM = ~StallW & ~FlushW;
|
assign InstrValidNotFlushedM = ~StallW & ~FlushW;
|
||||||
@ -146,14 +146,10 @@ module csr #(parameter
|
|||||||
assign TrapVector = {TVec[`XLEN-1:2], 2'b00};
|
assign TrapVector = {TVec[`XLEN-1:2], 2'b00};
|
||||||
end
|
end
|
||||||
|
|
||||||
always_comb
|
assign RetM = mretM | sretM;
|
||||||
if (TrapM) PrivilegedNextPCM = TrapVector;
|
mux2 #(`XLEN) xepcMux(SEPC_REGW, MEPC_REGW, mretM, XEPC_REG);
|
||||||
else if (mretM) PrivilegedNextPCM = MEPC_REGW;
|
mux3 #(`XLEN) pcmux3(PCNext2F, XEPC_REG, TrapVector, {TrapM, RetM}, UnalignedPCNextF);
|
||||||
else PrivilegedNextPCM = SEPC_REGW;
|
|
||||||
|
|
||||||
logic PrivilegedChangePCM;
|
|
||||||
assign PrivilegedChangePCM = mretM | sretM | TrapM;
|
|
||||||
mux2 #(`XLEN) pcmux3(.d0(PCNext2F), .d1(PrivilegedNextPCM), .s(PrivilegedChangePCM), .y(UnalignedPCNextF));
|
|
||||||
|
|
||||||
///////////////////////////////////////////
|
///////////////////////////////////////////
|
||||||
// CSRWriteValM
|
// CSRWriteValM
|
||||||
|
Loading…
Reference in New Issue
Block a user