Skip to content

Commit

Permalink
Added time based redundancy modules and switched to lockable RR-Arbiter.
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
Maurus Item committed Jun 14, 2024
1 parent 81b3083 commit 30dca89
Show file tree
Hide file tree
Showing 3 changed files with 459 additions and 62 deletions.
4 changes: 3 additions & 1 deletion src/fpnew_opgroup_block.sv
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ module fpnew_opgroup_block #(
// Output handshake
output logic out_valid_o,
input logic out_ready_i,
input logic out_lock_i,
// Indication of valid data in flight
output logic busy_o
);
Expand Down Expand Up @@ -223,7 +224,7 @@ module fpnew_opgroup_block #(
output_t arbiter_output;

// Round-Robin arbiter to decide which result to use
rr_arb_tree #(
rr_arb_tree_lock #(
.NumIn ( NUM_FORMATS ),
.DataType ( output_t ),
.AxiVldRdy ( 1'b1 )
Expand All @@ -232,6 +233,7 @@ module fpnew_opgroup_block #(
.rst_ni,
.flush_i,
.rr_i ( '0 ),
.lock_rr_i ( out_lock_i ),
.req_i ( fmt_out_valid ),
.gnt_o ( fmt_out_ready ),
.data_i ( fmt_outputs ),
Expand Down
51 changes: 51 additions & 0 deletions src/fpnew_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,31 @@ package fpnew_pkg;
LfsrInternalPrecision: 32
};

// Different kinds of Redundancy that might be used
typedef enum logic [2:0] {
NONE, // No redundancy module is generated - redundancy can not be enabled
TMR_FAST, // Operands will be tripplicated in time - if nothing goes wrong output after 2 cycles (longer critical path)
TMR_SMALL, // Operands will be tripplicated in time - always output after 3 cycles (shorter critical path)
DMR, // Operands will be duplicated in time and are retried on failure
DMR_INORDER // Operands will be duplicated in time and are retried on failure - always keeps the order of outputs the same
} redundancy_type_t;

// FPU configuration: redundancy
typedef struct packed {
logic TripplicateRepetition; // Whether to tripplicate the state machines for redundant operations
redundancy_type_t RedundancyType;
} redundancy_features_t;

localparam redundancy_features_t DEFAULT_NO_REDUNDANCY = '{
TripplicateRepetition: 1'b0,
RedundancyType: NONE
};

localparam redundancy_features_t DEFAULT_REDUNDANCY = '{
TripplicateRepetition: 1'b1,
RedundancyType: TMR_FAST
};

// -----------------------
// Synthesis optimization
// -----------------------
Expand Down Expand Up @@ -589,4 +614,30 @@ package fpnew_pkg;
return res;
endfunction

// Returns the number data elements in the longest path of the FPU
function automatic int unsigned longest_path(fmt_unsigned_t regs, fmt_logic_t cfg);
automatic int unsigned res = 0;
for (int unsigned i = 0; i < NUM_FP_FORMATS; i++) begin
if (cfg[i]) res = maximum(res, regs[i]);
end
return res + 1;
endfunction

// Returns the number data elements in the shortest path of the FPU
function automatic int unsigned shortest_path(fmt_unsigned_t regs, fmt_logic_t cfg);
automatic int unsigned res = 0;
for (int unsigned i = 0; i < NUM_FP_FORMATS; i++) begin
if (cfg[i]) res = minimum(res, regs[i]);
end
return res + 1;
endfunction

// Return whether any active format is set as MERGED
function automatic logic division_enabled(opgrp_fmt_unit_types_t unit_types);
for (int unsigned i = 0; i < NUM_FP_FORMATS; i++) begin
if (unit_types[DIVSQRT][i] != DISABLED) return 1'b1;
end
return 1'b0;
endfunction

endpackage
Loading

0 comments on commit 30dca89

Please sign in to comment.