From e0124748aac976fa4e16963e5928934859d61d3b Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Wed, 26 Jan 2022 10:51:03 +0100 Subject: [PATCH] crossbar/LiteEthCrossbar: Allow dispatch_param to be a Signal to allow dynamic configuration from design. --- liteeth/crossbar.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/liteeth/crossbar.py b/liteeth/crossbar.py index b43e637..7772749 100644 --- a/liteeth/crossbar.py +++ b/liteeth/crossbar.py @@ -30,8 +30,6 @@ class LiteEthCrossbar(Module): # RX dispatch sources = [port.source for port in self.users.values()] self.submodules.dispatcher = Dispatcher(self.master.sink, sources, one_hot=True) - cases = {} - cases["default"] = self.dispatcher.sel.eq(0) + dispatch_sig = getattr(self.master.sink, self.dispatch_param) for i, (k, v) in enumerate(self.users.items()): - cases[k] = self.dispatcher.sel.eq(2**i) - self.comb += Case(getattr(self.master.sink, self.dispatch_param), cases) + self.comb += If(dispatch_sig == k, self.dispatcher.sel.eq(2**i))