dma_wishbone: small syntax simplification thanks to None statements
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Sun, 15 Jan 2012 16:46:15 +0000 (17:46 +0100)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Sun, 15 Jan 2012 16:46:15 +0000 (17:46 +0100)
migen/actorlib/dma_wishbone.py

index 3bf3ff8c9914141432dd1be274c884bffd8300a9..ac6704f0480a9d80fd9edac226c2774dddaa72cc 100644 (file)
@@ -70,11 +70,10 @@ class Reader(Actor):
                                self.bus.stb_o.eq(1),
                                ob_stbs[w].eq(1),
                                If(self.bus.ack_i,
-                                       fsm.next_state(next_state)
+                                       fsm.next_state(next_state),
+                                       ag_inc.eq(1) if nwords > 1 else None
                                )
                        )
-                       if nwords > 1:
-                               fsm.act(state, If(self.bus.ack_i, ag_inc.eq(1)))
                fsm.act(fsm.STROBE,
                        self.endpoints["data"].stb.eq(1),
                        If(self.endpoints["data"].ack, fsm.next_state(fsm.IDLE))