self.interface.we & \
(self.interface.adr[:nbits] == Constant(i, BV(nbits)))))
elif isinstance(reg, RegisterFields):
- sync.append(reg.re.eq(0))
bwra = [Constant(i, BV(nbits))]
offset = 0
for field in reg.fields:
bwra.append(field.storage.eq(self.interface.dat_w[offset:offset+field.size]))
offset += field.size
if len(bwra) > 1:
- bwra.append(reg.re.eq(1))
bwcases.append(bwra)
# commit atomic writes
for field in reg.fields:
self.we = Signal()
class RegisterFields:
- def __init__(self, name, fields, re=None):
+ def __init__(self, name, fields):
self.name = name
self.fields = fields
- if re is None:
- self.re = Signal()
- else:
- self.re = re
class RegisterField(RegisterFields):
def __init__(self, name, size=1, access_bus=READ_WRITE, access_dev=READ_ONLY, reset=0, atomic_write=False):
else:
f.append(field)
if f:
- d.append(RegisterFields(reg.name, f, reg.re))
+ d.append(RegisterFields(reg.name, f))
else:
raise TypeError
return d