stdlib: Getter method to get monolith range. (#1273)

This change extend the AbstractMemory class to add a getter method that
allows other components to get the memory's range without interleaving.
This method will be useful if other components in the system need to
interleave the memory range different to the way the memory has
interleaved them.
This commit is contained in:
Mahyar Samani
2024-06-21 02:23:58 -07:00
committed by GitHub
parent 590bb1fbbb
commit 18bc5227f6
2 changed files with 12 additions and 0 deletions

View File

@@ -83,6 +83,14 @@ class AbstractMemorySystem(SubSystem):
"""
raise NotImplementedError
@abstractmethod
def get_uninterleaved_range(self) -> List[AddrRange]:
"""Returns the range of the memory system without interleaving.
This is useful when other components in the system want to interleave
the memory range different to how the memory has interleaved them.
"""
raise NotImplementedError
def _post_instantiate(self) -> None:
"""Called to set up anything needed after ``m5.instantiate``."""
pass

View File

@@ -203,3 +203,7 @@ class ChanneledMemory(AbstractMemorySystem):
)
self._mem_range = ranges[0]
self._interleave_addresses()
@overrides(AbstractMemorySystem)
def get_uninterleaved_range(self) -> List[AddrRange]:
return [self._mem_range]