Use board get_mem_ports consistently (#1509)

Previously, whether the board object or the memory_system returned
the memory ports was not consistent in the cache_hierarchies

This commit makes it consistently use the board. Note: the board
is a better place so it can customize the ports (e.g., add I/O
components or other things.

This commit also makes the arm board consistent with the other
boards and removes the specialized `get_mem_ports` that was not
used.
This commit is contained in:
Jason Lowe-Power
2024-10-09 13:21:28 -07:00
committed by GitHub
parent ee91356632
commit f03dddb458
5 changed files with 12 additions and 8 deletions

View File

@@ -274,11 +274,15 @@ class ArmBoard(ArmSystem, AbstractBoard, KernelDiskWorkload):
@overrides(AbstractBoard)
def get_mem_ports(self) -> Sequence[Tuple[AddrRange, Port]]:
all_ports = [
(self.realview.bootmem.range, self.realview.bootmem.port),
] + self.get_memory().get_mem_ports()
# Note: Ruby needs to create a directory for the realview bootmem
if self.get_cache_hierarchy().is_ruby():
all_ports = [
(self.realview.bootmem.range, self.realview.bootmem.port),
] + self.get_memory().get_mem_ports()
return all_ports
return all_ports
return super().get_mem_ports()
@overrides(AbstractBoard)
def has_io_bus(self) -> bool:

View File

@@ -124,7 +124,7 @@ class NoCache(AbstractClassicCacheHierarchy):
# Set up the system port for functional access from the simulator.
board.connect_system_port(self.membus.cpu_side_ports)
for _, port in board.get_memory().get_mem_ports():
for _, port in board.get_mem_ports():
self.membus.mem_side_ports = port
def _setup_coherent_io_bridge(self, board: AbstractBoard) -> None:

View File

@@ -96,7 +96,7 @@ class PrivateL1CacheHierarchy(AbstractClassicCacheHierarchy):
# Set up the system port for functional access from the simulator.
board.connect_system_port(self.membus.cpu_side_ports)
for _, port in board.get_memory().get_mem_ports():
for _, port in board.get_mem_ports():
self.membus.mem_side_ports = port
self.l1icaches = [

View File

@@ -126,7 +126,7 @@ class PrivateL1PrivateL2CacheHierarchy(
# Set up the system port for functional access from the simulator.
board.connect_system_port(self.membus.cpu_side_ports)
for _, port in board.get_memory().get_mem_ports():
for _, port in board.get_mem_ports():
self.membus.mem_side_ports = port
self.l2buses = [

View File

@@ -119,7 +119,7 @@ class PrivateL1SharedL2CacheHierarchy(
# Set up the system port for functional access from the simulator.
board.connect_system_port(self.membus.cpu_side_ports)
for _, port in board.get_memory().get_mem_ports():
for _, port in board.get_mem_ports():
self.membus.mem_side_ports = port
self.l1icaches = [