Skip to content

Commit

Permalink
genlib/roundrobin.py: fix n==1 case
Browse files Browse the repository at this point in the history
  • Loading branch information
jordens authored and Sebastien Bourdeauducq committed Jul 25, 2013
1 parent b96eb33 commit b8ff2f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion migen/genlib/roundrobin.py
Expand Up @@ -5,7 +5,7 @@
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()
Expand Down

2 comments on commit b8ff2f2

@jordens
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry. got my ones and twos wrong.
this is supposed to be:
self.grant = Signal(max=max(2, n))

@sbourdeauducq
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Please sign in to comment.