use RecordObject in output mux pipe
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 20 Apr 2019 22:23:09 +0000 (23:23 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 20 Apr 2019 22:23:09 +0000 (23:23 +0100)
src/add/test_outmux_pipe.py

index f1b0774f3153608f8332ced346b6b60a16407f12..9f420f074062923c986f421f519459b40a941576 100644 (file)
@@ -5,24 +5,15 @@ from nmigen.compat.sim import run_simulation
 from nmigen.cli import verilog, rtlil
 
 from multipipe import CombMuxOutPipe
-from singlepipe import SimpleHandshake, PassThroughHandshake
+from singlepipe import SimpleHandshake, PassThroughHandshake, RecordObject
 
 
-class PassInData:
+class PassInData(RecordObject):
     def __init__(self):
+        RecordObject.__init__(self)
         self.mid = Signal(2, reset_less=True)
         self.data = Signal(16, reset_less=True)
 
-    def __iter__(self):
-        yield self.mid
-        yield self.data
-
-    def eq(self, i):
-        return [self.mid.eq(i.mid), self.data.eq(i.data)]
-
-    def ports(self):
-        return [self.mid, self.data]
-
 
 class PassThroughStage: