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):
|
||||
n = len(modules)
|
||||
m = modules[0]
|
||||
# expose sink of first module
|
||||
# if available
|
||||
# Expose sink of first module if available.
|
||||
if hasattr(m, "sink"):
|
||||
self.sink = m.sink
|
||||
# Iterate on Modules/Endpoints.
|
||||
for i in range(1, n):
|
||||
m_n = modules[i]
|
||||
if isinstance(m, Endpoint):
|
||||
source = m
|
||||
else:
|
||||
source = m.source
|
||||
if isinstance(m_n, Endpoint):
|
||||
sink = m_n
|
||||
else:
|
||||
sink = m_n.sink
|
||||
# If m is an Endpoint, use it as Source, else use Module.source.
|
||||
source = m if isinstance(m, Endpoint) else m.source
|
||||
# If m_n is an Endpoint, use it as Sink, else use Module.sink.
|
||||
sink = m_n if isinstance(m_n, Endpoint) else m_n.sink
|
||||
# Connect Source to Sink (when m is not m_n).
|
||||
if m is not m_n:
|
||||
self.comb += source.connect(sink)
|
||||
# Update m.
|
||||
m = m_n
|
||||
# expose source of last module
|
||||
# if available
|
||||
# Expose source of last module if available.
|
||||
if hasattr(m, "source"):
|
||||
self.source = m.source
|
||||
|
||||
|
|
Loading…
Reference in a new issue