Skip to content

Commit

Permalink
Issues openhwgroup#726 and openhwgroup#729 correction.
Browse files Browse the repository at this point in the history
Signed-off-by: Pascal Gouedo <[email protected]>
  • Loading branch information
Pascal Gouedo committed Aug 16, 2023
1 parent a5378e8 commit fcaaf84
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion rtl/vendor/pulp_platform_fpnew/src/fpnew_fma.sv
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,12 @@ module fpnew_fma #(
);

// Classification after rounding
assign uf_after_round = rounded_abs[EXP_BITS+MAN_BITS-1:MAN_BITS] == '0; // exponent = 0
assign uf_after_round = (rounded_abs[EXP_BITS+MAN_BITS-1:MAN_BITS] == '0) // denormal
|| ((pre_round_abs[EXP_BITS+MAN_BITS-1:MAN_BITS] == '0)
&& (rounded_abs[EXP_BITS+MAN_BITS-1:MAN_BITS] == 1)
&& ((round_sticky_bits != 2'b11)
|| (!sum_sticky_bits[MAN_BITS*2 + 4]
&& ((rnd_mode_i == fpnew_pkg::RNE) || (rnd_mode_i == fpnew_pkg::RMM)))));
assign of_after_round = rounded_abs[EXP_BITS+MAN_BITS-1:MAN_BITS] == '1; // exponent all ones

// -----------------
Expand Down
8 changes: 7 additions & 1 deletion rtl/vendor/pulp_platform_fpnew/src/fpnew_fma_multi.sv
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,13 @@ module fpnew_fma_multi #(
if (FpFmtConfig[fmt]) begin : active_format
always_comb begin : post_process
// detect of / uf
fmt_uf_after_round[fmt] = rounded_abs[EXP_BITS+MAN_BITS-1:MAN_BITS] == '0; // denormal
fmt_uf_after_round[fmt] = (rounded_abs[EXP_BITS+MAN_BITS-1:MAN_BITS] == '0) // denormal
|| ((pre_round_abs[EXP_BITS+MAN_BITS-1:MAN_BITS] == '0)
&& (rounded_abs[EXP_BITS+MAN_BITS-1:MAN_BITS] == 1)
&& ((round_sticky_bits != 2'b11)
|| (!sum_sticky_bits[MAN_BITS*2 + 4]
&& ((rnd_mode_i == fpnew_pkg::RNE)
|| (rnd_mode_i == fpnew_pkg::RMM)))));
fmt_of_after_round[fmt] = rounded_abs[EXP_BITS+MAN_BITS-1:MAN_BITS] == '1; // inf exp.

// Assemble regular result, nan box short ones.
Expand Down

0 comments on commit fcaaf84

Please sign in to comment.