def __init__(self, width, id_wid):
ControlBase.__init__(self)
self.pipe1 = FPADDBasePipe1(width, id_wid)
- self.p.i_data = self.pipe1.stage.ispec()
- self.n.o_data = self.pipe1.stage.ospec()
+ self._eqs = self.connect([self.pipe1])
def elaborate(self, platform):
m = Module()
m.submodules.pipe1 = self.pipe1
- self.connect(m, [self.pipe1])
+ m.d.comb += self._eqs
return m
"""
return self.n._connect_out(nxt.n)
- def connect(self, m, pipechain):
+ def connect(self, pipechain):
""" connects a chain (list) of Pipeline instances together and
links them to this ControlBase instance:
# connect front of chain to ourselves
front = pipechain[0]
- #self.p.i_data = front.stage.ispec()
+ self.p.i_data = front.stage.ispec()
eqs += front._connect_in(self)
# connect end of chain to ourselves
end = pipechain[-1]
- #self.n.o_data = end.stage.ospec()
+ self.n.o_data = end.stage.ospec()
eqs += end._connect_out(self)
- # activate the assignments
- m.d.comb += eqs
+ return eqs
def set_input(self, i):
""" helper function to set the input data
pipe1 = ExampleBufPipe()
pipe2 = ExampleBufPipe()
- self.p.i_data = pipe1.stage.ispec()
- self.n.o_data = pipe2.stage.ospec()
-
m.submodules.pipe1 = pipe1
m.submodules.pipe2 = pipe2
- self.connect(m, [pipe1, pipe2])
+ m.d.comb += self.connect([pipe1, pipe2])
return m