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

Change subject: stdlib: Add is_switchable() abstract method to AbstractProcessor
......................................................................

stdlib: Add is_switchable() abstract method to AbstractProcessor

Allows other components to know where the processor is a switchable one.

Change-Id: I2174f2493dc1514a3370b99e2fbb8711ad5a9edd
Signed-off-by: Hoa Nguyen <hoangu...@ucdavis.edu>
---
M src/python/gem5/components/processors/abstract_processor.py
M src/python/gem5/components/processors/base_cpu_processor.py
M src/python/gem5/components/processors/switchable_processor.py
3 files changed, 12 insertions(+), 0 deletions(-)



diff --git a/src/python/gem5/components/processors/abstract_processor.py b/src/python/gem5/components/processors/abstract_processor.py
index a0f8b5c..f62f454 100644
--- a/src/python/gem5/components/processors/abstract_processor.py
+++ b/src/python/gem5/components/processors/abstract_processor.py
@@ -72,6 +72,10 @@
         return self._isa

     @abstractmethod
+    def is_switchable(self) -> bool:
+        raise NotImplementedError
+
+    @abstractmethod
     def incorporate_processor(self, board: AbstractBoard) -> None:
         raise NotImplementedError

diff --git a/src/python/gem5/components/processors/base_cpu_processor.py b/src/python/gem5/components/processors/base_cpu_processor.py
index 9a75615..8b169b7 100644
--- a/src/python/gem5/components/processors/base_cpu_processor.py
+++ b/src/python/gem5/components/processors/base_cpu_processor.py
@@ -70,6 +70,10 @@
             self.kvm_vm = KvmVM()

     @overrides(AbstractProcessor)
+    def is_switchable(self) -> bool:
+        return False
+
+    @overrides(AbstractProcessor)
     def incorporate_processor(self, board: AbstractBoard) -> None:

         if any(core.is_kvm_core() for core in self.get_cores()):
diff --git a/src/python/gem5/components/processors/switchable_processor.py b/src/python/gem5/components/processors/switchable_processor.py
index 20754fb..036e391 100644
--- a/src/python/gem5/components/processors/switchable_processor.py
+++ b/src/python/gem5/components/processors/switchable_processor.py
@@ -84,6 +84,10 @@
             self.kvm_vm = KvmVM()

     @overrides(AbstractProcessor)
+    def is_switchable(self):
+        return True
+
+    @overrides(AbstractProcessor)
     def incorporate_processor(self, board: AbstractBoard) -> None:

# This is a bit of a hack. The `m5.switchCpus` function, used in the

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/69837?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: I2174f2493dc1514a3370b99e2fbb8711ad5a9edd
Gerrit-Change-Number: 69837
Gerrit-PatchSet: 1
Gerrit-Owner: Hoa Nguyen <hoangu...@ucdavis.edu>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org

Reply via email to