from migen.flow.actor import *
# layout is a list of tuples, either:
-# - (name, bv, [reset value], [alignment bits])
+# - (name, nbits, [reset value], [alignment bits])
# - (name, sublayout)
def _convert_layout(layout):
assigns += r_assigns
else:
name = element[0]
- bv = element[1]
+ nbits = element[1]
if len(element) > 2:
reset = element[2]
else:
alignment = element[3]
else:
alignment = 0
- reg = RegisterField(prefix + name, bv.width + alignment,
+ reg = RegisterField(prefix + name, nbits + alignment,
reset=reset, atomic_write=atomic)
registers.append(reg)
assigns.append(getattr(target, name).eq(reg.field.r[alignment:]))
def __init__(self, n, switch_policy=SP_WITHDRAW):
self.n = n
self.request = Signal(max=self.n)
- self.grant = Signal(self.bn)
+ self.grant = Signal(max=self.n)
self.switch_policy = switch_policy
if self.switch_policy == SP_CE:
self.ce = Signal()
l = [_printexpr(ns, v)[0] for v in reversed(node.l)]
return "{" + ", ".join(l) + "}", False
elif isinstance(node, Replicate):
- return "{" + str(node.n) + "{" + _printexpr(ns, node.v) + "}}", False
+ return "{" + str(node.n) + "{" + _printexpr(ns, node.v)[0] + "}}", False
else:
raise TypeError
firstp = False
r += "\t." + p.name + "("
if isinstance(p.value, (int, bool)):
- r += _printintbool(p.value)
+ r += _printintbool(p.value)[0]
elif isinstance(p.value, float):
r += str(p.value)
elif isinstance(p.value, str):