relative imports are a pain
[ieee754fpu.git] / src / ieee754 / fpadd / addstages.py
index b398a2742072246d3f0dc523804c5b09517fc556..2bc23df0dabf89f8a4e194d5e573a88d5d740d0e 100644 (file)
@@ -11,34 +11,33 @@ from nmutil.singlepipe import (StageChain, SimpleHandshake,
 from ieee754.fpcommon.fpbase import FPState
 from ieee754.fpcommon.denorm import FPSCData
 from ieee754.fpcommon.postcalc import FPAddStage1Data
-from .align import FPAddAlignSingleMod
-from .add0 import FPAddStage0Mod
-from .add1 import FPAddStage1Mod
+from ieee754.fpadd.align import FPAddAlignSingleMod
+from ieee754.fpadd.add0 import FPAddStage0Mod
+from ieee754.fpadd.add1 import FPAddStage1Mod
 
 
 class FPAddAlignSingleAdd(FPState, SimpleHandshake):
 
-    def __init__(self, width, id_wid):
+    def __init__(self, pspec):
         FPState.__init__(self, "align")
-        self.width = width
-        self.id_wid = id_wid
+        self.pspec = pspec
         SimpleHandshake.__init__(self, self) # pipeline is its own stage
         self.a1o = self.ospec()
 
     def ispec(self):
-        return FPSCData(self.width, self.id_wid)
+        return FPSCData(self.pspec, True)
 
     def ospec(self):
-        return FPAddStage1Data(self.width, self.id_wid) # AddStage1 ospec
+        return FPAddStage1Data(self.pspec) # AddStage1 ospec
 
     def setup(self, m, i):
         """ links module to inputs and outputs
         """
 
         # chain AddAlignSingle, AddStage0 and AddStage1
-        mod = FPAddAlignSingleMod(self.width, self.id_wid)
-        a0mod = FPAddStage0Mod(self.width, self.id_wid)
-        a1mod = FPAddStage1Mod(self.width, self.id_wid)
+        mod = FPAddAlignSingleMod(self.pspec)
+        a0mod = FPAddStage0Mod(self.pspec)
+        a1mod = FPAddStage1Mod(self.pspec)
 
         chain = StageChain([mod, a0mod, a1mod])
         chain.setup(m, i)