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

renamed modules
  • Loading branch information
Maurus Item committed Sep 3, 2024
1 parent 19ec5ed commit 4515020
Show file tree
Hide file tree
Showing 3 changed files with 503 additions and 78 deletions.
15 changes: 12 additions & 3 deletions src/fpnew_opgroup_block.sv
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ module fpnew_opgroup_block #(
parameter logic TrueSIMDClass = 1'b0,
parameter logic CompressedVecCmpResult = 1'b0,
parameter fpnew_pkg::rsr_impl_t StochasticRndImplementation = fpnew_pkg::DEFAULT_NO_RSR,
parameter int unsigned LockRepetition = 1,
// Do not change
localparam int unsigned NUM_FORMATS = fpnew_pkg::NUM_FP_FORMATS,
localparam int unsigned NUM_OPERANDS = fpnew_pkg::num_operands(OpGroup),
Expand Down Expand Up @@ -61,6 +62,7 @@ module fpnew_opgroup_block #(
// Output handshake
output logic out_valid_o,
input logic out_ready_i,
input logic [LockRepetition-1:0] out_lock_i,
// Indication of valid data in flight
output logic busy_o
);
Expand Down Expand Up @@ -222,16 +224,23 @@ module fpnew_opgroup_block #(
// ------------------
output_t arbiter_output;

logic [LockRepetition-1:0] flush;
for (genvar r = 0; r < LockRepetition; r++) begin: gen_rr_flush
assign flush[r] = flush_i;
end

// 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 )
.AxiVldRdy ( 1'b1 ),
.InternalRedundancy ( LockRepetition > 1 )
) i_arbiter (
.clk_i,
.rst_ni,
.flush_i,
.flush_i ( flush ),
.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
52 changes: 52 additions & 0 deletions src/fpnew_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,32 @@ 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
TTR, // Operands will be tripplicated in time - always output after 3 cycles (shorter critical path)
TTR_FAST, // Operands will be tripplicated in time - if nothing goes wrong output after 2 cycles (longer critical path)
TTR_SMALL, // Operands will be tripplicated in time, storage is deferred to handshake (might cause stalls)
DTR, // Operands will be duplicated in time and are retried on failure
DTR_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: TTR_FAST
};

// -----------------------
// Synthesis optimization
// -----------------------
Expand Down Expand Up @@ -589,4 +615,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 4515020

Please sign in to comment.