add an absolute count on the stages
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 21 Jul 2019 15:26:19 +0000 (16:26 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 21 Jul 2019 15:26:19 +0000 (16:26 +0100)
src/ieee754/fpdiv/pipeline.py

index 6fd5a45c3a02ef0d88cceb0920f7d2400bc64f56..3473e4c69842eca874c9381a68aa10dfa94b4a56 100644 (file)
@@ -84,6 +84,7 @@ class FPDIVBasePipe(ControlBase):
         pipechain = []
         n_stages = 6      # TODO (depends on width)
         n_comb_stages = 3  # TODO (depends on how many RS's we want)
+        stage_idx = 0
         # to which the answer: "as few as possible"
         # is required.  too many ReservationStations
         # means "big problems".
@@ -104,7 +105,9 @@ class FPDIVBasePipe(ControlBase):
             else:
                 kls = FPDivStagesIntermediate
 
-            pipechain.append(kls(self.pspec, n_comb_stages))
+            pipechain.append(kls(self.pspec, n_comb_stages, stage_idx))
+            stage_idx += n_comb_stages # increment so that each CalcStage
+                                       # gets a (correct) unique index
 
         # start and end: unpack/specialcases then normalisation/packing
         pipestart = FPDIVSpecialCasesDeNorm(self.pspec)