From 61be01ebd47313dee6d4fe4cf05d65ee5a24e09d Mon Sep 17 00:00:00 2001 From: Alan Green Date: Fri, 4 Nov 2022 04:09:16 +1100 Subject: [PATCH] litex/soc: update API to avoid unfortunate terms Provides an alternate API to some functions of the SoCBusHandler and bus Arbiter classes to allow users of the API to avoid the terms 'master' and 'slave' in certain situations. Signed-off-by: Alan Green --- litex/soc/integration/soc.py | 6 ++++++ litex/soc/interconnect/wishbone.py | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/litex/soc/integration/soc.py b/litex/soc/integration/soc.py index 87aa67d67..f6ffd945a 100755 --- a/litex/soc/integration/soc.py +++ b/litex/soc/integration/soc.py @@ -416,6 +416,9 @@ class SoCBusHandler(LiteXModule): colorer(name, color="underline"), colorer("added", color="green"))) + def add_controller(self, name=None, controller=None): + self.add_master(self, name=name, master=controller) + def add_slave(self, name=None, slave=None, region=None): no_name = name is None no_region = region is None @@ -448,6 +451,9 @@ class SoCBusHandler(LiteXModule): colorer(name, color="underline"), colorer("added", color="green"))) + def add_peripheral(self, name=None, peripheral=None, region=None): + self.add_slave(self, name=name, slave=peripheral, region=region) + def get_address_width(self, standard): standard_from = self.standard standard_to = standard diff --git a/litex/soc/interconnect/wishbone.py b/litex/soc/interconnect/wishbone.py index 32559d301..00a9f917c 100644 --- a/litex/soc/interconnect/wishbone.py +++ b/litex/soc/interconnect/wishbone.py @@ -149,7 +149,12 @@ class InterconnectPointToPoint(Module): class Arbiter(Module): - def __init__(self, masters, target): + def __init__(self, masters=None, target=None, controllers=None): + assert target is not None + assert (masters is not None) or (controllers is not None) + if controllers is not None: + masters = controllers + self.submodules.rr = roundrobin.RoundRobin(len(masters)) # mux master->slave signals