From: Michael Nolan Date: Wed, 1 Apr 2020 17:26:09 +0000 (-0400) Subject: Combine initial stage with first cordic stage X-Git-Tag: ls180-24jan2020~98 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9426fb21d599cafa9e9eb9d7da736e4c5689f0ad;p=ieee754fpu.git Combine initial stage with first cordic stage --- diff --git a/src/ieee754/cordic/sin_cos_pipeline.py b/src/ieee754/cordic/sin_cos_pipeline.py index e8b3a6be..58d84e38 100644 --- a/src/ieee754/cordic/sin_cos_pipeline.py +++ b/src/ieee754/cordic/sin_cos_pipeline.py @@ -19,19 +19,19 @@ class CordicPipeChain(PipeModBaseChain): class CordicBasePipe(ControlBase): def __init__(self, pspec): ControlBase.__init__(self) - self.initstage = CordicPipeChain(pspec, - [CordicInitialStage(pspec)]) self.cordicstages = [] for i in range(pspec.iterations): - stage = CordicPipeChain(pspec, - [CordicStage(pspec, i)]) + if i == 0: + stages = [CordicInitialStage(pspec), CordicStage(pspec, i)] + else: + stages = [CordicStage(pspec, i)] + stage = CordicPipeChain(pspec, stages) self.cordicstages.append(stage) - self._eqs = self.connect([self.initstage] + self.cordicstages) + self._eqs = self.connect(self.cordicstages) def elaborate(self, platform): m = ControlBase.elaborate(self, platform) - m.submodules.init = self.initstage for i, stage in enumerate(self.cordicstages): setattr(m.submodules, "cordic%d" % i, stage)