Merge pull request #1 from JoyBed/patch-2

Add connect_mapped function
This commit is contained in:
JoyBed 2024-06-16 18:57:24 +02:00 committed by GitHub
commit 73e0d15da0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 0 deletions

View File

@ -137,6 +137,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))