Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit b8ff2f27928b57c1f8eff959f34edd9d12b15a29 1 parent b96eb33
Robert Jordens authored July 25, 2013 sbourdeauducq committed July 26, 2013

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  migen/genlib/roundrobin.py
2  migen/genlib/roundrobin.py
@@ -5,7 +5,7 @@
5 5
 class RoundRobin(Module):
6 6
 	def __init__(self, n, switch_policy=SP_WITHDRAW):
7 7
 		self.request = Signal(n)
8  
-		self.grant = Signal(max=n)
  8
+		self.grant = Signal(max=max(1, n))
9 9
 		self.switch_policy = switch_policy
10 10
 		if self.switch_policy == SP_CE:
11 11
 			self.ce = Signal()

2 notes on commit b8ff2f2

Robert Jordens

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

Sébastien Bourdeauducq
Owner

fixed

Please sign in to comment.
Something went wrong with that request. Please try again.