gen/genlib/record: fix connect
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Thu, 21 Apr 2016 10:16:26 +0000 (12:16 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Thu, 21 Apr 2016 10:16:26 +0000 (12:16 +0200)
litex/gen/genlib/record.py

index 9b4ce3db6e8c954e8b3514522bfe164bf2da21c4..e98922ffdaa54e6e9a98aaea37a573fdf2469f3c 100644 (file)
@@ -133,22 +133,22 @@ class Record:
 
     def connect(self, *slaves, keep=None, omit=None):
         if keep is None:
-            keep = set([f[0] for f in self.layout])
-        if isinstance(keep, list):
-            keep = set(keep)
+            _keep = set([f[0] for f in self.layout])
+        elif isinstance(keep, list):
+            _keep = set(keep)
         if omit is None:
-            omit = set()
-        if isinstance(omit, list):
-            omit = set(omit)
+            _omit = set()
+        elif isinstance(omit, list):
+            _omit = set(omit)
 
-        keep = keep - omit
+        _keep = _keep - _omit
 
         r = []
         for f in self.layout:
             field = f[0]
             self_e = getattr(self, field)
             if isinstance(self_e, Signal):
-                if field in keep:
+                if field in _keep:
                     direction = f[2]
                     if direction == DIR_M_TO_S:
                         r += [getattr(slave, field).eq(self_e) for slave in slaves]