From b9317e7cd38c01a37c0e562afa7a963cde343662 Mon Sep 17 00:00:00 2001 From: Corey Hickson Date: Wed, 30 Oct 2024 03:28:58 -0700 Subject: [PATCH] Fixed fround bug --- src/fpu/fround.sv | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fpu/fround.sv b/src/fpu/fround.sv index 3265ec626..fadd963d0 100644 --- a/src/fpu/fround.sv +++ b/src/fpu/fround.sv @@ -76,7 +76,8 @@ module fround import cvw::*; #(parameter cvw_t P) ( assign Eeqm1 = ($signed(E) == -1); // Logic for nonnegative mask and rounding bits - assign IMask = {1'b1, {P.NF{1'b0}}} >>> E; /// if E > Nf, this produces all 0s instead of all 1s. Hence exact handling is needed below. + // assign IMask = {1'b1, {P.NF{1'b0}}} >>> E; /// if E > Nf, this produces all 0s instead of all 1s. Hence exact handling is needed below. + assign IMask = $signed({1'b1, {P.NF{1'b0}}}) >>> E; assign Tmasknonneg = ~IMask >>> 1'b1; assign HotE = IMask & ~(IMask << 1'b1); assign HotEP1 = HotE >> 1'b1;