inteconnect/axi_lite/wishbone SRAM: Switch back to LiteXModule and add autocsr_exclude on mem to avoid AutoCSR to collect it.

Also cleanup self.mem.get_port call.
This commit is contained in:
Florent Kermarrec 2024-05-16 10:36:07 +02:00
parent c0d9224f09
commit fbf03ec74c
2 changed files with 14 additions and 6 deletions

View File

@ -218,7 +218,8 @@ def axi_lite_to_simple(axi_lite, port_adr, port_dat_r, port_dat_w=None, port_we=
# AXI-Lite SRAM ------------------------------------------------------------------------------------
class AXILiteSRAM(Module):
class AXILiteSRAM(LiteXModule):
autocsr_exclude = {"mem"}
def __init__(self, mem_or_size, read_only=None, init=None, bus=None, name=None):
if bus is None:
bus = AXILiteInterface()
@ -240,8 +241,11 @@ class AXILiteSRAM(Module):
# # #
# Create memory port
port = self.mem.get_port(write_capable=not read_only, we_granularity=8,
mode=READ_FIRST if read_only else WRITE_FIRST)
port = self.mem.get_port(
write_capable = not read_only,
we_granularity = 8,
mode = READ_FIRST if read_only else WRITE_FIRST,
)
self.specials += self.mem, port
# Generate write enable signal

View File

@ -450,7 +450,8 @@ class Converter(LiteXModule):
# Wishbone SRAM ------------------------------------------------------------------------------------
class SRAM(Module): # FIXME: Switch to LiteXModule.
class SRAM(LiteXModule):
autocsr_exclude = {"mem"}
def __init__(self, mem_or_size, read_only=None, write_only=None, init=None, bus=None, name=None):
if bus is None:
bus = Interface(data_width=32, address_width=32, addressing="word")
@ -545,8 +546,11 @@ class SRAM(Module): # FIXME: Switch to LiteXModule.
# Memory.
# -------
port = self.mem.get_port(write_capable=not read_only, we_granularity=8,
mode=READ_FIRST if read_only else WRITE_FIRST)
port = self.mem.get_port(
write_capable = not read_only,
we_granularity = 8,
mode = READ_FIRST if read_only else WRITE_FIRST,
)
self.specials += self.mem, port
# Generate write enable signal
if not read_only: