put in TODO divstages list
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 28 Jun 2019 06:03:00 +0000 (07:03 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 28 Jun 2019 06:03:00 +0000 (07:03 +0100)
src/ieee754/fpdiv/divstages.py

index 94c8a785421276db982061c61cfe2f7ae6199464..e1f8b113810b9b3bf986dc70fb16a408912574bc 100644 (file)
@@ -16,6 +16,7 @@ from ieee754.fpcommon.postcalc import FPAddStage1Data
 # TODO: write these
 from .div0 import FPDivStage0Mod
 from .div1 import FPDivStage1Mod
+from .div2 import FPDivStage2Mod
 
 
 class FPDivStages(FPState, SimpleHandshake):
@@ -40,10 +41,12 @@ class FPDivStages(FPState, SimpleHandshake):
         # TODO.  clearly, this would be a for-loop, here, creating
         # a huge number of stages (if radix-2 is used).  interestingly
         # the number of stages will be data-dependent.
-        m0mod = FPDivStage0Mod(self.width, self.id_wid)
-        m1mod = FPDivStage1Mod(self.width, self.id_wid)
+        divstages = [FPDivStage0Mod(self.width, self.id_wid)]
+        for i in range(self.width): # XXX TODO: work out actual number needed
+            divstages.append(FPDivStage1Mod(self.width, self.id_wid))
+        divstages.append(FPDivStage2Mod(self.width, self.id_wid))
 
-        chain = StageChain([m0mod, m1mod])
+        chain = StageChain(divstages)
         chain.setup(m, i)
 
         self.o = m1mod.o