From fcca23d3216baf5c60e74734489ea338fe4a48bc Mon Sep 17 00:00:00 2001 From: Francesco Conti Date: Tue, 3 Mar 2026 22:11:08 +0100 Subject: [PATCH 1/2] Move RedMulE streamer back to ooo mux Switch back to OoO mux instead of static redmule_mux. This is compliant to HCI specifications and should be a bit faster in real use-cases. On an ideal test with no stall, an extremely small slowdown (<1%) is possible; however, the rotating priority mechanism should handle better the possible stalls encountered in practical situations. --- rtl/redmule_scheduler.sv | 8 ++++---- rtl/redmule_streamer.sv | 31 ++++++++++++++++++++++--------- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/rtl/redmule_scheduler.sv b/rtl/redmule_scheduler.sv index 6e632e1..9c38c25 100644 --- a/rtl/redmule_scheduler.sv +++ b/rtl/redmule_scheduler.sv @@ -106,7 +106,7 @@ module redmule_scheduler ) i_x_config_fifo ( .clk_i ( clk_i ), .rst_ni ( rst_ni ), - .flush_i ( clear ), + .flush_i ( clear_i ), .testmode_i ( '0 ), .full_o ( x_config_full ), .empty_o ( x_config_empty ), @@ -274,7 +274,7 @@ module redmule_scheduler ) i_w_config_fifo ( .clk_i ( clk_i ), .rst_ni ( rst_ni ), - .flush_i ( clear ), + .flush_i ( clear_i ), .testmode_i ( '0 ), .full_o ( w_config_full ), .empty_o ( w_config_empty ), @@ -410,7 +410,7 @@ module redmule_scheduler ) i_y_config_fifo ( .clk_i ( clk_i ), .rst_ni ( rst_ni ), - .flush_i ( clear ), + .flush_i ( clear_i ), .testmode_i ( '0 ), .full_o ( y_config_full ), .empty_o ( y_config_empty ), @@ -428,7 +428,7 @@ module redmule_scheduler ) i_y_config_fast_fifo ( .clk_i ( clk_i ), .rst_ni ( rst_ni ), - .flush_i ( clear ), + .flush_i ( clear_i ), .testmode_i ( '0 ), .full_o ( y_config_fast_full ), .empty_o ( y_config_fast_empty ), diff --git a/rtl/redmule_streamer.sv b/rtl/redmule_streamer.sv index 6e3fcb5..3e4ee9c 100644 --- a/rtl/redmule_streamer.sv +++ b/rtl/redmule_streamer.sv @@ -137,17 +137,19 @@ hci_core_intf #( .IW ( `HCI_SIZE_GET_IW(ldst_tcdm) ), .EW ( `HCI_SIZE_GET_EW(ldst_tcdm) ), .EHW ( `HCI_SIZE_GET_EHW(ldst_tcdm) ) -) virt_tcdm [0:NumStreamSources+1] ( .clk ( clk_i ) ); +) virt_tcdm [0:NumStreamSources] ( .clk ( clk_i ) ); -redmule_mux #( - .NB_CHAN (NumStreamSources+2), +hci_core_mux_ooo #( + .NB_CHAN ( NumStreamSources+1 ), .`HCI_SIZE_PARAM(out) ( `HCI_SIZE_PARAM(ldst_tcdm) ) ) i_mux ( - .clk_i ( clk_i ), - .rst_ni ( rst_ni ), - .clear_i ( clear_i ), - .in ( virt_tcdm ), - .out ( ldst_tcdm_pre_r_valid ) + .clk_i ( clk_i ), + .rst_ni ( rst_ni ), + .clear_i ( clear_i ), + .priority_force_i ( '0 ), + .priority_i ( '0 ), + .in ( virt_tcdm ), + .out ( ldst_tcdm_pre_r_valid ) ); hci_core_r_valid_filter #( @@ -158,7 +160,18 @@ hci_core_r_valid_filter #( .clear_i ( clear_i ), .enable_i ( 1'b1 ), .tcdm_target ( ldst_tcdm_pre_r_valid ), - .tcdm_initiator ( ldst_tcdm ) + .tcdm_initiator ( ldst_tcdm_pre_r_id ) +); + +hci_core_r_id_filter #( + .`HCI_SIZE_PARAM(tcdm_target) ( `HCI_SIZE_PARAM(ldst_tcdm) ) +) i_load_r_id_filter ( + .clk_i ( clk_i ), + .rst_ni ( rst_ni ), + .clear_i ( clear_i ), + .enable_i ( 1'b1 ), + .tcdm_target ( ldst_tcdm_pre_r_id ), + .tcdm_initiator ( ldst_tcdm ) ); /************************************ Store Channel *************************************/ From 8dfe6b7fb4153e99cb4d8e528535bb6a7a61f211 Mon Sep 17 00:00:00 2001 From: Francesco Conti Date: Wed, 4 Mar 2026 23:29:03 +0100 Subject: [PATCH 2/2] [scheduler] Fix spurious pop in y_config_fast FIFOs --- rtl/redmule_scheduler.sv | 48 ++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/rtl/redmule_scheduler.sv b/rtl/redmule_scheduler.sv index 9c38c25..07cc069 100644 --- a/rtl/redmule_scheduler.sv +++ b/rtl/redmule_scheduler.sv @@ -403,40 +403,44 @@ module redmule_scheduler logic [$clog2(W):0] y_width, z_width; logic [$clog2(D):0] y_height, z_height; + logic y_config_pop; + assign y_config_pop = y_rows_iter_q == y_config.x_rows_iter-1 && y_rows_iter_en && ~y_config_empty; fifo_v3 #( .FALL_THROUGH (0), .DEPTH (2), .dtype (redmule_config_t) ) i_y_config_fifo ( - .clk_i ( clk_i ), - .rst_ni ( rst_ni ), - .flush_i ( clear_i ), - .testmode_i ( '0 ), - .full_o ( y_config_full ), - .empty_o ( y_config_empty ), - .usage_o ( ), - .data_i ( config_i ), - .push_i ( config_valid_i ), - .data_o ( y_config ), - .pop_i ( y_rows_iter_q == y_config.x_rows_iter-1 && y_rows_iter_en ) + .clk_i ( clk_i ), + .rst_ni ( rst_ni ), + .flush_i ( clear_i ), + .testmode_i ( '0 ), + .full_o ( y_config_full ), + .empty_o ( y_config_empty ), + .usage_o ( ), + .data_i ( config_i ), + .push_i ( config_valid_i ), + .data_o ( y_config ), + .pop_i ( y_config_pop ) ); + logic y_config_fast_pop; + assign y_config_fast_pop = y_loads_cnt_q == y_config_fast.tot_stores-1 && y_pushed_q && ~y_config_fast_empty && ~stall_engine; fifo_v3 #( .FALL_THROUGH (0), .DEPTH (2), .dtype (redmule_config_t) ) i_y_config_fast_fifo ( - .clk_i ( clk_i ), - .rst_ni ( rst_ni ), - .flush_i ( clear_i ), - .testmode_i ( '0 ), - .full_o ( y_config_fast_full ), - .empty_o ( y_config_fast_empty ), - .usage_o ( ), - .data_i ( config_i ), - .push_i ( config_valid_i ), - .data_o ( y_config_fast ), - .pop_i ( y_loads_cnt_q == y_config_fast.tot_stores-1 && y_pushed_q && ~stall_engine ) + .clk_i ( clk_i ), + .rst_ni ( rst_ni ), + .flush_i ( clear_i ), + .testmode_i ( '0 ), + .full_o ( y_config_fast_full ), + .empty_o ( y_config_fast_empty ), + .usage_o ( ), + .data_i ( config_i ), + .push_i ( config_valid_i ), + .data_o ( y_config_fast ), + .pop_i ( y_config_fast_pop ) ); always_ff @(posedge clk_i or negedge rst_ni) begin : y_pushed_register