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

index 7abf072a8680337173c9e81a6d1e3919a8985536..d8192c6bfb7877f87667bcf2556513ae68391933 100644 (file)
@@ -30,8 +30,17 @@ class FPMUL(FPBase):
 
         with m.FSM() as fsm:
 
- """
-   always @(posedge clk)
+               with m.State("get_a"):
+                       m.next += "get_b"
+                       m.d.sync += s.in_a.ack.eq(1)
+                       with m.If(s.in_a.ack & in_a.stb):
+                               m.d.sync += [
+                               a.eq(in_a),
+                               s.in_a.ack(0)
+                       ]
+
+"""
+always @(posedge clk)
   begin
 
     case(state)