mem-ruby: changes to MESIThreeLevel, MIExample, OctopiCache

This commit changes MESIThreeLevel, MIExample, and OctopiCache
so they work with this PR. It also adds MESIThreeLevel and
OctopiCache to the testlib tests.
This commit is contained in:
Erin Le
2024-10-31 15:20:29 -07:00
committed by Bobby R. Bruce
parent 8fe1228f3e
commit 2ee40f1c11
11 changed files with 109 additions and 31 deletions

View File

@@ -149,16 +149,21 @@ PySource('gem5.components.cachehierarchies.ruby.caches.mesi_three_level',
PySource('gem5.components.cachehierarchies.ruby.caches.mesi_three_level',
'gem5/components/cachehierarchies/ruby/caches/mesi_three_level/'
'l3_cache.py')
PySource('gem5.components.cachehierarchies.ruby.caches.mesi_three_level',
PySource('gem5.components.cachehierarchies.ruby.caches.prebuilt',
'gem5/components/cachehierarchies/ruby/caches/prebuilt/__init__.py')
PySource('gem5.components.cachehierarchies.ruby.caches.prebuilt.octopi_cache',
'gem5/components/cachehierarchies/ruby/caches/prebuilt/octopi_cache/'
'__init__.py')
PySource('gem5.components.cachehierarchies.ruby.caches.prebuilt.octopi_cache',
'gem5/components/cachehierarchies/ruby/caches/prebuilt/octopi_cache/'
'octopi.py')
PySource('gem5.components.cachehierarchies.ruby.caches.mesi_three_level',
PySource('gem5.components.cachehierarchies.ruby.caches.prebuilt.octopi_cache',
'gem5/components/cachehierarchies/ruby/caches/prebuilt/octopi_cache/'
'core_complex.py')
PySource('gem5.components.cachehierarchies.ruby.caches.mesi_three_level',
PySource('gem5.components.cachehierarchies.ruby.caches.prebuilt.octopi_cache',
'gem5/components/cachehierarchies/ruby/caches/prebuilt/octopi_cache/'
'octopi_network.py')
PySource('gem5.components.cachehierarchies.ruby.caches.mesi_three_level',
PySource('gem5.components.cachehierarchies.ruby.caches.prebuilt.octopi_cache',
'gem5/components/cachehierarchies/ruby/caches/prebuilt/octopi_cache/'
'ruby_network_components.py')
PySource('gem5.components.cachehierarchies.ruby.caches.mi_example',

View File

@@ -25,23 +25,29 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from m5.objects import (
MESI_Three_Level_Directory_Controller,
MessageBuffer,
RubyDirectoryMemory,
)
from ......utils.override import overrides
from ..abstract_directory import AbstractDirectory
class Directory(AbstractDirectory):
class Directory(MESI_Three_Level_Directory_Controller):
@classmethod
def versionCount(cls):
cls._version += 1 # Use count for this particular type
return cls._version - 1
def __init__(self, network, cache_line_size, mem_range, port):
super().__init__(network, cache_line_size)
super().__init__()
self.version = self.versionCount()
self.addr_ranges = [mem_range]
self.directory = RubyDirectoryMemory(block_size=cache_line_size)
# Connect this directory to the memory side.
self.memory_out_port = port
self.connectQueues(network=network)
@overrides(AbstractDirectory)
def connectQueues(self, network):
self.requestToDir = MessageBuffer()
self.requestToDir.in_port = network.out_port

View File

@@ -25,14 +25,12 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from m5.objects import (
DMA_Controller,
MESI_Three_Level_DMA_Controller,
MessageBuffer,
)
from ......utils.override import overrides
class DMAController(DMA_Controller):
class DMAController(MESI_Three_Level_DMA_Controller):
_version = 0
@classmethod

View File

@@ -29,7 +29,7 @@ import math
from m5.objects import (
LRURP,
ClockDomain,
L0Cache_Controller,
MESI_Three_Level_L0Cache_Controller,
MessageBuffer,
RubyCache,
RubyPrefetcher,
@@ -42,7 +42,7 @@ from .....processors.abstract_core import AbstractCore
# L0Cache_Controller is the ruby backend's terminology corresponding to
# L1 cache in stdlib terms.
class L1Cache(L0Cache_Controller):
class L1Cache(MESI_Three_Level_L0Cache_Controller):
_version = 0
@classmethod

View File

@@ -28,7 +28,7 @@ import math
from m5.objects import (
ClockDomain,
L1Cache_Controller,
MESI_Three_Level_L1Cache_Controller,
MessageBuffer,
RubyCache,
RubyPrefetcher,
@@ -41,7 +41,7 @@ from .....processors.abstract_core import AbstractCore
# L1Cache_Controller is ruby backend's terminology corresponding to
# L2Cache in stdlib's terms
class L2Cache(L1Cache_Controller):
class L2Cache(MESI_Three_Level_L1Cache_Controller):
_version = 0
@classmethod

View File

@@ -27,7 +27,7 @@
import math
from m5.objects import (
L2Cache_Controller,
MESI_Three_Level_L2Cache_Controller,
MessageBuffer,
RubyCache,
)
@@ -35,7 +35,7 @@ from m5.objects import (
# L2Cache_Controller is ruby backend's terminology corresponding to
# L3 cache in stdlib.
class L3Cache(L2Cache_Controller):
class L3Cache(MESI_Three_Level_L2Cache_Controller):
_version = 0
@classmethod

View File

@@ -67,7 +67,6 @@ class L1Cache(MI_example_L1Cache_Controller):
self.clk_domain = clk_domain
self.send_evictions = core.requires_send_evicts()
@overrides(AbstractL1Cache)
def connectQueues(self, network):
self.mandatoryQueue = MessageBuffer()
self.requestFromCache = MessageBuffer(ordered=True)

View File

@@ -0,0 +1,25 @@
# Copyright (c) 2022-2023 The Regents of the University of California
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer;
# redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution;
# neither the name of the copyright holders nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -30,24 +30,24 @@ from m5.objects import (
RubySystem,
)
from ....coherence_protocol import CoherenceProtocol
from ....utils.override import overrides
from ....utils.requires import requires
from .......coherence_protocol import CoherenceProtocol
from .......utils.override import overrides
from .......utils.requires import requires
requires(coherence_protocol_required=CoherenceProtocol.MI_EXAMPLE)
requires(coherence_protocol_required=CoherenceProtocol.MESI_THREE_LEVEL)
from ......components.boards.abstract_board import AbstractBoard
from ......components.cachehierarchies.ruby.caches.mesi_three_level.directory import (
from .......components.boards.abstract_board import AbstractBoard
from .......components.cachehierarchies.ruby.caches.mesi_three_level.directory import (
Directory,
)
from ......components.cachehierarchies.ruby.caches.mesi_three_level.dma_controller import (
from .......components.cachehierarchies.ruby.caches.mesi_three_level.dma_controller import (
DMAController,
)
from ....abstract_cache_hierarchy import AbstractCacheHierarchy
from ....abstract_three_level_cache_hierarchy import (
from .....abstract_cache_hierarchy import AbstractCacheHierarchy
from .....abstract_three_level_cache_hierarchy import (
AbstractThreeLevelCacheHierarchy,
)
from ...abstract_ruby_cache_hierarchy import AbstractRubyCacheHierarchy
from ....abstract_ruby_cache_hierarchy import AbstractRubyCacheHierarchy
from .core_complex import CoreComplex
from .octopi_network import OctopiNetwork
from .ruby_network_components import (

View File

@@ -151,6 +151,39 @@ def cache_factory(cache_class: str):
size="16KiB",
assoc=8,
)
elif cache_class == "MESIThreeLevel":
from gem5.components.cachehierarchies.ruby.mesi_three_level_cache_hierarchy import (
MESIThreeLevelCacheHierarchy,
)
return MESIThreeLevelCacheHierarchy(
l1i_size="32KiB",
l1i_assoc="8",
l1d_size="32KiB",
l1d_assoc="8",
l2_size="256KiB",
l2_assoc="4",
l3_size="16MiB",
l3_assoc="16",
num_l3_banks=1,
)
elif cache_class == "OctopiCache":
from gem5.components.cachehierarchies.ruby.caches.prebuilt.octopi_cache.octopi import (
OctopiCache,
)
return OctopiCache(
l1i_size="32KiB",
l1i_assoc=8,
l1d_size="32KiB",
l1d_assoc=8,
l2_size="256KiB",
l2_assoc=4,
l3_size="16MiB",
l3_assoc=16,
num_core_complexes=1,
is_fullsystem=False,
)
else:
raise ValueError(f"The cache class {cache_class} is not supported.")
@@ -188,6 +221,8 @@ parser.add_argument(
"MESITwoLevel",
"MIExample",
"CHIL1",
"MESIThreeLevel",
"OctopiCache",
],
)

View File

@@ -77,13 +77,23 @@ def test_memory(
config_args=[generator, generator_cores, cache, module]
+ [memory]
+ list(args),
valid_isas=(constants.all_compiled_tag,),
valid_isas=(constants.null_all_ruby,),
valid_hosts=constants.supported_hosts,
length=constants.quick_tag,
)
cache_classes = ["NoCache", "PrivateL1", "PrivateL1PrivateL2", "MESITwoLevel"]
cache_classes = [
"NoCache",
"PrivateL1",
"PrivateL1PrivateL2",
"MESITwoLevel",
"MIExample",
"CHIL1",
"MESIThreeLevel",
"OctopiCache",
]
memory_classes = [
"SingleChannelDDR3_1600",
"SingleChannelDDR3_2133",