Fix issue 444 by preventing delegation of misaligned instructions when compressed instructions are supported.

This commit is contained in:
David Harris 2023-10-30 07:06:34 -07:00
parent 5ca5443835
commit 12d1aed8a9

View File

@ -94,7 +94,8 @@ module csrm import cvw::*; #(parameter cvw_t P) (
localparam DSCRATCH1 = 12'h7B3; localparam DSCRATCH1 = 12'h7B3;
// Constants // Constants
localparam ZERO = {(P.XLEN){1'b0}}; localparam ZERO = {(P.XLEN){1'b0}};
localparam MEDELEG_MASK = 16'hB3FF; // when C is supported, there can't be misaligned instructions
localparam MEDELEG_MASK = P.C_SUPPORTED ? 16'hB3FE : 16'hB3FF;
localparam MIDELEG_MASK = 12'h222; // we choose to not make machine interrupts delegable localparam MIDELEG_MASK = 12'h222; // we choose to not make machine interrupts delegable
// There are PMP_ENTRIES = 0, 16, or 64 PMPADDR registers, each of which has its own flop // There are PMP_ENTRIES = 0, 16, or 64 PMPADDR registers, each of which has its own flop