Jason Lowe-Power has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/49346 )

Change subject: configs: Expose the MMU to the board in components
......................................................................

configs: Expose the MMU to the board in components

Change-Id: I30b4736ebe44b8429a32c8951af6e654a1238ae6
Signed-off-by: Jason Lowe-Power <[email protected]>
---
M components_library/processors/abstract_core.py
M components_library/processors/simple_core.py
2 files changed, 14 insertions(+), 1 deletion(-)



diff --git a/components_library/processors/abstract_core.py b/components_library/processors/abstract_core.py
index 35225c1..83060db 100644
--- a/components_library/processors/abstract_core.py
+++ b/components_library/processors/abstract_core.py
@@ -28,7 +28,7 @@
 from typing import Optional
 from .cpu_types import CPUTypes

-from m5.objects import Port, SubSystem
+from m5.objects import BaseMMU, Port, SubSystem


 class AbstractCore(SubSystem):
@@ -91,3 +91,11 @@
         optional ports can be implemented as cache ports.
         """
         raise NotImplementedError
+
+    @abstractmethod
+    def get_mmu(self) -> BaseMMU:
+        """ Return the MMU for this core.
+
+        This is used in the board to setup system-specific MMU settings.
+        """
+        raise NotImplementedError
diff --git a/components_library/processors/simple_core.py b/components_library/processors/simple_core.py
index c093856..8f510e9 100644
--- a/components_library/processors/simple_core.py
+++ b/components_library/processors/simple_core.py
@@ -33,6 +33,7 @@
 from ..utils.override import overrides

 from m5.objects import (
+    BaseMMU,
     Port,
     AtomicSimpleCPU,
     DerivO3CPU,
@@ -96,3 +97,7 @@
             self.core.interrupts[0].pio = interrupt_requestor
             self.core.interrupts[0].int_requestor = interrupt_responce
             self.core.interrupts[0].int_responder = interrupt_requestor
+
+    @overrides(AbstractCore)
+    def get_mmu(self) -> BaseMMU:
+        return self.core.mmu

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/49346
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: I30b4736ebe44b8429a32c8951af6e654a1238ae6
Gerrit-Change-Number: 49346
Gerrit-PatchSet: 1
Gerrit-Owner: Jason Lowe-Power <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to