From b81270cdb5cfa749b47bbc0bb3a3a593bf6eec99 Mon Sep 17 00:00:00 2001 From: Rafal Kolucki Date: Thu, 14 Dec 2023 12:57:19 +0100 Subject: [PATCH] Move `perr_dat_ff` closer to ICACHE_ENABLED-gated logic Internal-tag: [#52136] Signed-off-by: Rafal Kolucki --- design/ifu/el2_ifu_mem_ctl.sv | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/design/ifu/el2_ifu_mem_ctl.sv b/design/ifu/el2_ifu_mem_ctl.sv index 09f67f571d5..b022761f195 100644 --- a/design/ifu/el2_ifu_mem_ctl.sv +++ b/design/ifu/el2_ifu_mem_ctl.sv @@ -281,11 +281,6 @@ import el2_pkg::*; logic sel_mb_status_addr ; logic [63:0] ic_final_data; - logic [pt.ICACHE_INDEX_HI:pt.ICACHE_TAG_INDEX_LO] ifu_ic_rw_int_addr_ff ; - logic [pt.ICACHE_INDEX_HI:pt.ICACHE_TAG_INDEX_LO] ifu_status_wr_addr_ff ; - logic [pt.ICACHE_INDEX_HI:pt.ICACHE_TAG_INDEX_LO] ifu_ic_rw_int_addr_w_debug ; - logic [pt.ICACHE_INDEX_HI:pt.ICACHE_TAG_INDEX_LO] ifu_status_wr_addr_w_debug ; - logic [pt.ICACHE_STATUS_BITS-1:0] way_status_new_ff ; logic way_status_wr_en_ff ; logic [pt.ICACHE_TAG_DEPTH-1:0][pt.ICACHE_STATUS_BITS-1:0] way_status_out ; @@ -918,13 +913,10 @@ assign ic_rd_parity_final_err = ic_tag_perr & ~exu_flush_final & sel_ic_data & ~ (fetch_req_icache_f & ~reset_all_tags & (~miss_pending | (miss_state==HIT_U_MISS)) & ~sel_mb_addr_ff); logic [pt.ICACHE_NUM_WAYS-1:0] perr_err_inv_way; -logic [pt.ICACHE_INDEX_HI:pt.ICACHE_TAG_INDEX_LO] perr_ic_index_ff; logic perr_sel_invalidate; -logic perr_sb_write_status ; - - - - rvdffe #(.WIDTH(pt.ICACHE_INDEX_HI-pt.ICACHE_TAG_INDEX_LO+1),.OVERRIDE(1)) perr_dat_ff (.din(ifu_ic_rw_int_addr_ff[pt.ICACHE_INDEX_HI:pt.ICACHE_TAG_INDEX_LO]), .dout(perr_ic_index_ff[pt.ICACHE_INDEX_HI : pt.ICACHE_TAG_INDEX_LO]), .en(perr_sb_write_status), .*); +`ifdef RV_ICACHE_ENABLE +logic perr_sb_write_status; +`endif assign perr_err_inv_way[pt.ICACHE_NUM_WAYS-1:0] = {pt.ICACHE_NUM_WAYS{perr_sel_invalidate}} ; assign iccm_correct_ecc = (perr_state == ECC_CORR); @@ -944,14 +936,18 @@ logic perr_sb_write_status ; always_comb begin : ERROR_SM perr_nxtstate = ERR_IDLE; perr_state_en = 1'b0; - perr_sb_write_status = 1'b0; perr_sel_invalidate = 1'b0; +`ifdef RV_ICACHE_ENABLE + perr_sb_write_status = 1'b0; +`endif case (perr_state) ERR_IDLE: begin : err_idle perr_nxtstate = iccm_dma_sb_error ? DMA_SB_ERR : (ic_error_start & ~exu_flush_final) ? IC_WFF : ECC_WFF; perr_state_en = (((iccm_error_start | ic_error_start) & ~dec_tlu_flush_lower_wb) | iccm_dma_sb_error) & ~dec_tlu_force_halt; +`ifdef RV_ICACHE_ENABLE perr_sb_write_status = perr_state_en; +`endif end IC_WFF: begin : icache_wff // All the I$ data and/or Tag errors ( parity/ECC ) will come to this state perr_nxtstate = ERR_IDLE ; @@ -973,8 +969,10 @@ logic perr_sb_write_status ; default: begin : def_case perr_nxtstate = ERR_IDLE; perr_state_en = 1'b0; - perr_sb_write_status = 1'b0; perr_sel_invalidate = 1'b0; +`ifdef RV_ICACHE_ENABLE + perr_sb_write_status = 1'b0; +`endif end endcase end @@ -1393,6 +1391,16 @@ assign ic_write_stall = write_ic_16_bytes & ~((((miss_state== C /////////////////////////////////////////////////////////////// logic [pt.ICACHE_NUM_WAYS-1:0] ic_tag_valid_unq; if (pt.ICACHE_ENABLE == 1 ) begin: icache_enabled + logic [pt.ICACHE_INDEX_HI:pt.ICACHE_TAG_INDEX_LO] ifu_status_wr_addr_w_debug; + logic [pt.ICACHE_INDEX_HI:pt.ICACHE_TAG_INDEX_LO] ifu_status_wr_addr_ff ; + logic [pt.ICACHE_INDEX_HI:pt.ICACHE_TAG_INDEX_LO] ifu_ic_rw_int_addr_w_debug; + logic [pt.ICACHE_INDEX_HI:pt.ICACHE_TAG_INDEX_LO] ifu_ic_rw_int_addr_ff; + logic [pt.ICACHE_INDEX_HI:pt.ICACHE_TAG_INDEX_LO] perr_ic_index_ff; + +`ifdef RV_ICACHE_ENABLE + rvdffe #(.WIDTH(pt.ICACHE_INDEX_HI-pt.ICACHE_TAG_INDEX_LO+1),.OVERRIDE(1)) perr_dat_ff (.din(ifu_ic_rw_int_addr_ff[pt.ICACHE_INDEX_HI:pt.ICACHE_TAG_INDEX_LO]), .dout(perr_ic_index_ff[pt.ICACHE_INDEX_HI : pt.ICACHE_TAG_INDEX_LO]), .en(perr_sb_write_status), .*); +`endif + assign ic_valid = ~ifu_wr_cumulative_err_data & ~(reset_ic_in | reset_ic_ff) & ~reset_tag_valid_for_miss; assign ifu_status_wr_addr_w_debug[pt.ICACHE_INDEX_HI:pt.ICACHE_TAG_INDEX_LO] = ((ic_debug_rd_en | ic_debug_wr_en ) & ic_debug_tag_array) ?