From 6b70b26f0404d39f696e110ff4186bb0c6d3f72d Mon Sep 17 00:00:00 2001 From: Michael Nolan Date: Fri, 8 May 2020 16:35:40 -0400 Subject: [PATCH] Oops, forgot pipeline.py --- src/soc/alu/pipeline.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/soc/alu/pipeline.py diff --git a/src/soc/alu/pipeline.py b/src/soc/alu/pipeline.py new file mode 100644 index 00000000..e8dd1991 --- /dev/null +++ b/src/soc/alu/pipeline.py @@ -0,0 +1,25 @@ +from nmutil.singlepipe import ControlBase +from nmutil.pipemodbase import PipeModBaseChain +from soc.alu.input_stage import ALUInputStage +from soc.alu.main_stage import ALUMainStage +from soc.alu.output_stage import ALUOutputStage + +class ALUStages(PipeModBaseChain): + def get_chain(self): + inp = ALUInputStage(self.pspec) + main = ALUMainStage(self.pspec) + out = ALUOutputStage(self.pspec) + return [inp, main, out] + + +class ALUBasePipe(ControlBase): + def __init__(self, pspec): + ControlBase.__init__(self) + self.pipe1 = ALUStages(pspec) + self._eqs = self.connect([self.pipe1]) + + def elaborate(self, platform): + m = ControlBase.elaborate(self, platform) + m.submodules.pipe = self.pipe1 + m.d.comb += self._eqs + return m -- 2.30.2