bus/asmibus/hub: hack to prevent comb loops
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Mon, 30 Apr 2012 22:11:42 +0000 (17:11 -0500)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Mon, 30 Apr 2012 22:11:42 +0000 (17:11 -0500)
migen/bus/asmibus.py

index ec34a6f512d441484f598e2c9f453e8793bd773b..4bae4ef7cb0c1cd8da05825d32485b3f6a643ccb 100644 (file)
@@ -102,10 +102,11 @@ class Port:
                choose_slot = None
                for s in reversed(self.slots):
                        choose_slot = If(s.state == SLOT_EMPTY,
-                               self.ack.eq(1),
                                s.allocate.eq(self.stb)
                        ).Else(choose_slot)
                comb.append(choose_slot)
+               comb.append(self.ack.eq(optree("|", 
+                       [s.state == SLOT_EMPTY for s in self.slots])))
                
                # call
                comb += [s.call.eq(self.get_call_expression(n))