remove a_s/b_s/z_s
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 14 Feb 2019 11:09:59 +0000 (11:09 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 14 Feb 2019 11:09:59 +0000 (11:09 +0000)
src/add/nmigen_add_experiment.py

index 807c4a77d0284e4249d127a5fcad9f543f576f10..92157d41f8addb8a3811ae2f7ed0b11af332036a 100644 (file)
@@ -76,11 +76,6 @@ class FPADD:
         b = FPNum(self.width)
         z = FPNum(self.width, 24)
 
-        # Sign
-        a_s = Signal()
-        b_s = Signal()
-        z_s = Signal()
-
         guard = Signal()
         round_bit = Signal()
         sticky = Signal()
@@ -202,19 +197,19 @@ class FPADD:
                 with m.If(a.s == b.s):
                     m.d.sync += [
                         tot.eq(a.m + b.m),
-                        z_s.eq(a.s)
+                        z.s.eq(a.s)
                     ]
                 # a mantissa greater than b, use a
                 with m.Elif(a.m >= b.m):
                     m.d.sync += [
                         tot.eq(a.m - b.m),
-                        z_s.eq(a.s)
+                        z.s.eq(a.s)
                     ]
                 # b mantissa greater than a, use b
                 with m.Else():
                     m.d.sync += [
                         tot.eq(b.m - a.m),
-                        z_s.eq(b.s)
+                        z.s.eq(b.s)
                 ]
 
             # ******