From a8920c7df819384fdb6f723c3e61db138f67e4cb Mon Sep 17 00:00:00 2001 From: mkuhn99 Date: Mon, 28 Nov 2022 16:35:02 +0100 Subject: [PATCH] interconnect/axi: add connect_mapped function to map from one address space to another --- litex/soc/interconnect/axi/axi_full.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/litex/soc/interconnect/axi/axi_full.py b/litex/soc/interconnect/axi/axi_full.py index 5611edb2c..5705b6175 100644 --- a/litex/soc/interconnect/axi/axi_full.py +++ b/litex/soc/interconnect/axi/axi_full.py @@ -131,6 +131,13 @@ class AXIInterface: def connect(self, slave, **kwargs): return connect_axi(self, slave, **kwargs) + def connect_mapped(self, slave, map_fct): + comb = [] + comb += self.connect(slave, omit={"addr"}) + comb += [slave.ar.addr.eq(map_fct(self.ar.addr))] + comb += [slave.aw.addr.eq(map_fct(self.aw.addr))] + return comb + def layout_flat(self): return list(axi_layout_flat(self))