gem5-dev@gem5.org

The gem5 Developer List

View all threads

[XS] Change in gem5/gem5[develop]: stdlib: use atomic_noncaching when using AtomicSimpleCPU with Ruby

HN
Hoa Nguyen (Gerrit)
Sat, Mar 11, 2023 9:25 AM

Hoa Nguyen has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/68877?usp=email )

Change subject: stdlib: use atomic_noncaching when using AtomicSimpleCPU
with Ruby
......................................................................

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

M src/python/gem5/components/processors/base_cpu_processor.py
M src/python/gem5/components/processors/simple_switchable_processor.py
2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/python/gem5/components/processors/base_cpu_processor.py
b/src/python/gem5/components/processors/base_cpu_processor.py
index d311a0f..9a75615 100644
--- a/src/python/gem5/components/processors/base_cpu_processor.py
+++ b/src/python/gem5/components/processors/base_cpu_processor.py
@@ -97,6 +97,7 @@
"'atomic_noncaching' memory mode. This will skip
caching "
"completely."
)

  •            board.set_mem_mode(MemMode.ATOMIC_NONCACHING)
            else:
                board.set_mem_mode(MemMode.ATOMIC)
        else:
    

diff --git
a/src/python/gem5/components/processors/simple_switchable_processor.py
b/src/python/gem5/components/processors/simple_switchable_processor.py
index 56603fa..bfeb9bc 100644
--- a/src/python/gem5/components/processors/simple_switchable_processor.py
+++ b/src/python/gem5/components/processors/simple_switchable_processor.py
@@ -103,6 +103,11 @@
def incorporate_processor(self, board: AbstractBoard) -> None:
super().incorporate_processor(board=board)

  •    # special case:
    
  •    # ruby cache doesn't support "atomic" mem mode; however, ruby cache
    
  •    # supports "atomic_noncaching" mem mode, which bypasses the cache.
    
  •    if board.get_cache_hierarchy().is_ruby() and self._mem_mode =  
    

MemMode.ATOMIC:

  •        self._mem_mode = MemMode.ATOMIC_NONCACHING
        board.set_mem_mode(self._mem_mode)
    
    def switch(self):
    

--
To view, visit
https://gem5-review.googlesource.com/c/public/gem5/+/68877?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Icb419f9370038f5c1f80dd879b187338279a5b93
Gerrit-Change-Number: 68877
Gerrit-PatchSet: 1
Gerrit-Owner: Hoa Nguyen hoanguyen@ucdavis.edu
Gerrit-MessageType: newchange

Hoa Nguyen has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/68877?usp=email ) Change subject: stdlib: use atomic_noncaching when using AtomicSimpleCPU with Ruby ...................................................................... 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> --- M src/python/gem5/components/processors/base_cpu_processor.py M src/python/gem5/components/processors/simple_switchable_processor.py 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/src/python/gem5/components/processors/base_cpu_processor.py b/src/python/gem5/components/processors/base_cpu_processor.py index d311a0f..9a75615 100644 --- a/src/python/gem5/components/processors/base_cpu_processor.py +++ b/src/python/gem5/components/processors/base_cpu_processor.py @@ -97,6 +97,7 @@ "'atomic_noncaching' memory mode. This will skip caching " "completely." ) + board.set_mem_mode(MemMode.ATOMIC_NONCACHING) else: board.set_mem_mode(MemMode.ATOMIC) else: diff --git a/src/python/gem5/components/processors/simple_switchable_processor.py b/src/python/gem5/components/processors/simple_switchable_processor.py index 56603fa..bfeb9bc 100644 --- a/src/python/gem5/components/processors/simple_switchable_processor.py +++ b/src/python/gem5/components/processors/simple_switchable_processor.py @@ -103,6 +103,11 @@ def incorporate_processor(self, board: AbstractBoard) -> None: super().incorporate_processor(board=board) + # special case: + # ruby cache doesn't support "atomic" mem mode; however, ruby cache + # supports "atomic_noncaching" mem mode, which bypasses the cache. + if board.get_cache_hierarchy().is_ruby() and self._mem_mode = MemMode.ATOMIC: + self._mem_mode = MemMode.ATOMIC_NONCACHING board.set_mem_mode(self._mem_mode) def switch(self): -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/68877?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: Icb419f9370038f5c1f80dd879b187338279a5b93 Gerrit-Change-Number: 68877 Gerrit-PatchSet: 1 Gerrit-Owner: Hoa Nguyen <hoanguyen@ucdavis.edu> Gerrit-MessageType: newchange