From: Florent Kermarrec Date: Thu, 12 Nov 2015 00:41:23 +0000 (+0100) Subject: soc/interconnect/stream: add Pipeline X-Git-Tag: 24jan2021_ls180~2073 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=83427c87cd7ba79b978f241f6434e94b9bc41206;p=litex.git soc/interconnect/stream: add Pipeline --- diff --git a/litex/soc/interconnect/stream.py b/litex/soc/interconnect/stream.py index c420f3af..f6b1bb02 100644 --- a/litex/soc/interconnect/stream.py +++ b/litex/soc/interconnect/stream.py @@ -440,4 +440,23 @@ class Converter(Module): else: self.comb += Record.connect(self.sink, self.source) + +class Pipeline(Module): + def __init__(self, *modules): + n = len(modules) + m = modules[0] + # expose sink of first module + # if available + if hasattr(m, "sink"): + self.sink = m.sink + for i in range(1, n): + m_n = modules[i] + self.comb += m.source.connect(m_n.sink) + m = m_n + # expose source of last module + # if available + if hasattr(m, "source"): + self.source = m.source + + # XXX