Combine initial stage with first cordic stage
authorMichael Nolan <mtnolan2640@gmail.com>
Wed, 1 Apr 2020 17:26:09 +0000 (13:26 -0400)
committerMichael Nolan <mtnolan2640@gmail.com>
Wed, 1 Apr 2020 17:26:09 +0000 (13:26 -0400)
src/ieee754/cordic/sin_cos_pipeline.py

index e8b3a6be767ec08cdd320f9fe68e36e98943e58d..58d84e385a5eef7d10701f2e63871932dff4e261 100644 (file)
@@ -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)