interconnect: Add name parameter to Wishbone/AXI SRAMs nad use it in add_ram to improve generated memory names.
This commit is contained in:
parent
7370a9fe6f
commit
2db57d4be3
|
@ -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(
|
||||
|
|
|
@ -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"):
|
||||
|
|
|
@ -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"):
|
||||
|
|
Loading…
Reference in New Issue