From 9e4a950aa6aa0e20eb638aeeb78743d4a9ddaaeb Mon Sep 17 00:00:00 2001 From: Greg Chadwick Date: Mon, 15 Jul 2024 21:03:52 +0100 Subject: [PATCH] [rtl] Fix logic for generating ECC related alerts Under certain circumstances Ibex ignored the ECC check from the register file when it should not have. This fixes the issue. Fixes #2188 --- rtl/ibex_core.sv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rtl/ibex_core.sv b/rtl/ibex_core.sv index fa5c51e3f..5df9ae1b7 100644 --- a/rtl/ibex_core.sv +++ b/rtl/ibex_core.sv @@ -916,8 +916,8 @@ module ibex_core import ibex_pkg::*; #( assign rf_rdata_b = rf_rdata_b_ecc_i[31:0]; // Calculate errors - qualify with WB forwarding to avoid xprop into the alert signal - assign rf_ecc_err_a_id = |rf_ecc_err_a & rf_ren_a & ~rf_rd_a_wb_match; - assign rf_ecc_err_b_id = |rf_ecc_err_b & rf_ren_b & ~rf_rd_b_wb_match; + assign rf_ecc_err_a_id = |rf_ecc_err_a & rf_ren_a & ~(rf_rd_a_wb_match & rf_write_wb); + assign rf_ecc_err_b_id = |rf_ecc_err_b & rf_ren_b & ~(rf_rd_b_wb_match & rf_write_wb); // Combined error assign rf_ecc_err_comb = instr_valid_id & (rf_ecc_err_a_id | rf_ecc_err_b_id);