missed critical functions in cut/paste copy of PipeContext
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 15 Jul 2020 13:56:02 +0000 (14:56 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 15 Jul 2020 13:56:02 +0000 (14:56 +0100)
src/nmutil/concurrentunit.py

index 30fe93cf46e9f4d3f5ba5c54fc4ed9e45b450b68..fd11a3e99cdb8968e4bb61bb0fcc04207d0aedaa 100644 (file)
@@ -43,6 +43,16 @@ class PipeContext:
         ret.append(self.op.eq(i.op))
         return ret
 
+    def __iter__(self):
+        yield self.muxid
+        yield self.op
+
+    def ports(self):
+        if hasattr(self.op, "ports"):
+            return [self.muxid] + self.op.ports()
+        else:
+            return list(self)
+
 
 class InMuxPipe(PriorityCombMuxInPipe):
     def __init__(self, num_rows, iospecfn, maskwid=0):