From 495d64c21b1e949b544b1d0eb3f7412e7ab23109 Mon Sep 17 00:00:00 2001 From: Aleksandar Kostovic Date: Sat, 16 Feb 2019 12:27:29 +0100 Subject: [PATCH] Did get_a state in nmigen --- src/add/fmul.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/add/fmul.py b/src/add/fmul.py index 7abf072a..d8192c6b 100644 --- a/src/add/fmul.py +++ b/src/add/fmul.py @@ -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) -- 2.30.2