add explicit operator comparison (in case operation enum is changed)
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 29 Jul 2019 20:38:13 +0000 (21:38 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 29 Jul 2019 20:38:13 +0000 (21:38 +0100)
src/ieee754/div_rem_sqrt_rsqrt/core.py

index 1cf76b1d18628f3029feed8c61e7d885dc4aefd1..8d5e160257d0821a051feb6bb945fb45ffe6fcfe 100644 (file)
@@ -251,7 +251,7 @@ class DivPipeCoreSetupStage(Elaboratable):
             comb += lhs.eq(self.i.dividend << fw)
         with m.Elif(self.i.operation == int(DP.SqrtRem)):
             comb += lhs.eq(self.i.divisor_radicand << (fw * 2))
-        with m.Else():  # DivPipeCoreOperation.RSqrtRem
+        with m.Elif(self.i.operation == int(DP.RSqrtRem)):
             comb += lhs.eq(1 << (fw * 3))
 
         comb += self.o.compare_lhs.eq(lhs)
@@ -324,7 +324,7 @@ class Trial(Elaboratable):
             comb += self.trial_compare_rhs.eq(sqrt_rhs)
 
         # RSqrtRem
-        with m.Else():
+        with m.Elif(self.operation == int(DP.RSqrtRem)):
             rr_times_trial_bits = Signal((tblen+1)*3, reset_less=True)
             comb += rr_times_trial_bits.eq(rr * trial_bits_sig)
             rsqrt_rhs = self.compare_rhs