mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
interconnect/axi: add connect_mapped function to map from one address space to another
This commit is contained in:
parent
310bc777b4
commit
a8920c7df8
1 changed files with 7 additions and 0 deletions
|
@ -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))
|
||||
|
||||
|
|
Loading…
Reference in a new issue