Skip to content

Commit

Permalink
Add pipe regs to cut critical paths
Browse files Browse the repository at this point in the history
  • Loading branch information
LuigiGhionda committed Jun 25, 2024
1 parent 8bf6408 commit eee3bd2
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions rtl/tcdm_banks_wrap.sv
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ for(genvar i=0; i<NbBanks; i++) begin : banks_gen
localparam int unsigned AWS = HCI_MEM_SIZE.AW;
localparam int unsigned UWS = HCI_MEM_SIZE.UW;

logic ecc_single_error_d, ecc_single_error_q;
logic ecc_multiple_error_d, ecc_multiple_error_q;

// tie r_valid to '1, as HCI interconnect will generate this anyways
assign tcdm_slave_dec.r_valid = '1;

Expand All @@ -85,18 +88,31 @@ for(genvar i=0; i<NbBanks; i++) begin : banks_gen
);

hci_ecc_dec #(
.DW ( DataWidth ),
.`HCI_SIZE_PARAM(tcdm_target) ( HCI_MEM_SIZE ),
.EnableData ( 0 )
.DW ( DataWidth ),
.`HCI_SIZE_PARAM(tcdm_target) ( HCI_MEM_SIZE ),
.EnableData ( 0 )
) i_ecc_dec_meta (
.data_single_err_o ( ),
.data_multi_err_o ( ),
.meta_single_err_o ( ecc_single_error_o[i] ),
.meta_multi_err_o ( ecc_multiple_error_o[i] ),
.tcdm_target ( tcdm_slave[i] ),
.tcdm_initiator ( tcdm_slave_dec )
.meta_single_err_o ( ecc_single_error_d ),
.meta_multi_err_o ( ecc_multiple_error_d ),
.tcdm_target ( tcdm_slave[i] ),
.tcdm_initiator ( tcdm_slave_dec )
);

always_ff @(posedge clk_i or negedge rst_ni) begin : ecc_error_pipe
if(~rst_ni) begin
ecc_single_error_q <= '0;
ecc_multiple_error_q <= '0;
end else begin
ecc_single_error_q <= ecc_single_error_d;
ecc_multiple_error_q <= ecc_multiple_error_d;
end
end

assign ecc_single_error_o[i] = ecc_single_error_q;
assign ecc_multiple_error_o[i] = ecc_multiple_error_q;

// ecc_sram_wrap assumes a 32-bit address
logic [31:0] tcdm_slave_dec_add_unroll;
assign tcdm_slave_dec_add_unroll = 32'b0 | tcdm_slave_dec.add;
Expand Down

0 comments on commit eee3bd2

Please sign in to comment.