soc/interconnect/stream: improve Pipeline to allow passing endpoints
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Sat, 28 Nov 2015 17:31:47 +0000 (18:31 +0100)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Sat, 28 Nov 2015 17:31:47 +0000 (18:31 +0100)
litex/soc/interconnect/stream.py

index 89231d1ddb7d3c018c955dafda162fc79bcd9b24..45a3ccd39c9ffc91bf09c67c7170d580a1547a74 100644 (file)
@@ -478,7 +478,16 @@ class Pipeline(Module):
             self.sink = m.sink
         for i in range(1, n):
             m_n = modules[i]
-            self.comb += m.source.connect(m_n.sink)
+            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 not m_n:
+                self.comb += Record.connect(source, sink)
             m = m_n
         # expose source of last module
         # if available