From e401d3e2a6a12071d5eeccdbc99e9ce8c57f4663 Mon Sep 17 00:00:00 2001 From: Marno van der Maas Date: Wed, 24 Jul 2024 12:11:35 +0100 Subject: [PATCH] Flush pipeline when PMP CSRs are cleared Co-authored-by: Louis-Emile Ploix --- rtl/ibex_id_stage.sv | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rtl/ibex_id_stage.sv b/rtl/ibex_id_stage.sv index 3a358af7ab..ab29282cd5 100644 --- a/rtl/ibex_id_stage.sv +++ b/rtl/ibex_id_stage.sv @@ -522,7 +522,9 @@ module ibex_id_stage #( // - When modifying any PMP CSR, PMP check of the next instruction might get invalidated. // Hence, a pipeline flush is needed to instantiate another PMP check with the updated CSRs. // - When modifying debug CSRs. - if (csr_op_en_o == 1'b1 && (csr_op_o == CSR_OP_WRITE || csr_op_o == CSR_OP_SET)) begin + if (csr_op_en_o == 1'b1 && (csr_op_o == CSR_OP_WRITE || + csr_op_o == CSR_OP_SET || + csr_op_o == CSR_OP_CLEAR)) begin if (csr_num_e'(instr_rdata_i[31:20]) == CSR_MSTATUS || csr_num_e'(instr_rdata_i[31:20]) == CSR_MIE || csr_num_e'(instr_rdata_i[31:20]) == CSR_MSECCFG ||