def ospec(self):
return FPNumIn2Ops(self.width, self.id_wid)
+ def process(self, i):
+ return self.o
+
def setup(self, m, i):
""" links module to inputs and outputs
"""
def setup(self, m, i):
""" links module to inputs and outputs
"""
- mod = FPAddAlignSingleMod(self.width, self.id_wid)
- mod.setup(m, i)
- o = mod.ospec()
- m.d.comb += o.eq(mod.o)
+ # chain AddAlignSingle, AddStage0 and AddStage1
+ mod = FPAddAlignSingleMod(self.width, self.id_wid)
a0mod = FPAddStage0Mod(self.width, self.id_wid)
- a0mod.setup(m, o)
- a0o = a0mod.ospec()
- m.d.comb += a0o.eq(a0mod.o)
-
a1mod = FPAddStage1Mod(self.width, self.id_wid)
- a1mod.setup(m, a0o)
self.a1modo = a1mod.o
+ chain = StageChain([mod, a0mod, a1mod])
+ chain.setup(m, i)
+
m.d.sync += self.a1o.eq(self.a1modo)
def action(self, m):
def ospec(self):
return FPAddStage0Data(self.width, self.id_wid)
+ def process(self, i):
+ return self.o
+
def setup(self, m, i):
""" links module to inputs and outputs
"""
def ospec(self):
return FPAddStage1Data(self.width, self.id_wid)
+ def process(self, i):
+ return self.o
+
def setup(self, m, i):
""" links module to inputs and outputs
"""