mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
gen/genlib/record: fix connect
This commit is contained in:
parent
9ae16c2f40
commit
e80cfedd7f
1 changed files with 8 additions and 8 deletions
|
@ -133,22 +133,22 @@ class Record:
|
||||||
|
|
||||||
def connect(self, *slaves, keep=None, omit=None):
|
def connect(self, *slaves, keep=None, omit=None):
|
||||||
if keep is None:
|
if keep is None:
|
||||||
keep = set([f[0] for f in self.layout])
|
_keep = set([f[0] for f in self.layout])
|
||||||
if isinstance(keep, list):
|
elif isinstance(keep, list):
|
||||||
keep = set(keep)
|
_keep = set(keep)
|
||||||
if omit is None:
|
if omit is None:
|
||||||
omit = set()
|
_omit = set()
|
||||||
if isinstance(omit, list):
|
elif isinstance(omit, list):
|
||||||
omit = set(omit)
|
_omit = set(omit)
|
||||||
|
|
||||||
keep = keep - omit
|
_keep = _keep - _omit
|
||||||
|
|
||||||
r = []
|
r = []
|
||||||
for f in self.layout:
|
for f in self.layout:
|
||||||
field = f[0]
|
field = f[0]
|
||||||
self_e = getattr(self, field)
|
self_e = getattr(self, field)
|
||||||
if isinstance(self_e, Signal):
|
if isinstance(self_e, Signal):
|
||||||
if field in keep:
|
if field in _keep:
|
||||||
direction = f[2]
|
direction = f[2]
|
||||||
if direction == DIR_M_TO_S:
|
if direction == DIR_M_TO_S:
|
||||||
r += [getattr(slave, field).eq(self_e) for slave in slaves]
|
r += [getattr(slave, field).eq(self_e) for slave in slaves]
|
||||||
|
|
Loading…
Reference in a new issue