crossbar/LiteEthCrossbar: Allow dispatch_param to be a Signal to allow dynamic configuration from design.
This commit is contained in:
parent
e340428384
commit
e0124748aa
|
@ -30,8 +30,6 @@ class LiteEthCrossbar(Module):
|
||||||
# RX dispatch
|
# RX dispatch
|
||||||
sources = [port.source for port in self.users.values()]
|
sources = [port.source for port in self.users.values()]
|
||||||
self.submodules.dispatcher = Dispatcher(self.master.sink, sources, one_hot=True)
|
self.submodules.dispatcher = Dispatcher(self.master.sink, sources, one_hot=True)
|
||||||
cases = {}
|
dispatch_sig = getattr(self.master.sink, self.dispatch_param)
|
||||||
cases["default"] = self.dispatcher.sel.eq(0)
|
|
||||||
for i, (k, v) in enumerate(self.users.items()):
|
for i, (k, v) in enumerate(self.users.items()):
|
||||||
cases[k] = self.dispatcher.sel.eq(2**i)
|
self.comb += If(dispatch_sig == k, self.dispatcher.sel.eq(2**i))
|
||||||
self.comb += Case(getattr(self.master.sink, self.dispatch_param), cases)
|
|
||||||
|
|
Loading…
Reference in New Issue