interconnect/axi: add connect_mapped function to map from one address space to another

This commit is contained in:
mkuhn99 2022-11-28 16:35:02 +01:00
parent 310bc777b4
commit a8920c7df8
1 changed files with 7 additions and 0 deletions

View File

@ -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))