stdlib: Mv setup_board/setup_mem_ranges calls to set_fs

This change allows for the `_setup_memory_range` and `_setup_board`
functions to know if the board is to run a FS or SE workload, thus
allowing for a baord to handle both cases considerably easier than
before. With this change all functions are called after FS or SE
is declared via the `_set_fullsystem` function and thus all can
accomodate for SE and FS workloads.
This commit is contained in:
Bobby R. Bruce
2024-10-09 05:06:13 -07:00
parent 7c83e3379b
commit 11fa0ac9a5

View File

@@ -118,12 +118,6 @@ class AbstractBoard:
# Simulator module.
self._checkpoint = None
# Setup the board and memory system's memory ranges.
self._setup_memory_ranges()
# Setup board properties unique to the board being constructed.
self._setup_board()
# A private variable to record whether `_connect_things` has been
# been called.
self._connect_things_called = False
@@ -195,6 +189,9 @@ class AbstractBoard:
"""
self._is_fs = is_fs
self._setup_memory_ranges()
self._setup_board()
def is_fullsystem(self) -> bool:
"""
Returns ``True`` if the board is to be run in FS mode. Otherwise the board
@@ -253,11 +250,14 @@ class AbstractBoard:
@abstractmethod
def _setup_board(self) -> None:
"""
This function is called in the AbstractBoard constructor, before the
memory, processor, and cache hierarchy components are incorporated via
``_connect_thing()``, but after the ``_setup_memory_ranges()`` function.
This function should be overridden by boards to specify components,
connections unique to that board.
This function is called at the end of `_set_fullsystem`. The reason for
this is the board's configuraiton varies significantly depending on
whether it is to be run in FS or SE mode. This function is therefore
called when a workload is set --- after construction but before
`_pre_instantiate` is called.
As `_setup_memory_ranges()` is set in the constructor, this function
can be considered to have been called prior to `_setup_board
"""
raise NotImplementedError
@@ -331,10 +331,18 @@ class AbstractBoard:
"""
Set the memory ranges for this board and memory system.
This is called in the constructor, prior to ``_setup_board`` and
``_connect_things``. It should query the board's memory to determine the
size and the set the memory ranges on the memory system and on the
board.
This is called at the end of the `_set_fullsystem` function but before
`_setup_board`. `_set_fullsystem` is called when the workload is
declared. It is before `_pre_instantiate` (but, obviously after
construction).
It should query the board's memory
to determine the size and the set the memory ranges on the memory
system and on the board.
As thisis called at the end of `_set_fullsystem`, the board's memory
can be setup differently depending on whether the board is to be run in
FS or SE mode.
The simplest implementation sets the board's memory range to the size
of memory and memory system's range to be the same as the board. Full