add ternlogi to shiftrot
[soc.git] / src / soc / fu / bitmanip / pipeline.py
1 from nmutil.singlepipe import ControlBase
2 from nmutil.pipemodbase import PipeModBaseChain
3 from soc.fu.bitmanip.input_stage import BitManipInputStage
4 from soc.fu.bitmanip.main_stage import BitManipMainStage
5 from soc.fu.bitmanip.output_stage import BitManipOutputStage
6
7
8 class BitManipStages(PipeModBaseChain):
9 def get_chain(self):
10 inp = BitManipInputStage(self.pspec)
11 main = BitManipMainStage(self.pspec)
12 return [inp, main]
13
14
15 class BitManipStageEnd(PipeModBaseChain):
16 def get_chain(self):
17 out = BitManipOutputStage(self.pspec)
18 return [out]
19
20
21 class BitManipBasePipe(ControlBase):
22 def __init__(self, pspec):
23 ControlBase.__init__(self)
24 self.pspec = pspec
25 self.pipe1 = BitManipStages(pspec)
26 self.pipe2 = BitManipStageEnd(pspec)
27 self._eqs = self.connect([self.pipe1, self.pipe2])
28
29 def elaborate(self, platform):
30 m = ControlBase.elaborate(self, platform)
31 m.submodules.pipe1 = self.pipe1
32 m.submodules.pipe2 = self.pipe2
33 m.d.comb += self._eqs
34 return m