genlib/roundrobin.py: fix n==1 case
authorRobert Jordens <jordens@gmail.com>
Thu, 25 Jul 2013 21:55:05 +0000 (15:55 -0600)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Thu, 25 Jul 2013 22:41:08 +0000 (00:41 +0200)
migen/genlib/roundrobin.py

index 15bec5c7f3bce3dd30082277901b51a575494031..cf42e9436523765ca1296d6ccf8d54a61dd43d65 100644 (file)
@@ -5,7 +5,7 @@ from migen.fhdl.std import *
 class RoundRobin(Module):
        def __init__(self, n, switch_policy=SP_WITHDRAW):
                self.request = Signal(n)
-               self.grant = Signal(max=n)
+               self.grant = Signal(max=max(1, n))
                self.switch_policy = switch_policy
                if self.switch_policy == SP_CE:
                        self.ce = Signal()