improve ControlBase.ports enumeration of its o_data and i_data
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 20 Apr 2019 11:49:33 +0000 (12:49 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 20 Apr 2019 11:49:33 +0000 (12:49 +0100)
src/add/singlepipe.py

index ca01e858d4f38e16b9a17cb4fb18a4181bc321b6..967f2d43c07c536e9d84748249003c93020ed4df 100644 (file)
@@ -650,12 +650,16 @@ class ControlBase:
                ]
         if hasattr(self.p.i_data, "ports"):
             res += self.p.i_data.ports()
-        else:
+        elif isinstance(self.p.i_data, Sequence):
             res += self.p.i_data
+        else:
+            res.append(self.p.i_data)
         if hasattr(self.n.o_data, "ports"):
             res += self.n.o_data.ports()
-        else:
+        elif isinstance(self.n.o_data, Sequence):
             res += self.n.o_data
+        else:
+            res.append(self.n.o_data)
         return res
 
     def _elaborate(self, platform):