soc/interconnect/stream: Support n=1 case on Multiplexer/Demultiplexer.

Required by LiteSPI when only one Core is connected to the PHY (ex when disabling Master or MMAP).
This commit is contained in:
Florent Kermarrec 2021-07-27 16:57:08 +02:00
parent 94c934d2fb
commit 80e9d2cea9
1 changed files with 2 additions and 2 deletions

View File

@ -266,7 +266,7 @@ class Multiplexer(Module):
sink = Endpoint(layout)
setattr(self, "sink"+str(i), sink)
sinks.append(sink)
self.sel = Signal(max=n)
self.sel = Signal(max=max(n, 2))
# # #
@ -284,7 +284,7 @@ class Demultiplexer(Module):
source = Endpoint(layout)
setattr(self, "source"+str(i), source)
sources.append(source)
self.sel = Signal(max=n)
self.sel = Signal(max=max(n, 2))
# # #