csr: add description to CSRStorage/CSRStatus attributes (thanks xobs)

This commit is contained in:
Florent Kermarrec 2019-09-18 10:47:54 +02:00
parent f2e84a5800
commit 99ed0877ac
1 changed files with 2 additions and 0 deletions

View File

@ -280,6 +280,7 @@ class CSRStatus(_CompoundCSR):
size = self.fields.get_size() size = self.fields.get_size()
reset = self.fields.get_reset() reset = self.fields.get_reset()
_CompoundCSR.__init__(self, size, name) _CompoundCSR.__init__(self, size, name)
self.description = description
self.status = Signal(self.size, reset=reset) self.status = Signal(self.size, reset=reset)
for field in fields: for field in fields:
self.comb += self.status[field.offset:field.offset + field.size].eq(getattr(self.fields, field.name)) self.comb += self.status[field.offset:field.offset + field.size].eq(getattr(self.fields, field.name))
@ -350,6 +351,7 @@ class CSRStorage(_CompoundCSR):
size = self.fields.get_size() size = self.fields.get_size()
reset = self.fields.get_reset() reset = self.fields.get_reset()
_CompoundCSR.__init__(self, size, name) _CompoundCSR.__init__(self, size, name)
self.description = description
self.storage = Signal(self.size, reset=reset) self.storage = Signal(self.size, reset=reset)
self.atomic_write = atomic_write self.atomic_write = atomic_write
self.re = Signal() self.re = Signal()