get.trigger_setup(m, self.in_t.stb, self.in_t.ack)
chainlist = [get, sc, alm, n1]
- chain = StageChain(chainlist, specallocate=True)
+ chain = StageChain(chainlist, specallocate=False)
chain.setup(m, self.i)
m.submodules.sc = sc
m.submodules.alm = alm
all the optional bits.
"""
+from nmigen import Elaboratable
from abc import ABCMeta, abstractmethod
import inspect
assert len(chain) > 0, "stage chain must be non-zero length"
self.chain = chain
StageHelper.__init__(self, None)
- self.setup = self._sa_setup if specallocate else self._na_setup
+ if specallocate:
+ self.setup = self._sa_setup
+ else:
+ self.setup = self._na_setup
self.set_specs(self.chain[0], self.chain[-1])
def _sa_setup(self, m, i):
if hasattr(c, "setup"):
c.setup(m, i) # stage may have some module stuff
ofn = self.chain[idx].ospec # last assignment survives
- o = _spec(ofn, 'chainin%d' % idx)
+ cname = 'chainin%d' % idx
+ o = _spec(ofn, cname)
+ if isinstance(o, Elaboratable):
+ setattr(m.submodules, cname, o)
m.d.comb += nmoperator.eq(o, c.process(i)) # process input into "o"
if idx == len(self.chain)-1:
break