X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fadd%2Ffpbase.py;fp=src%2Fadd%2Ffpbase.py;h=bd20364992273638287b6aa9ad16e09eb79d4951;hb=9b9732e1c96d085bc9c7b696e7c86dd0c4a4ae49;hp=aaf263e89dd95e5c3c1ff182fb21352a58825995;hpb=38452d7fb64752a897b26e1da96a27d3a5979a76;p=ieee754fpu.git diff --git a/src/add/fpbase.py b/src/add/fpbase.py index aaf263e8..bd203649 100644 --- a/src/add/fpbase.py +++ b/src/add/fpbase.py @@ -561,11 +561,11 @@ class FPBase: def roundz(self, m, z, out_z, roundz): """ performs rounding on the output. TODO: different kinds of rounding """ - m.d.comb += out_z.copy(z) # copies input to output first + #m.d.comb += out_z.copy(z) # copies input to output first with m.If(roundz): - m.d.comb += out_z.m.eq(z.m + 1) # mantissa rounds up + m.d.sync += out_z.m.eq(z.m + 1) # mantissa rounds up with m.If(z.m == z.m1s): # all 1s - m.d.comb += out_z.e.eq(z.e + 1) # exponent rounds up + m.d.sync += out_z.e.eq(z.e + 1) # exponent rounds up def corrections(self, m, z, next_state): """ denormalisation and sign-bug corrections