genlib/roundrobin: fix n==1 case (correctly)
authorRobert Jordens <jordens@gmail.com>
Fri, 26 Jul 2013 07:33:18 +0000 (09:33 +0200)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Fri, 26 Jul 2013 07:33:33 +0000 (09:33 +0200)
migen/genlib/roundrobin.py

index cf42e9436523765ca1296d6ccf8d54a61dd43d65..d8ee65f1e1559c1c0f6309394c0924784c4eda32 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=max(1, n))
+               self.grant = Signal(max=max(2, n))
                self.switch_policy = switch_policy
                if self.switch_policy == SP_CE:
                        self.ce = Signal()