interconnect/axi: Use same default parameters than wishbone.Remapper.

This commit is contained in:
Florent Kermarrec 2024-02-20 16:58:37 +01:00
parent d1e73889f9
commit c0517cd1cf
2 changed files with 6 additions and 2 deletions

View File

@ -144,8 +144,10 @@ class AXIInterface:
class AXIRemapper(LiteXModule): class AXIRemapper(LiteXModule):
"""Remaps AXI addresses by applying an origin offset and address mask.""" """Remaps AXI addresses by applying an origin offset and address mask."""
def __init__(self, master, slave, origin, size): def __init__(self, master, slave, origin=0, size=None):
# Mask. # Mask.
if size is None:
size = 2**master.address_width
mask = 2**int(log2(size)) - 1 mask = 2**int(log2(size)) - 1
# Address Mask and Shift. # Address Mask and Shift.

View File

@ -135,8 +135,10 @@ class AXILiteInterface:
class AXILiteRemapper(LiteXModule): class AXILiteRemapper(LiteXModule):
"""Remaps AXI Lite addresses by applying an origin offset and address mask.""" """Remaps AXI Lite addresses by applying an origin offset and address mask."""
def __init__(self, master, slave, origin, size): def __init__(self, master, slave, origin=0, size=None):
# Mask. # Mask.
if size is None:
size = 2**master.address_width
mask = 2**int(log2(size)) - 1 mask = 2**int(log2(size)) - 1
# Address Mask and Shift. # Address Mask and Shift.