csr: fix field access check

* Broken in 5dc440e80d
This commit is contained in:
Andrew Dennison 2022-06-02 16:14:47 +10:00 committed by Florent Kermarrec
parent 88ec1b3f5e
commit 5e667f17d7
1 changed files with 2 additions and 2 deletions

View File

@ -217,10 +217,10 @@ class CSRFieldAggregate:
for field in fields: for field in fields:
if field.access is None: if field.access is None:
field.access = access field.access = access
elif field.access == CSRAccess.ReadOnly: elif access == CSRAccess.ReadOnly:
assert not field.pulse assert not field.pulse
assert field.access == CSRAccess.ReadOnly assert field.access == CSRAccess.ReadOnly
elif field.access == CSRAccess.ReadWrite: elif access == CSRAccess.ReadWrite:
assert field.access in [CSRAccess.ReadWrite, CSRAccess.WriteOnly] assert field.access in [CSRAccess.ReadWrite, CSRAccess.WriteOnly]
if field.pulse: if field.pulse:
field.access = CSRAccess.WriteOnly field.access = CSRAccess.WriteOnly