Skip to content

Commit 30dca89

Browse files
author
Maurus Item
committed
Added time based redundancy modules and switched to lockable RR-Arbiter.
- New input signal redundancy_enable_i to switch in between redundant and non-redundant modes. - New output signal fault_detected_o for statistics - Redundancy Implementation selected via Enum in fpnew_pkg. - For TMR based redundancy use a large ID, for DMR base use a small ID and stall for divisions
1 parent 81b3083 commit 30dca89

File tree

3 files changed

+459
-62
lines changed

3 files changed

+459
-62
lines changed

src/fpnew_opgroup_block.sv

+3-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ module fpnew_opgroup_block #(
6161
// Output handshake
6262
output logic out_valid_o,
6363
input logic out_ready_i,
64+
input logic out_lock_i,
6465
// Indication of valid data in flight
6566
output logic busy_o
6667
);
@@ -223,7 +224,7 @@ module fpnew_opgroup_block #(
223224
output_t arbiter_output;
224225

225226
// Round-Robin arbiter to decide which result to use
226-
rr_arb_tree #(
227+
rr_arb_tree_lock #(
227228
.NumIn ( NUM_FORMATS ),
228229
.DataType ( output_t ),
229230
.AxiVldRdy ( 1'b1 )
@@ -232,6 +233,7 @@ module fpnew_opgroup_block #(
232233
.rst_ni,
233234
.flush_i,
234235
.rr_i ( '0 ),
236+
.lock_rr_i ( out_lock_i ),
235237
.req_i ( fmt_out_valid ),
236238
.gnt_o ( fmt_out_ready ),
237239
.data_i ( fmt_outputs ),

src/fpnew_pkg.sv

+51
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,31 @@ package fpnew_pkg;
325325
LfsrInternalPrecision: 32
326326
};
327327

328+
// Different kinds of Redundancy that might be used
329+
typedef enum logic [2:0] {
330+
NONE, // No redundancy module is generated - redundancy can not be enabled
331+
TMR_FAST, // Operands will be tripplicated in time - if nothing goes wrong output after 2 cycles (longer critical path)
332+
TMR_SMALL, // Operands will be tripplicated in time - always output after 3 cycles (shorter critical path)
333+
DMR, // Operands will be duplicated in time and are retried on failure
334+
DMR_INORDER // Operands will be duplicated in time and are retried on failure - always keeps the order of outputs the same
335+
} redundancy_type_t;
336+
337+
// FPU configuration: redundancy
338+
typedef struct packed {
339+
logic TripplicateRepetition; // Whether to tripplicate the state machines for redundant operations
340+
redundancy_type_t RedundancyType;
341+
} redundancy_features_t;
342+
343+
localparam redundancy_features_t DEFAULT_NO_REDUNDANCY = '{
344+
TripplicateRepetition: 1'b0,
345+
RedundancyType: NONE
346+
};
347+
348+
localparam redundancy_features_t DEFAULT_REDUNDANCY = '{
349+
TripplicateRepetition: 1'b1,
350+
RedundancyType: TMR_FAST
351+
};
352+
328353
// -----------------------
329354
// Synthesis optimization
330355
// -----------------------
@@ -589,4 +614,30 @@ package fpnew_pkg;
589614
return res;
590615
endfunction
591616

617+
// Returns the number data elements in the longest path of the FPU
618+
function automatic int unsigned longest_path(fmt_unsigned_t regs, fmt_logic_t cfg);
619+
automatic int unsigned res = 0;
620+
for (int unsigned i = 0; i < NUM_FP_FORMATS; i++) begin
621+
if (cfg[i]) res = maximum(res, regs[i]);
622+
end
623+
return res + 1;
624+
endfunction
625+
626+
// Returns the number data elements in the shortest path of the FPU
627+
function automatic int unsigned shortest_path(fmt_unsigned_t regs, fmt_logic_t cfg);
628+
automatic int unsigned res = 0;
629+
for (int unsigned i = 0; i < NUM_FP_FORMATS; i++) begin
630+
if (cfg[i]) res = minimum(res, regs[i]);
631+
end
632+
return res + 1;
633+
endfunction
634+
635+
// Return whether any active format is set as MERGED
636+
function automatic logic division_enabled(opgrp_fmt_unit_types_t unit_types);
637+
for (int unsigned i = 0; i < NUM_FP_FORMATS; i++) begin
638+
if (unit_types[DIVSQRT][i] != DISABLED) return 1'b1;
639+
end
640+
return 1'b0;
641+
endfunction
642+
592643
endpackage

0 commit comments

Comments
 (0)