Skip to content

Commit

Permalink
Updated Redundancy Cells dependency and used new features.
Browse files Browse the repository at this point in the history
  • Loading branch information
Maurus Item committed Jul 30, 2024
1 parent ee895d3 commit ce009bc
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Bender.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package:
dependencies:
common_cells: {git: "https://github.com/pulp-platform/common_cells.git", version: 1.21.0}
fpu_div_sqrt_mvp: {git: "https://github.com/pulp-platform/fpu_div_sqrt_mvp.git", version: 1.0.4}
redundancy_cells: { git: "[email protected]:Lynx005F/redundancy_cells.git", rev: d1bc37491a9ca17383ded5c17eb2f40a6e42674a}
redundancy_cells: { git: "[email protected]:Lynx005F/redundancy_cells.git", rev: 68e741c2628db25825d0545de7f13fc0366e3854}

sources:
- src/fpnew_pkg.sv
Expand Down
11 changes: 6 additions & 5 deletions src/fpnew_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,12 @@ package fpnew_pkg;

// 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
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
TMR_TINY // Operands will be tripplicated in time, storage is deferred to handshake (might cause stalls)
} redundancy_type_t;

// FPU configuration: redundancy
Expand Down
37 changes: 28 additions & 9 deletions src/fpnew_top.sv
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,13 @@ module fpnew_top #(
$clog2(MAX_DELAY) +
// In case of a TMR approach we add extra ID Bits for the Division since it can take up to 12 cycles
// For DMR this is not needed as we stall the unit instead
((RedundancyFeatures.RedundancyType == fpnew_pkg::TMR_FAST || RedundancyFeatures.RedundancyType == fpnew_pkg::TMR_SMALL)
&& fpnew_pkg::division_enabled(Implementation.UnitTypes)
(
(
RedundancyFeatures.RedundancyType == fpnew_pkg::TMR_FAST ||
RedundancyFeatures.RedundancyType == fpnew_pkg::TMR_SMALL ||
RedundancyFeatures.RedundancyType == fpnew_pkg::TMR_TINY
) &&
fpnew_pkg::division_enabled(Implementation.UnitTypes)
) ? 4 : 0
);

Expand Down Expand Up @@ -162,7 +167,11 @@ module fpnew_top #(
// Stall Handshake when a division is going on and DMR is enabled
logic division_stall;

if (RedundancyFeatures.RedundancyType == fpnew_pkg::TMR_FAST || RedundancyFeatures.RedundancyType == fpnew_pkg::TMR_SMALL) begin: gen_no_division_stall
if (
RedundancyFeatures.RedundancyType == fpnew_pkg::TMR_FAST ||
RedundancyFeatures.RedundancyType == fpnew_pkg::TMR_SMALL ||
RedundancyFeatures.RedundancyType == fpnew_pkg::TMR_TINY
) begin: gen_no_division_stall
assign division_stall = 0;
end else begin: gen_division_stall
logic division_busy_q;
Expand Down Expand Up @@ -206,11 +215,16 @@ module fpnew_top #(
assign retry_ready = fpnew_pkg::DONT_CARE;
assign retry_replacement_id = fpnew_pkg::DONT_CARE;

end else if (RedundancyFeatures.RedundancyType == fpnew_pkg::TMR_FAST || RedundancyFeatures.RedundancyType == fpnew_pkg::TMR_SMALL) begin: gen_in_tmr
end else if (
RedundancyFeatures.RedundancyType == fpnew_pkg::TMR_FAST ||
RedundancyFeatures.RedundancyType == fpnew_pkg::TMR_SMALL ||
RedundancyFeatures.RedundancyType == fpnew_pkg::TMR_TINY
) begin: gen_in_tmr
time_TMR_start #(
.DataType ( tmr_in_stacked_t ),
.IDSize ( ID_SIZE ),
.InternalRedundancy ( RedundancyFeatures.TripplicateRepetition )
.DataType ( tmr_in_stacked_t ),
.IDSize ( ID_SIZE ),
.InternalRedundancy ( RedundancyFeatures.TripplicateRepetition ),
.EarlyReadyEnable ( (RedundancyFeatures.RedundancyType != fpnew_pkg::TMR_TINY) ? 1 : 0 )
) i_time_TMR_start (
.clk_i,
.rst_ni,
Expand Down Expand Up @@ -274,7 +288,8 @@ module fpnew_top #(
.DataType ( tmr_in_stacked_t ),
.IDSize ( ID_SIZE ),
.InternalRedundancy ( RedundancyFeatures.TripplicateRepetition ),
.UseExternalId ( 1 )
.UseExternalId ( 1 ),
.EarlyReadyEnable ( 1 ) // Low area overhead, always enable (If retry gets it as feature remove here)
) i_time_DMR_start (
.clk_i,
.rst_ni,
Expand Down Expand Up @@ -439,7 +454,11 @@ module fpnew_top #(
assign retry_valid = fpnew_pkg::DONT_CARE;
assign retry_lock = fpnew_pkg::DONT_CARE;

end else if (RedundancyFeatures.RedundancyType == fpnew_pkg::TMR_FAST || RedundancyFeatures.RedundancyType == fpnew_pkg::TMR_SMALL) begin : gen_out_tmr
end else if (
RedundancyFeatures.RedundancyType == fpnew_pkg::TMR_FAST ||
RedundancyFeatures.RedundancyType == fpnew_pkg::TMR_SMALL ||
RedundancyFeatures.RedundancyType == fpnew_pkg::TMR_TINY
) begin : gen_out_tmr
time_TMR_end #(
.DataType ( tmr_out_stacked_t ),
.LockTimeout ( LOCK_TIMEOUT ),
Expand Down

0 comments on commit ce009bc

Please sign in to comment.