convert FPOpData to __iter__
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 20 Apr 2019 21:11:24 +0000 (22:11 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 20 Apr 2019 21:11:24 +0000 (22:11 +0100)
src/add/fpadd/statemachine.py

index eae01e2e6d1c9cf6bcda1d4812cb4d23be59f7bc..1ece16d8ceaa56a1f1c9e1fbc74c229e79222252 100644 (file)
@@ -34,11 +34,15 @@ class FPOpData:
         self.z = FPOpOut(width)
         self.mid = Signal(id_wid, reset_less=True)
 
+    def __iter__(self):
+        yield self.z
+        yield self.mid
+
     def eq(self, i):
         return [self.z.eq(i.z), self.mid.eq(i.mid)]
 
     def ports(self):
-        return [self.z, self.mid]
+        return list(self)
 
 
 class FPADDBaseMod: