From: Luke Kenneth Casson Leighton Date: Wed, 1 Dec 2021 16:24:50 +0000 (+0000) Subject: create single-stage ALU pipeline, shorten latency on in-order core X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f700a3e49401f9f6dccde847b880e4af9685829a;p=soc.git create single-stage ALU pipeline, shorten latency on in-order core --- diff --git a/src/soc/fu/alu/pipeline.py b/src/soc/fu/alu/pipeline.py index 87ca1356..a9c4f337 100644 --- a/src/soc/fu/alu/pipeline.py +++ b/src/soc/fu/alu/pipeline.py @@ -4,11 +4,12 @@ from soc.fu.alu.input_stage import ALUInputStage from soc.fu.alu.main_stage import ALUMainStage from soc.fu.alu.output_stage import ALUOutputStage -class ALUStages(PipeModBaseChain): + +class ALUStagesOld(PipeModBaseChain): def get_chain(self): inp = ALUInputStage(self.pspec) main = ALUMainStage(self.pspec) - return [inp, main] + return [inp, main, out] class ALUStageEnd(PipeModBaseChain): @@ -17,7 +18,7 @@ class ALUStageEnd(PipeModBaseChain): return [out] -class ALUBasePipe(ControlBase): +class ALUBasePipeOld(ControlBase): def __init__(self, pspec): ControlBase.__init__(self) self.pspec = pspec @@ -31,3 +32,25 @@ class ALUBasePipe(ControlBase): m.submodules.pipe2 = self.pipe2 m.d.comb += self._eqs return m + + +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.pspec = pspec + self.pipe1 = ALUStages(pspec) + self._eqs = self.connect([self.pipe1]) + + def elaborate(self, platform): + m = ControlBase.elaborate(self, platform) + m.submodules.pipe1 = self.pipe1 + m.d.comb += self._eqs + return m