stdlib: address requested changes to X86, Riscv boards

This commit addresses the requested changes. An additional
comment is added for clarification, the exception type is
changed, and a few of the error messages have been
modified.
This commit is contained in:
Erin Le
2024-10-28 15:00:19 -07:00
parent 7b7f5ef34a
commit 11dd2c6c09
2 changed files with 21 additions and 18 deletions

View File

@@ -147,6 +147,7 @@ class RiscvBoard(AbstractSystemBoard, KernelDiskWorkload, SEBinaryWorkload):
self._off_chip_devices = [self.platform.uart, self.disk, self.rng]
else:
# SE mode board setup
pass
def _setup_io_devices(self) -> None:
@@ -213,9 +214,9 @@ class RiscvBoard(AbstractSystemBoard, KernelDiskWorkload, SEBinaryWorkload):
@overrides(AbstractSystemBoard)
def get_dma_ports(self) -> List[Port]:
raise NotImplementedError(
"RISCVBoard does not have DMA Ports. "
"Use `has_dma_ports()` to check this."
raise Exception(
"Cannot execute `get_dma_ports()`: Board does not have DMA ports "
"to return. Use `has_dma_ports()` to check this."
)
@overrides(AbstractSystemBoard)
@@ -227,9 +228,9 @@ class RiscvBoard(AbstractSystemBoard, KernelDiskWorkload, SEBinaryWorkload):
if self.has_io_bus():
return self.iobus
else:
raise NotImplementedError(
"Board was not configured for FS mode and does not have an "
"I/O bus. Use `has_io_bus()` to check this."
raise Exception(
"Cannot execute `get_io_bus()`: Board does not have an I/O "
"bus to return. Use `has_io_bus()` to check this."
)
@overrides(AbstractSystemBoard)
@@ -241,9 +242,10 @@ class RiscvBoard(AbstractSystemBoard, KernelDiskWorkload, SEBinaryWorkload):
if self.has_coherent_io():
return self.iobus.mem_side_ports
else:
raise NotImplementedError(
"Board was not configured for FS mode and does not have any "
"I/O ports. Use has_coherent_io to check this."
raise Exception(
"Cannot execute `get_mem_side_coherent_io_port()`: Board does "
"not have any I/O ports to return. Use `has_coherent_io()` to "
"check this."
)
@overrides(AbstractSystemBoard)

View File

@@ -300,9 +300,9 @@ class X86Board(AbstractSystemBoard, KernelDiskWorkload, SEBinaryWorkload):
if self.has_io_bus():
return self.iobus
else:
raise NotImplementedError(
"Board was not configured for FS mode and does not have an "
"I/O bus. Use `has_io_bus()` to check this."
raise Exception(
"Cannot execute `get_io_bus()`: Board does not have an I/O "
"bus to return. Use `has_io_bus()` to check this."
)
@overrides(AbstractSystemBoard)
@@ -314,9 +314,9 @@ class X86Board(AbstractSystemBoard, KernelDiskWorkload, SEBinaryWorkload):
if self.has_dma_ports():
return [self.pc.south_bridge.ide.dma, self.iobus.mem_side_ports]
else:
raise NotImplementedError(
"Board was not configured for FS mode and does not have DMA "
"ports. Use `has_dma_ports()` to check this."
raise Exception(
"Cannot execute `get_dma_ports()`: Board does not have DMA "
"ports to return. Use `has_dma_ports()` to check this."
)
@overrides(AbstractSystemBoard)
@@ -328,9 +328,10 @@ class X86Board(AbstractSystemBoard, KernelDiskWorkload, SEBinaryWorkload):
if self.has_coherent_io():
return self.iobus.mem_side_ports
else:
raise NotImplementedError(
"Board was not configured for FS mode and does not have I/O "
"ports. Use has_coherent_io to check this."
raise Exception(
"Cannot execute `get_mem_side_coherent_io_port()`: Board does "
"not have I/O ports to return. Use `has_coherent_io()` to "
"check this."
)
@overrides(AbstractSystemBoard)