csr: add description to CSRStorage/CSRStatus attributes (thanks xobs)
This commit is contained in:
parent
f2e84a5800
commit
99ed0877ac
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue