From: Luke Kenneth Casson Leighton Date: Wed, 20 Feb 2019 00:45:56 +0000 (+0000) Subject: store roundz test in comb variable X-Git-Tag: ls180-24jan2020~1862 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=606bf9eb6eba1ff0cbb2afcaa0a3d05c07f43bf2;p=ieee754fpu.git store roundz test in comb variable --- diff --git a/src/add/fpbase.py b/src/add/fpbase.py index 1da10b02..ee8857c8 100644 --- a/src/add/fpbase.py +++ b/src/add/fpbase.py @@ -308,7 +308,9 @@ class FPBase: """ performs rounding on the output. TODO: different kinds of rounding """ m.next = next_state - with m.If(of.guard & (of.round_bit | of.sticky | z.m[0])): + roundz = Signal(reset_less=True) + m.d.comb += roundz.eq(of.guard & (of.round_bit | of.sticky | z.m[0])) + with m.If(roundz): m.d.sync += z.m.eq(z.m + 1) # mantissa rounds up with m.If(z.m == z.m1s): # all 1s m.d.sync += z.e.eq(z.e + 1) # exponent rounds up