stdlib: use atomic_noncaching when using AtomicSimpleCPU with Ruby

mem_mode is supposed to be atomic_noncaching when running
AtomicSimpleCPU with Ruby cache.

Change-Id: Icb419f9370038f5c1f80dd879b187338279a5b93
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/68877
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Hoa Nguyen
2023-03-10 23:52:57 -08:00
parent 6841e1aa5a
commit 3fe129e8ea
2 changed files with 11 additions and 0 deletions

View File

@@ -97,6 +97,7 @@ class BaseCPUProcessor(AbstractProcessor):
"'atomic_noncaching' memory mode. This will skip caching "
"completely."
)
board.set_mem_mode(MemMode.ATOMIC_NONCACHING)
else:
board.set_mem_mode(MemMode.ATOMIC)
else:

View File

@@ -103,6 +103,16 @@ class SimpleSwitchableProcessor(SwitchableProcessor):
def incorporate_processor(self, board: AbstractBoard) -> None:
super().incorporate_processor(board=board)
if (
board.get_cache_hierarchy().is_ruby()
and self._mem_mode == MemMode.ATOMIC
):
warn(
"Using an atomic core with Ruby will result in "
"'atomic_noncaching' memory mode. This will skip caching "
"completely."
)
self._mem_mode = MemMode.ATOMIC_NONCACHING
board.set_mem_mode(self._mem_mode)
def switch(self):