Add pipe data for ALU pipeline
authorMichael Nolan <mtnolan2640@gmail.com>
Fri, 8 May 2020 14:43:32 +0000 (10:43 -0400)
committerMichael Nolan <mtnolan2640@gmail.com>
Fri, 8 May 2020 14:51:45 +0000 (10:51 -0400)
src/soc/alu/pipe_data.py [new file with mode: 0644]

diff --git a/src/soc/alu/pipe_data.py b/src/soc/alu/pipe_data.py
new file mode 100644 (file)
index 0000000..e2231c8
--- /dev/null
@@ -0,0 +1,27 @@
+from nmigen import Signal, Const
+from nmutil.dynamicpipe import SimpleHandshakeRedir
+from soc.alu.alu_input_record import CompALUOpSubset
+
+
+class ALUInitialData:
+
+    def __init__(self, pspec):
+        self.op = CompALUOpSubset()
+        self.a = Signal(64, reset_less=True)
+        self.b = Signal(64, reset_less=True)
+
+    def __iter__(self):
+        yield from self.op
+        yield self.a
+        yield self.b
+
+    def eq(self, i):
+        return [self.op.eq(i.op),
+                self.a.eq(i.a), self.b.eq(i.b)]
+
+
+
+
+class ALUPipeSpec:
+    def __init__(self):
+        self.pipekls = SimpleHandshakeRedir