diff --git a/Bender.yml b/Bender.yml index f41db9b1..40d19da7 100644 --- a/Bender.yml +++ b/Bender.yml @@ -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: "git@github.com:Lynx005F/redundancy_cells.git", rev: d1bc37491a9ca17383ded5c17eb2f40a6e42674a} + redundancy_cells: { git: "git@github.com:Lynx005F/redundancy_cells.git", rev: 68e741c2628db25825d0545de7f13fc0366e3854} sources: - src/fpnew_pkg.sv diff --git a/src/fpnew_pkg.sv b/src/fpnew_pkg.sv index a59ac86a..af6b8fda 100644 --- a/src/fpnew_pkg.sv +++ b/src/fpnew_pkg.sv @@ -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 diff --git a/src/fpnew_top.sv b/src/fpnew_top.sv index c77ad34a..b191abd5 100644 --- a/src/fpnew_top.sv +++ b/src/fpnew_top.sv @@ -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 ); @@ -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; @@ -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, @@ -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, @@ -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 ),