genlib/roundrobin.py: fix n==1 case

This commit is contained in:
Robert Jordens 2013-07-25 15:55:05 -06:00 committed by Sebastien Bourdeauducq
parent b96eb339af
commit b8ff2f2792

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=n) self.grant = Signal(max=max(1, 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()