mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
Fixed shiftcorrection typo causing failure on testfloat fcvt tests
This commit is contained in:
parent
9d4a3d7d05
commit
fcd75fd6b6
@ -61,6 +61,7 @@ module shiftcorrection import cvw::*; #(parameter cvw_t P) (
|
|||||||
// - a one has to propagate all the way through a sum. so we can leave the bottom statement alone
|
// - a one has to propagate all the way through a sum. so we can leave the bottom statement alone
|
||||||
assign LZAPlus1 = Shifted[P.NORMSHIFTSZ-1];
|
assign LZAPlus1 = Shifted[P.NORMSHIFTSZ-1];
|
||||||
|
|
||||||
|
|
||||||
// correct the shifting of the divsqrt caused by producing a result in (0.5, 2) range
|
// correct the shifting of the divsqrt caused by producing a result in (0.5, 2) range
|
||||||
// condition: if the msb is 1 or the exponent was one, but the shifted quotent was < 1 (Subnorm)
|
// condition: if the msb is 1 or the exponent was one, but the shifted quotent was < 1 (Subnorm)
|
||||||
assign LeftShiftQm = (LZAPlus1|(DivUe==1&~LZAPlus1));
|
assign LeftShiftQm = (LZAPlus1|(DivUe==1&~LZAPlus1));
|
||||||
@ -72,7 +73,7 @@ module shiftcorrection import cvw::*; #(parameter cvw_t P) (
|
|||||||
|
|
||||||
// if the result of the divider was calculated to be subnormal, then the result was correctly normalized, so select the top shifted bits
|
// if the result of the divider was calculated to be subnormal, then the result was correctly normalized, so select the top shifted bits
|
||||||
always_comb
|
always_comb
|
||||||
if (FmaOp | DivOp & !DivResSubnorm) Mf = CorrShifted;
|
if (FmaOp | (DivOp & ~DivResSubnorm)) Mf = CorrShifted;
|
||||||
else Mf = Shifted[P.NORMSHIFTSZ-1:2];
|
else Mf = Shifted[P.NORMSHIFTSZ-1:2];
|
||||||
|
|
||||||
// Determine sum's exponent
|
// Determine sum's exponent
|
||||||
@ -92,3 +93,4 @@ module shiftcorrection import cvw::*; #(parameter cvw_t P) (
|
|||||||
// if the quotent < 1 and not Subnormal then subtract 1 to account for the normalization shift
|
// if the quotent < 1 and not Subnormal then subtract 1 to account for the normalization shift
|
||||||
assign Ue = (DivResSubnorm & DivSubnormShiftPos) ? 0 : DivUe - {(P.NE+1)'(0), ~LZAPlus1};
|
assign Ue = (DivResSubnorm & DivSubnormShiftPos) ? 0 : DivUe - {(P.NE+1)'(0), ~LZAPlus1};
|
||||||
endmodule
|
endmodule
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user