Done unpack in nmigen
authorAleksandar Kostovic <alexandar.kostovic@gmail.com>
Sun, 17 Feb 2019 14:42:22 +0000 (15:42 +0100)
committerAleksandar Kostovic <alexandar.kostovic@gmail.com>
Sun, 17 Feb 2019 14:42:22 +0000 (15:42 +0100)
src/add/fmul.py

index 7d98eb6be8c53e1e0b2967a60b4dce04057384fc..d41d974b077c992653380d8d608d62d855beea16 100644 (file)
@@ -48,6 +48,18 @@ class FPMUL(FPBase):
                                s.in_b.ack(0)
                        ]
 
+               with m.State("unpack"):
+                       m.next += "special_cases"
+                       m.d.sync += [
+                       a.m.eq(a[0:22]),
+                       b.m.eq(b[0:22]),
+                       a.e.eq(a[23:31] - 127),
+                       b.e.eq(b[23:31] - 127),
+                       a.s.eq(a[31]),
+                       b.s.eq(b[31])
+
+                       ]
+                       
 """
 always @(posedge clk)
   begin