diff --git a/components_library/processors/abstract_core.py b/components_library/processors/abstract_core.py index 35225c1eb5..83060db59e 100644 --- a/components_library/processors/abstract_core.py +++ b/components_library/processors/abstract_core.py @@ -28,7 +28,7 @@ from abc import ABCMeta, abstractmethod 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 @@ class AbstractCore(SubSystem): 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 c093856782..8f510e9670 100644 --- a/components_library/processors/simple_core.py +++ b/components_library/processors/simple_core.py @@ -33,6 +33,7 @@ from ..isas import ISA from ..utils.override import overrides from m5.objects import ( + BaseMMU, Port, AtomicSimpleCPU, DerivO3CPU, @@ -96,3 +97,7 @@ class SimpleCore(AbstractCore): 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