From 606bf9eb6eba1ff0cbb2afcaa0a3d05c07f43bf2 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 20 Feb 2019 00:45:56 +0000 Subject: [PATCH] store roundz test in comb variable --- src/add/fpbase.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- 2.30.2