bank/description/AutoCSR: add autocsr_exclude
This commit is contained in:
parent
10212e85e7
commit
c82b53f1cd
|
@ -96,8 +96,13 @@ def memprefix(prefix, memories):
|
|||
|
||||
class AutoCSR:
|
||||
def get_memories(self):
|
||||
try:
|
||||
exclude = self.autocsr_exclude
|
||||
except AttributeError:
|
||||
exclude = {}
|
||||
r = []
|
||||
for k, v in self.__dict__.items():
|
||||
if k not in exclude:
|
||||
if isinstance(v, Memory):
|
||||
r.append(v)
|
||||
elif hasattr(v, "get_memories") and callable(v.get_memories):
|
||||
|
@ -107,8 +112,13 @@ class AutoCSR:
|
|||
return sorted(r, key=lambda x: x.huid)
|
||||
|
||||
def get_csrs(self):
|
||||
try:
|
||||
exclude = self.autocsr_exclude
|
||||
except AttributeError:
|
||||
exclude = {}
|
||||
r = []
|
||||
for k, v in self.__dict__.items():
|
||||
if k not in exclude:
|
||||
if isinstance(v, _CSRBase):
|
||||
r.append(v)
|
||||
elif hasattr(v, "get_csrs") and callable(v.get_csrs):
|
||||
|
|
Loading…
Reference in New Issue