clarify if else
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 7 Jul 2019 15:57:19 +0000 (16:57 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 7 Jul 2019 15:57:19 +0000 (16:57 +0100)
src/ieee754/div_rem_sqrt_rsqrt/core.py

index 245cd1c6cd426604d98ac5890b55bacca0c1695a..f87077df4e7adaede929c9ed331053b29cddcbc2 100644 (file)
@@ -357,7 +357,7 @@ class DivPipeCoreCalculateStage(Elaboratable):
         next_compare_rhs = Signal(radix, reset_less=True)
         l = []
         for i in range(radix):
-            next_flag = pass_flags[i + 1] if i + 1 < radix else 0
+            next_flag = pass_flags[i + 1] if (i + 1 < radix) else Const(0)
             flag = Signal(reset_less=True, name=f"flag{i}")
             test = Signal(reset_less=True, name=f"test{i}")
             # XXX TODO: check the width on this