mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
genlib/record: use getattr instead of __dict__
This commit is contained in:
parent
1897b74f97
commit
3da98ea04d
1 changed files with 2 additions and 2 deletions
|
@ -34,7 +34,7 @@ class Record:
|
||||||
def layout(self):
|
def layout(self):
|
||||||
l = []
|
l = []
|
||||||
for key, alignment in self.field_order:
|
for key, alignment in self.field_order:
|
||||||
e = self.__dict__[key]
|
e = getattr(self, key)
|
||||||
if isinstance(e, Signal):
|
if isinstance(e, Signal):
|
||||||
l.append((key, (e.nbits, e.signed), alignment))
|
l.append((key, (e.nbits, e.signed), alignment))
|
||||||
elif isinstance(e, Record):
|
elif isinstance(e, Record):
|
||||||
|
@ -84,7 +84,7 @@ class Record:
|
||||||
l.append(Replicate(0, pad_size))
|
l.append(Replicate(0, pad_size))
|
||||||
offset += pad_size
|
offset += pad_size
|
||||||
|
|
||||||
e = self.__dict__[key]
|
e = getattr(self, key)
|
||||||
if isinstance(e, Signal):
|
if isinstance(e, Signal):
|
||||||
added = [e]
|
added = [e]
|
||||||
elif isinstance(e, Record):
|
elif isinstance(e, Record):
|
||||||
|
|
Loading…
Reference in a new issue