actorlib/control: use numbers of bits instead of maxima
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Sun, 17 Jun 2012 16:29:57 +0000 (18:29 +0200)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Sun, 17 Jun 2012 16:29:57 +0000 (18:29 +0200)
migen/actorlib/control.py

index 9163bcf5f42904305120d957e9d4eb20b46a136f..8520dd99f31a4c3a7344451f94b74e3c987b952d 100644 (file)
@@ -8,14 +8,14 @@ from migen.flow.actor import *
 
 # Generates integers from start to maximum-1
 class For(Actor):
-       def __init__(self, *maxima, start=False, step=False):
-               self.dimensions = len(maxima)
+       def __init__(self, *nbits, start=False, step=False):
+               self.dimensions = len(nbits)
                self.start = start
                self.step = step
                params = ["end"]
                if start: params.append("start")
                if step: params.append("step")
-               self.d_bv = [BV(bits_for(dimension)) for dimension in maxima]
+               self.d_bv = [BV(dimension) for dimension in nbits]
                l_sink = [("d{0}".format(n), [(p, bv) for p in params])
                        for n, bv in enumerate(self.d_bv)]
                l_source = [("d{0}".format(n), bv)