From 2db57d4be3ba22c9ac2720ab3fa13f3e94b92e99 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Mon, 9 May 2022 10:29:15 +0200 Subject: [PATCH] interconnect: Add name parameter to Wishbone/AXI SRAMs nad use it in add_ram to improve generated memory names. --- litex/soc/integration/soc.py | 2 +- litex/soc/interconnect/axi.py | 4 ++-- litex/soc/interconnect/wishbone.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/litex/soc/integration/soc.py b/litex/soc/integration/soc.py index c78f4f77e..5132b6059 100644 --- a/litex/soc/integration/soc.py +++ b/litex/soc/integration/soc.py @@ -851,7 +851,7 @@ class SoC(Module): "axi-lite": axi.AXILiteInterface, }[self.bus.standard] ram_bus = interface_cls(data_width=self.bus.data_width, bursting=self.bus.bursting) - ram = ram_cls(size, bus=ram_bus, init=contents, read_only=(mode == "r")) + ram = ram_cls(size, bus=ram_bus, init=contents, read_only=(mode == "r"), name=name) self.bus.add_slave(name, ram.bus, SoCRegion(origin=origin, size=size, mode=mode)) self.check_if_exists(name) self.logger.info("RAM {} {} {}.".format( diff --git a/litex/soc/interconnect/axi.py b/litex/soc/interconnect/axi.py index de1547b5b..4d24f77af 100644 --- a/litex/soc/interconnect/axi.py +++ b/litex/soc/interconnect/axi.py @@ -795,7 +795,7 @@ class AXILite2CSR(Module): # AXILite SRAM ------------------------------------------------------------------------------------- class AXILiteSRAM(Module): - def __init__(self, mem_or_size, read_only=None, init=None, bus=None): + def __init__(self, mem_or_size, read_only=None, init=None, bus=None, name=None): if bus is None: bus = AXILiteInterface() self.bus = bus @@ -805,7 +805,7 @@ class AXILiteSRAM(Module): assert(mem_or_size.width <= bus_data_width) self.mem = mem_or_size else: - self.mem = Memory(bus_data_width, mem_or_size//(bus_data_width//8), init=init) + self.mem = Memory(bus_data_width, mem_or_size//(bus_data_width//8), init=init, name=name) if read_only is None: if hasattr(self.mem, "bus_read_only"): diff --git a/litex/soc/interconnect/wishbone.py b/litex/soc/interconnect/wishbone.py index 99059df36..bae02accd 100644 --- a/litex/soc/interconnect/wishbone.py +++ b/litex/soc/interconnect/wishbone.py @@ -344,7 +344,7 @@ class Converter(Module): # Wishbone SRAM ------------------------------------------------------------------------------------ class SRAM(Module): - def __init__(self, mem_or_size, read_only=None, init=None, bus=None): + def __init__(self, mem_or_size, read_only=None, init=None, bus=None, name=None): if bus is None: bus = Interface() self.bus = bus @@ -353,7 +353,7 @@ class SRAM(Module): assert(mem_or_size.width <= bus_data_width) self.mem = mem_or_size else: - self.mem = Memory(bus_data_width, mem_or_size//(bus_data_width//8), init=init) + self.mem = Memory(bus_data_width, mem_or_size//(bus_data_width//8), init=init, name=name) if read_only is None: if hasattr(self.mem, "bus_read_only"):