Don't store bit 1 of mepc on non-RVC implementations

This commit is contained in:
Luke Wren 2022-05-23 12:27:07 +01:00
parent 31061bd472
commit c4e81922da
1 changed files with 2 additions and 2 deletions

View File

@ -339,8 +339,8 @@ end
// Exception program counter
reg [XLEN-1:0] mepc;
// LSB is always 0
localparam MEPC_MASK = {{XLEN-1{1'b1}}, 1'b0};
// mepc only holds values aligned to instruction alignment
localparam MEPC_MASK = {{XLEN-2{1'b1}}, |EXTENSION_C, 1'b0};
always @ (posedge clk or negedge rst_n) begin
if (!rst_n) begin