From c4e81922dae56f73b3ccbdd5ee685df0e9f68c77 Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Mon, 23 May 2022 12:27:07 +0100 Subject: [PATCH] Don't store bit 1 of mepc on non-RVC implementations --- hdl/hazard3_csr.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hdl/hazard3_csr.v b/hdl/hazard3_csr.v index 886fcf1..84cc975 100644 --- a/hdl/hazard3_csr.v +++ b/hdl/hazard3_csr.v @@ -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