interconnect/stream: add missing part of Demultiplexer
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Sun, 4 Oct 2015 22:10:55 +0000 (00:10 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Sun, 4 Oct 2015 22:10:55 +0000 (00:10 +0200)
misoc/interconnect/stream.py

index bdbe53a4c703b364707cba1a3f07fcbaf8ab6354..58e35bde0f77500217481addd3bae71299adf7b9 100644 (file)
@@ -142,3 +142,10 @@ class Demultiplexer(Module):
             setattr(self, "source"+str(i), source)
             sources.append(source)
         self.sel = Signal(max=n)
+
+        # # #
+
+        cases = {}
+        for i, source in enumerate(sources):
+            cases[i] = Record.connect(self.sink, source)
+        self.comb += Case(self.sel, cases)