From: Michael Nolan Date: Fri, 8 May 2020 20:35:40 +0000 (-0400) Subject: Oops, forgot pipeline.py X-Git-Tag: div_pipeline~1331 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6b70b26f0404d39f696e110ff4186bb0c6d3f72d;p=soc.git Oops, forgot 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