stdlib: Add get_devices to abstract board

This function returns the GPUs (for now, possibly other devices in the
future). It needs to be in the abstract board so the GPU-specific cache
hierarchies can be used with non-GPU boards.

Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
This commit is contained in:
Jason Lowe-Power
2024-10-31 16:18:00 -07:00
committed by Bobby R. Bruce
parent bec9ae77e6
commit e93f498aac
2 changed files with 10 additions and 0 deletions

View File

@@ -160,6 +160,15 @@ class AbstractBoard:
""" """
return self.cache_line_size return self.cache_line_size
def get_devices(self):
"""Get the devices connected to the board.
Currently, this is only used for GPUs by the ViperBoard.
:returns: The devices connected to the board or None.
"""
return None
def connect_system_port(self, port: Port) -> None: def connect_system_port(self, port: Port) -> None:
self.system_port = port self.system_port = port

View File

@@ -73,6 +73,7 @@ class ViperBoard(X86Board):
self._gpus = gpus self._gpus = gpus
@overrides(AbstractBoard)
def get_devices(self): def get_devices(self):
return self._gpus return self._gpus