From fe18397accdcc7eb0647eea64b9e6eed45d8c0a0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Robert=20J=C3=B6rdens?= Date: Mon, 22 Jul 2013 02:12:50 -0600 Subject: [PATCH] wishbone.py: add Crossbar (concurrent/parallel/many-to-many interconnect) --- migen/bus/wishbone.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/migen/bus/wishbone.py b/migen/bus/wishbone.py index ecb19f49..7fc1b521 100644 --- a/migen/bus/wishbone.py +++ b/migen/bus/wishbone.py @@ -98,6 +98,18 @@ class InterconnectShared(Module): self.submodules += Arbiter(masters, shared) self.submodules += Decoder(shared, slaves, register) +class Crossbar(Module): + def __init__(self, masters, slaves, register=False): + matches, busses = zip(*slaves) + access = [[Interface() for j in slaves] for i in masters] + # decode each master into its access row + for row, master in zip(access, masters): + row = list(zip(matches, row)) + self.submodules += Decoder(master, row, register) + # arbitrate each access column onto its slave + for column, bus in zip(zip(*access), busses): + self.submodules += Arbiter(column, bus) + class Tap(Module): def __init__(self, bus, handler=print): self.bus = bus -- 2.30.2