Did get_b state in nmigen
authorAleksandar Kostovic <alexandar.kostovic@gmail.com>
Sat, 16 Feb 2019 11:34:17 +0000 (12:34 +0100)
committerAleksandar Kostovic <alexandar.kostovic@gmail.com>
Sat, 16 Feb 2019 11:34:17 +0000 (12:34 +0100)
src/add/fmul.py

index d8192c6bfb7877f87667bcf2556513ae68391933..5342047c11f4a291228cc6d658a4b869a8c5af1b 100644 (file)
@@ -39,6 +39,15 @@ class FPMUL(FPBase):
                                s.in_a.ack(0)
                        ]
 
+               with m.State("get_b"):
+                       m.next += "unpack"
+                       m.d.sync += s.in_b.ack.eq(1)
+                       with m.If(s.in_b.ack & in_b.stb):
+                               m.d.sync += [
+                               b.eq(in_b),
+                               s.in_a.ack(0)
+                       ]
+
 """
 always @(posedge clk)
   begin