genlib/roundrobin: fix n==1 case (correctly)

This commit is contained in:
Robert Jordens 2013-07-26 09:33:18 +02:00 committed by Sebastien Bourdeauducq
parent b8ff2f2792
commit 6e1195415e
1 changed files with 1 additions and 1 deletions

View File

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