@@ -114,29 +114,57 @@ localparam hci_size_parameter_t `HCI_SIZE_PARAM(no_ecc_tcdm) = '{
114114 EHW : DEFAULT_EHW
115115} ;
116116
117+ /* ************************** Store Channel: Serial Detection ****************************/
118+ /* In redundant modes, every element is fetched and stored twice, after the whole *
119+ * it arrives here and we check that the two elements still are the same. *
120+ * this overlapps with the full replication of the data in fully redundant modes, which *
121+ * then overlapps with ECC encode / decode */
122+
123+ if (SERIAL_REPLICATION ) begin : gen_serial_fault_detection
124+ logic [DW - 1 : 0 ] data_out_d, data_out_q;
125+ logic same_d, same_q;
126+ logic data_transmitted;
127+
128+ assign data_transmitted = tcdm.req && tcdm.gnt && ! tcdm.wen;
129+ assign data_out_d[DW - 1 : 0 ] = tcdm.data;
130+
131+ `FFL (data_out_q, data_out_d, data_transmitted, '0 );
132+
133+ assign same_d = data_out_d == data_out_q;
134+
135+ `FFL (same_q, same_d, data_transmitted, '1 );
136+
137+ assign serial_fault_o = ~ same_d && ~ same_q && data_transmitted;
138+ end else begin : gen_no_serial_fault_detection
139+ assign serial_fault_o = 1'b0 ;
140+ // Since we want to be able to have a configuration where only serial detection is done
141+ // We default to 0 here (Otherwise disabled redundancy -> assert fault for safety).
142+ end
143+
144+ // TODO: Add Load / Store deduplication here
145+
117146/* ************************************* ECC Stage **************************************/
118147/* If the interface from the cores has data ECC, we decode it here. All further error *
119148 * protection is in time or with parity bits */
120149
121150`HCI_INTF_EXPLICIT_WAIVE_ARRAY (ldst_tcdm, clk_i, 0 : 0 , no_ecc_tcdm);
122- errs_streamer_t ecc_errors;
123151
124152if (EW > 1 ) begin : gen_ecc_decode
125153 hci_ecc_enc # (
126154 .DW ( DW ),
127155 .`HCI_SIZE_PARAM (tcdm_target) ( `HCI_SIZE_PARAM (no_ecc_tcdm) ),
128156 .`HCI_SIZE_PARAM (tcdm_initiator) ( `HCI_SIZE_PARAM (tcdm) )
129157 ) i_ecc_enc (
130- .r_data_single_err_o ( ecc_errors .data_single_err ),
131- .r_data_multi_err_o ( ecc_errors .data_multi_err ),
132- .r_meta_single_err_o ( ecc_errors .meta_single_err ),
133- .r_meta_multi_err_o ( ecc_errors .meta_multi_err ),
134- .tcdm_target ( ldst_tcdm[0 ] ),
135- .tcdm_initiator ( tcdm )
158+ .r_data_single_err_o ( ecc_errors_o .data_single_err ),
159+ .r_data_multi_err_o ( ecc_errors_o .data_multi_err ),
160+ .r_meta_single_err_o ( ecc_errors_o .meta_single_err ),
161+ .r_meta_multi_err_o ( ecc_errors_o .meta_multi_err ),
162+ .tcdm_target ( ldst_tcdm[0 ] ),
163+ .tcdm_initiator ( tcdm )
136164 );
137165end else begin : gen_ecc_passthrough
138166 hci_core_assign i_ldst_assign ( .tcdm_target (ldst_tcdm [0 ]), .tcdm_initiator (tcdm) );
139- assign ecc_errors = '0 ;
167+ assign ecc_errors_o = '0 ;
140168end
141169
142170/* ******************************** Load / Store MUX *************************************/
@@ -182,35 +210,6 @@ redmule_streamout #(
182210 .flags_o ( flags_o[0 ].z_stream_sink_flags )
183211);
184212
185- /* ************************** Store Channel: Serial Detection ****************************/
186- /* In redundant modes, every element is fetched and stored twice, after the whole *
187- * it arrives here and we check that the two elements still are the same. *
188- * this overlapps with the full replication of the data in fully redundant modes, which *
189- * then overlapps with ECC encode / decode */
190-
191- // TODO: Make sure compiler can not move modules and place this before the split
192-
193- if (SERIAL_REPLICATION ) begin : gen_serial_fault_detection
194- logic [DW - 1 : 0 ] data_out_d, data_out_q;
195- logic same_d, same_q;
196- logic data_transmitted;
197-
198- assign data_transmitted = virt_tcdm[1 ].req && virt_tcdm[1 ].gnt;
199- assign data_out_d[DW - 1 : 0 ] = virt_tcdm[1 ].data;
200-
201- `FFL (data_out_q, data_out_d, data_transmitted, '0 );
202-
203- assign same_d = data_out_d == data_out_q;
204-
205- `FFL (same_q, same_d, data_transmitted, '1 );
206-
207- assign serial_fault_o = ~ same_d && ~ same_q && data_transmitted;
208- end else begin : gen_no_serial_fault_detection
209- assign serial_fault_o = 1'b0 ;
210- // Since we want to be able to have a configuration where only serial detection is done
211- // We default to 0 here (Otherwise disabled redundancy -> assert fault for safety).
212- end
213-
214213/* *************************************** Load Channel ****************************************/
215214/* The load channel of the streamer connects the incoming TCDM interface to three different *
216215 * stream interfaces: X stream (ID: 0), W stream (ID: 1), and Y stream (ID: 2). The load side *
@@ -307,7 +306,8 @@ if (REP > 1) begin: gen_streamer_ld_replica
307306
308307 logic interface_hci_fault;
309308 hci_copy_sink # (
310- .COPY_TYPE ( hci_package :: COPY )
309+ .COPY_TYPE ( hci_package :: NO_ECC ),
310+ .COMPARE_TYPE ( hci_package :: CTRL_ONLY )
311311 ) i_hci_copy_sink (
312312 .clk_i,
313313 .rst_ni,
@@ -318,27 +318,10 @@ if (REP > 1) begin: gen_streamer_ld_replica
318318
319319 // //////////////////////////////////////////////////////////////////////////////////
320320 // ECC Encode / Decode
321+ // We don not need to do anything in the replica as we do not hold data
321322
322323 `HCI_INTF_EXPLICIT_WAIVE_ARRAY (ldst_tcdm_replica, clk_i, 0 : 0 , no_ecc_tcdm);
323- errs_streamer_t ecc_errors_replica;
324-
325- if (EW > 1 ) begin : gen_ecc_decode
326- hci_ecc_enc # (
327- .DW ( DW ),
328- .`HCI_SIZE_PARAM (tcdm_target) ( `HCI_SIZE_PARAM (no_ecc_tcdm) ),
329- .`HCI_SIZE_PARAM (tcdm_initiator) ( `HCI_SIZE_PARAM (tcdm) )
330- ) i_ecc_enc (
331- .r_data_single_err_o ( ecc_errors_replica.data_single_err ),
332- .r_data_multi_err_o ( ecc_errors_replica.data_multi_err ),
333- .r_meta_single_err_o ( ecc_errors_replica.meta_single_err ),
334- .r_meta_multi_err_o ( ecc_errors_replica.meta_multi_err ),
335- .tcdm_target ( ldst_tcdm_replica[0 ] ),
336- .tcdm_initiator ( tcdm_replica )
337- );
338- end else begin : gen_ecc_passthrough
339- hci_core_assign i_ldst_assign ( .tcdm_target (ldst_tcdm_replica[0 ]), .tcdm_initiator (tcdm_replica) );
340- assign ecc_errors_replica = '0 ;
341- end
324+ hci_core_assign i_ldst_assign ( .tcdm_target (ldst_tcdm_replica[0 ]), .tcdm_initiator (tcdm_replica) );
342325
343326 // //////////////////////////////////////////////////////////////////////////////////
344327 // Load / Store MUX Replica
@@ -382,36 +365,10 @@ if (REP > 1) begin: gen_streamer_ld_replica
382365 .cast_i ( cast[1 ] ),
383366 .dst_fmt_i ( ctrl_i[1 ].output_cast_dst_fmt ),
384367 .stream_i ( z_stream_i_replica ),
385- .source ( virt_tcdm_ctrl_only ),
368+ .source ( virt_tcdm_replica[ 1 ] ),
386369 .flags_o ( flags_o[1 ].z_stream_sink_flags )
387370 );
388371
389- // //////////////////////////////////////////////////////////////////////////////////
390- // Store Channel Data Duplication
391- // Since we do not propperly cast in replica, use data from main
392- // It is protected temporally anyway. The rest we use from our replica.
393- logic z_hci_down_fault, z_hci_up_fault;
394-
395- hci_copy_source # (
396- .COPY_TYPE ( hci_package :: NO_ECC )
397- ) i_z_hci_copy_source (
398- .clk_i,
399- .rst_ni,
400- .tcdm_main ( virt_tcdm[1 ] ),
401- .tcdm_copy ( virt_tcdm_replica[1 ] ),
402- .fault_o ( z_hci_up_fault )
403- );
404-
405- hci_copy_sink # (
406- .COPY_TYPE ( hci_package :: CTRL_ONLY )
407- ) i_z_hci_copy_sink (
408- .clk_i,
409- .rst_ni,
410- .tcdm_main ( virt_tcdm_replica[1 ] ),
411- .tcdm_copy ( virt_tcdm_ctrl_only ),
412- .fault_o ( z_hci_down_fault )
413- );
414-
415372 // //////////////////////////////////////////////////////////////////////////////////
416373 // Load Channel Replica
417374
@@ -512,12 +469,10 @@ if (REP > 1) begin: gen_streamer_ld_replica
512469 logic flags_fault;
513470 assign flags_fault = flags_o[0 ] != flags_o[1 ];
514471
515- assign parallel_fault_o = w_hci_fault | w_stream_fault | interface_hci_fault | flags_fault | z_hci_down_fault | z_hci_up_fault;
516- assign ecc_errors_o = ecc_errors | ecc_errors_replica;
472+ assign parallel_fault_o = w_hci_fault | w_stream_fault | interface_hci_fault | flags_fault;
517473
518474end else begin
519475 assign parallel_fault_o = 1'b0 ;
520- assign ecc_errors_o = ecc_errors;
521476end
522477
523478endmodule : redmule_streamer
0 commit comments