Replicated unpack part of always block into nmigen
authorAleksandar Kostovic <alexandar.kostovic@gmail.com>
Wed, 13 Feb 2019 16:20:49 +0000 (17:20 +0100)
committerAleksandar Kostovic <alexandar.kostovic@gmail.com>
Wed, 13 Feb 2019 16:20:49 +0000 (17:20 +0100)
src/add/nmigen_add_experiment.py

index 412073b367938792ec2e9b6a49da385077a8e5b1..3aff0004f3eaba6c9b58996d6ee89fd79bd84ce1 100644 (file)
@@ -69,6 +69,17 @@ class FPADD:
                 with m.Else():
                     m.d.sync += self.in_b_ack.eq(1)
 
+            with m.State("unpack"):
+                    m.next = "special_cases"
+                    m.d.sync += [
+                        a_m.Cat(self.a[22:0], 0),
+                        b_m.Cat(self.b[22:0], 0),
+                        a_e.Cat(self.a[30:23] - 127),
+                        b_e.Cat(self.b[30:23] - 127),
+                        a_s.Cat(self.a[31]),
+                        b_s.Cat(self.b[31])
+                    ]
+
         return m
 
 """