bank: add RE signal for registers made of fields

This commit is contained in:
Sebastien Bourdeauducq 2012-02-17 23:52:06 +01:00
parent 92dfbb92dd
commit 55a265d967
2 changed files with 7 additions and 2 deletions

View File

@ -34,6 +34,7 @@ class Bank:
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)
else:
raise TypeError

View File

@ -27,9 +27,13 @@ class Field:
self.we = Signal()
class RegisterFields:
def __init__(self, name, fields):
def __init__(self, name, fields, re=None):
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):
@ -71,7 +75,7 @@ def expand_description(description, busword):
else:
f.append(field)
if f:
d.append(RegisterFields(reg.name, f))
d.append(RegisterFields(reg.name, f, reg.re))
else:
raise TypeError
return d