mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
soc/interconnect/stream/Pipeline: Improve comments.
This commit is contained in:
parent
b1d8fe61f8
commit
5fd215fe3a
1 changed files with 9 additions and 12 deletions
|
@ -844,25 +844,22 @@ class Pipeline(Module):
|
||||||
def __init__(self, *modules):
|
def __init__(self, *modules):
|
||||||
n = len(modules)
|
n = len(modules)
|
||||||
m = modules[0]
|
m = modules[0]
|
||||||
# expose sink of first module
|
# Expose sink of first module if available.
|
||||||
# if available
|
|
||||||
if hasattr(m, "sink"):
|
if hasattr(m, "sink"):
|
||||||
self.sink = m.sink
|
self.sink = m.sink
|
||||||
|
# Iterate on Modules/Endpoints.
|
||||||
for i in range(1, n):
|
for i in range(1, n):
|
||||||
m_n = modules[i]
|
m_n = modules[i]
|
||||||
if isinstance(m, Endpoint):
|
# If m is an Endpoint, use it as Source, else use Module.source.
|
||||||
source = m
|
source = m if isinstance(m, Endpoint) else m.source
|
||||||
else:
|
# If m_n is an Endpoint, use it as Sink, else use Module.sink.
|
||||||
source = m.source
|
sink = m_n if isinstance(m_n, Endpoint) else m_n.sink
|
||||||
if isinstance(m_n, Endpoint):
|
# Connect Source to Sink (when m is not m_n).
|
||||||
sink = m_n
|
|
||||||
else:
|
|
||||||
sink = m_n.sink
|
|
||||||
if m is not m_n:
|
if m is not m_n:
|
||||||
self.comb += source.connect(sink)
|
self.comb += source.connect(sink)
|
||||||
|
# Update m.
|
||||||
m = m_n
|
m = m_n
|
||||||
# expose source of last module
|
# Expose source of last module if available.
|
||||||
# if available
|
|
||||||
if hasattr(m, "source"):
|
if hasattr(m, "source"):
|
||||||
self.source = m.source
|
self.source = m.source
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue