From d8e082e66f158c0c8491c7bc434971947b84eaec Mon Sep 17 00:00:00 2001 From: Michael Nolan Date: Fri, 8 May 2020 10:43:32 -0400 Subject: [PATCH] Add pipe data for ALU pipeline --- src/soc/alu/pipe_data.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/soc/alu/pipe_data.py diff --git a/src/soc/alu/pipe_data.py b/src/soc/alu/pipe_data.py new file mode 100644 index 00000000..e2231c85 --- /dev/null +++ b/src/soc/alu/pipe_data.py @@ -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 -- 2.30.2