Prefetcher.py revision 13735
112339Sjason@lowepower.com# Copyright (c) 2012, 2014 ARM Limited
212339Sjason@lowepower.com# All rights reserved.
312339Sjason@lowepower.com#
412339Sjason@lowepower.com# The license below extends only to copyright in the software and shall
512339Sjason@lowepower.com# not be construed as granting a license to any other intellectual
612339Sjason@lowepower.com# property including but not limited to intellectual property relating
712339Sjason@lowepower.com# to a hardware implementation of the functionality of the software
812339Sjason@lowepower.com# licensed hereunder.  You may use the software subject to the license
912339Sjason@lowepower.com# terms below provided that you ensure that this notice is replicated
1012339Sjason@lowepower.com# unmodified and in its entirety in all distributions of the software,
1112339Sjason@lowepower.com# modified or unmodified, in source code or in binary form.
1212339Sjason@lowepower.com#
1312339Sjason@lowepower.com# Copyright (c) 2005 The Regents of The University of Michigan
1412339Sjason@lowepower.com# All rights reserved.
1512339Sjason@lowepower.com#
1612339Sjason@lowepower.com# Redistribution and use in source and binary forms, with or without
1712339Sjason@lowepower.com# modification, are permitted provided that the following conditions are
1812339Sjason@lowepower.com# met: redistributions of source code must retain the above copyright
1912339Sjason@lowepower.com# notice, this list of conditions and the following disclaimer;
2012339Sjason@lowepower.com# redistributions in binary form must reproduce the above copyright
2112339Sjason@lowepower.com# notice, this list of conditions and the following disclaimer in the
2212339Sjason@lowepower.com# documentation and/or other materials provided with the distribution;
2312339Sjason@lowepower.com# neither the name of the copyright holders nor the names of its
2412339Sjason@lowepower.com# contributors may be used to endorse or promote products derived from
2512339Sjason@lowepower.com# this software without specific prior written permission.
2612339Sjason@lowepower.com#
2712339Sjason@lowepower.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
2812339Sjason@lowepower.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
2912339Sjason@lowepower.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3012339Sjason@lowepower.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3112339Sjason@lowepower.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3212339Sjason@lowepower.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3312339Sjason@lowepower.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3412339Sjason@lowepower.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3512339Sjason@lowepower.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3612339Sjason@lowepower.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3712339Sjason@lowepower.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3812339Sjason@lowepower.com#
3912339Sjason@lowepower.com# Authors: Ron Dreslinski
4012339Sjason@lowepower.com#          Mitch Hayenga
4112339Sjason@lowepower.com
4212339Sjason@lowepower.comfrom m5.SimObject import *
4312339Sjason@lowepower.comfrom m5.params import *
4412339Sjason@lowepower.comfrom m5.proxy import *
4512339Sjason@lowepower.com
4612339Sjason@lowepower.comfrom m5.objects.ClockedObject import ClockedObject
4712339Sjason@lowepower.comfrom m5.objects.IndexingPolicies import *
4812339Sjason@lowepower.comfrom m5.objects.ReplacementPolicies import *
4912339Sjason@lowepower.com
5012339Sjason@lowepower.comclass HWPProbeEvent(object):
5112339Sjason@lowepower.com    def __init__(self, prefetcher, obj, *listOfNames):
5212339Sjason@lowepower.com        self.obj = obj
5312339Sjason@lowepower.com        self.prefetcher = prefetcher
5412339Sjason@lowepower.com        self.names = listOfNames
5512339Sjason@lowepower.com
5612339Sjason@lowepower.com    def register(self):
5712339Sjason@lowepower.com        if self.obj:
5812339Sjason@lowepower.com            for name in self.names:
5912339Sjason@lowepower.com                self.prefetcher.getCCObject().addEventProbe(
6012339Sjason@lowepower.com                    self.obj.getCCObject(), name)
6112339Sjason@lowepower.com
6212339Sjason@lowepower.comclass BasePrefetcher(ClockedObject):
6312339Sjason@lowepower.com    type = 'BasePrefetcher'
6412339Sjason@lowepower.com    abstract = True
6512339Sjason@lowepower.com    cxx_header = "mem/cache/prefetch/base.hh"
6612339Sjason@lowepower.com    cxx_exports = [
6712339Sjason@lowepower.com        PyBindMethod("addEventProbe"),
6812339Sjason@lowepower.com    ]
6912339Sjason@lowepower.com    sys = Param.System(Parent.any, "System this prefetcher belongs to")
7012339Sjason@lowepower.com
7112339Sjason@lowepower.com    # Get the block size from the parent (system)
7212339Sjason@lowepower.com    block_size = Param.Int(Parent.cache_line_size, "Block size in bytes")
7312339Sjason@lowepower.com
7412339Sjason@lowepower.com    on_miss = Param.Bool(False, "Only notify prefetcher on misses")
7512339Sjason@lowepower.com    on_read = Param.Bool(True, "Notify prefetcher on reads")
7612339Sjason@lowepower.com    on_write = Param.Bool(True, "Notify prefetcher on writes")
7712339Sjason@lowepower.com    on_data  = Param.Bool(True, "Notify prefetcher on data accesses")
7812339Sjason@lowepower.com    on_inst  = Param.Bool(True, "Notify prefetcher on instruction accesses")
7912339Sjason@lowepower.com    prefetch_on_access = Param.Bool(Parent.prefetch_on_access,
8012339Sjason@lowepower.com        "Notify the hardware prefetcher on every access (not just misses)")
8112339Sjason@lowepower.com    use_virtual_addresses = Param.Bool(False,
8212339Sjason@lowepower.com        "Use virtual addresses for prefetching")
8312339Sjason@lowepower.com
8412339Sjason@lowepower.com    _events = []
8512339Sjason@lowepower.com    def addEvent(self, newObject):
8612339Sjason@lowepower.com        self._events.append(newObject)
8712339Sjason@lowepower.com
8812339Sjason@lowepower.com    # Override the normal SimObject::regProbeListeners method and
8912339Sjason@lowepower.com    # register deferred event handlers.
9012339Sjason@lowepower.com    def regProbeListeners(self):
9112339Sjason@lowepower.com        for event in self._events:
9212339Sjason@lowepower.com           event.register()
9312339Sjason@lowepower.com        self.getCCObject().regProbeListeners()
9412339Sjason@lowepower.com
9512339Sjason@lowepower.com    def listenFromProbe(self, simObj, *probeNames):
9612339Sjason@lowepower.com        if not isinstance(simObj, SimObject):
9712339Sjason@lowepower.com            raise TypeError("argument must be of SimObject type")
9812339Sjason@lowepower.com        if len(probeNames) <= 0:
9912339Sjason@lowepower.com            raise TypeError("probeNames must have at least one element")
10012339Sjason@lowepower.com        self.addEvent(HWPProbeEvent(self, simObj, *probeNames))
10112339Sjason@lowepower.com
10212339Sjason@lowepower.comclass QueuedPrefetcher(BasePrefetcher):
10312339Sjason@lowepower.com    type = "QueuedPrefetcher"
10412339Sjason@lowepower.com    abstract = True
10512339Sjason@lowepower.com    cxx_class = "QueuedPrefetcher"
10612339Sjason@lowepower.com    cxx_header = "mem/cache/prefetch/queued.hh"
10712339Sjason@lowepower.com    latency = Param.Int(1, "Latency for generated prefetches")
10812339Sjason@lowepower.com    queue_size = Param.Int(32, "Maximum number of queued prefetches")
10912339Sjason@lowepower.com    queue_squash = Param.Bool(True, "Squash queued prefetch on demand access")
11012339Sjason@lowepower.com    queue_filter = Param.Bool(True, "Don't queue redundant prefetches")
11112339Sjason@lowepower.com    cache_snoop = Param.Bool(False, "Snoop cache to eliminate redundant request")
11212339Sjason@lowepower.com
11312339Sjason@lowepower.com    tag_prefetch = Param.Bool(True, "Tag prefetch with PC of generating access")
11412339Sjason@lowepower.com
11512339Sjason@lowepower.comclass StridePrefetcher(QueuedPrefetcher):
11612339Sjason@lowepower.com    type = 'StridePrefetcher'
11712339Sjason@lowepower.com    cxx_class = 'StridePrefetcher'
11812339Sjason@lowepower.com    cxx_header = "mem/cache/prefetch/stride.hh"
11912339Sjason@lowepower.com
12012339Sjason@lowepower.com    # Do not consult stride prefetcher on instruction accesses
12112339Sjason@lowepower.com    on_inst = False
12212339Sjason@lowepower.com
12312339Sjason@lowepower.com    max_conf = Param.Int(7, "Maximum confidence level")
12412339Sjason@lowepower.com    thresh_conf = Param.Int(4, "Threshold confidence level")
12512339Sjason@lowepower.com    min_conf = Param.Int(0, "Minimum confidence level")
12612339Sjason@lowepower.com    start_conf = Param.Int(4, "Starting confidence for new entries")
12712339Sjason@lowepower.com
12812339Sjason@lowepower.com    table_sets = Param.Int(16, "Number of sets in PC lookup table")
12912339Sjason@lowepower.com    table_assoc = Param.Int(4, "Associativity of PC lookup table")
13012339Sjason@lowepower.com    use_master_id = Param.Bool(True, "Use master id based history")
13112339Sjason@lowepower.com
13212339Sjason@lowepower.com    degree = Param.Int(4, "Number of prefetches to generate")
13312339Sjason@lowepower.com
13412339Sjason@lowepower.com    # Get replacement policy
13512339Sjason@lowepower.com    replacement_policy = Param.BaseReplacementPolicy(RandomRP(),
13612339Sjason@lowepower.com        "Replacement policy")
13712339Sjason@lowepower.com
13812339Sjason@lowepower.comclass TaggedPrefetcher(QueuedPrefetcher):
13912339Sjason@lowepower.com    type = 'TaggedPrefetcher'
14012339Sjason@lowepower.com    cxx_class = 'TaggedPrefetcher'
14112339Sjason@lowepower.com    cxx_header = "mem/cache/prefetch/tagged.hh"
14212339Sjason@lowepower.com
14312339Sjason@lowepower.com    degree = Param.Int(2, "Number of prefetches to generate")
14412339Sjason@lowepower.com
14512339Sjason@lowepower.comclass SignaturePathPrefetcher(QueuedPrefetcher):
14612339Sjason@lowepower.com    type = 'SignaturePathPrefetcher'
14712339Sjason@lowepower.com    cxx_class = 'SignaturePathPrefetcher'
14812339Sjason@lowepower.com    cxx_header = "mem/cache/prefetch/signature_path.hh"
14912339Sjason@lowepower.com
15012339Sjason@lowepower.com    signature_shift = Param.UInt8(3,
15112339Sjason@lowepower.com        "Number of bits to shift when calculating a new signature");
15212339Sjason@lowepower.com    signature_bits = Param.UInt16(12,
15312339Sjason@lowepower.com        "Size of the signature, in bits");
15412339Sjason@lowepower.com    signature_table_entries = Param.MemorySize("1024",
15512339Sjason@lowepower.com        "Number of entries of the signature table")
15612339Sjason@lowepower.com    signature_table_assoc = Param.Unsigned(2,
15712339Sjason@lowepower.com        "Associativity of the signature table")
15812339Sjason@lowepower.com    signature_table_indexing_policy = Param.BaseIndexingPolicy(
15912339Sjason@lowepower.com        SetAssociative(entry_size = 1, assoc = Parent.signature_table_assoc,
16012339Sjason@lowepower.com        size = Parent.signature_table_entries),
16112339Sjason@lowepower.com        "Indexing policy of the signature table")
16212339Sjason@lowepower.com    signature_table_replacement_policy = Param.BaseReplacementPolicy(LRURP(),
16312339Sjason@lowepower.com        "Replacement policy of the signature table")
16412339Sjason@lowepower.com
16512339Sjason@lowepower.com    max_counter_value = Param.UInt8(7, "Maximum pattern counter value")
16612339Sjason@lowepower.com    pattern_table_entries = Param.MemorySize("4096",
16712339Sjason@lowepower.com        "Number of entries of the pattern table")
16812339Sjason@lowepower.com    pattern_table_assoc = Param.Unsigned(1,
16912339Sjason@lowepower.com        "Associativity of the pattern table")
17012339Sjason@lowepower.com    strides_per_pattern_entry = Param.Unsigned(4,
17112339Sjason@lowepower.com        "Number of strides stored in each pattern entry")
17212339Sjason@lowepower.com    pattern_table_indexing_policy = Param.BaseIndexingPolicy(
17312339Sjason@lowepower.com        SetAssociative(entry_size = 1, assoc = Parent.pattern_table_assoc,
17412339Sjason@lowepower.com        size = Parent.pattern_table_entries),
17512339Sjason@lowepower.com        "Indexing policy of the pattern table")
17612339Sjason@lowepower.com    pattern_table_replacement_policy = Param.BaseReplacementPolicy(LRURP(),
17712339Sjason@lowepower.com        "Replacement policy of the pattern table")
17812339Sjason@lowepower.com
17912339Sjason@lowepower.com    prefetch_confidence_threshold = Param.Float(0.5,
18012339Sjason@lowepower.com        "Minimum confidence to issue prefetches")
18112339Sjason@lowepower.com    lookahead_confidence_threshold = Param.Float(0.75,
18212339Sjason@lowepower.com        "Minimum confidence to continue exploring lookahead entries")
18312339Sjason@lowepower.com
18412339Sjason@lowepower.comclass SignaturePathPrefetcherV2(SignaturePathPrefetcher):
18512339Sjason@lowepower.com    type = 'SignaturePathPrefetcherV2'
18612339Sjason@lowepower.com    cxx_class = 'SignaturePathPrefetcherV2'
18712339Sjason@lowepower.com    cxx_header = "mem/cache/prefetch/signature_path_v2.hh"
18812339Sjason@lowepower.com
18912339Sjason@lowepower.com    signature_table_entries = "256"
19012339Sjason@lowepower.com    signature_table_assoc = 1
19112339Sjason@lowepower.com    pattern_table_entries = "512"
19212339Sjason@lowepower.com    pattern_table_assoc = 1
19312339Sjason@lowepower.com    max_counter_value = 15
19412339Sjason@lowepower.com    prefetch_confidence_threshold = 0.25
19512339Sjason@lowepower.com    lookahead_confidence_threshold = 0.25
19612339Sjason@lowepower.com
19712339Sjason@lowepower.com    global_history_register_entries = Param.MemorySize("8",
19812339Sjason@lowepower.com        "Number of entries of global history register")
19912339Sjason@lowepower.com    global_history_register_indexing_policy = Param.BaseIndexingPolicy(
20012339Sjason@lowepower.com        SetAssociative(entry_size = 1,
20112339Sjason@lowepower.com        assoc = Parent.global_history_register_entries,
20212339Sjason@lowepower.com        size = Parent.global_history_register_entries),
20312339Sjason@lowepower.com        "Indexing policy of the global history register")
20412339Sjason@lowepower.com    global_history_register_replacement_policy = Param.BaseReplacementPolicy(
20512339Sjason@lowepower.com        LRURP(), "Replacement policy of the global history register")
20612339Sjason@lowepower.com
20712339Sjason@lowepower.comclass AccessMapPatternMatching(ClockedObject):
20812339Sjason@lowepower.com    type = 'AccessMapPatternMatching'
20912339Sjason@lowepower.com    cxx_class = 'AccessMapPatternMatching'
21012339Sjason@lowepower.com    cxx_header = "mem/cache/prefetch/access_map_pattern_matching.hh"
21112339Sjason@lowepower.com
21212339Sjason@lowepower.com    block_size = Param.Unsigned(Parent.block_size,
21312339Sjason@lowepower.com        "Cacheline size used by the prefetcher using this object")
21412339Sjason@lowepower.com
21512339Sjason@lowepower.com    limit_stride = Param.Unsigned(0,
21612339Sjason@lowepower.com        "Limit the strides checked up to -X/X, if 0, disable the limit")
21712339Sjason@lowepower.com    start_degree = Param.Unsigned(4,
21812339Sjason@lowepower.com        "Initial degree (Maximum number of prefetches generated")
21912339Sjason@lowepower.com    hot_zone_size = Param.MemorySize("2kB", "Memory covered by a hot zone")
22012339Sjason@lowepower.com    access_map_table_entries = Param.MemorySize("256",
22112339Sjason@lowepower.com        "Number of entries in the access map table")
22212339Sjason@lowepower.com    access_map_table_assoc = Param.Unsigned(8,
22312339Sjason@lowepower.com        "Associativity of the access map table")
22412339Sjason@lowepower.com    access_map_table_indexing_policy = Param.BaseIndexingPolicy(
22512339Sjason@lowepower.com        SetAssociative(entry_size = 1, assoc = Parent.access_map_table_assoc,
22612339Sjason@lowepower.com        size = Parent.access_map_table_entries),
22712339Sjason@lowepower.com        "Indexing policy of the access map table")
22812339Sjason@lowepower.com    access_map_table_replacement_policy = Param.BaseReplacementPolicy(LRURP(),
22912339Sjason@lowepower.com        "Replacement policy of the access map table")
23012339Sjason@lowepower.com    high_coverage_threshold = Param.Float(0.25,
23112339Sjason@lowepower.com        "A prefetch coverage factor bigger than this is considered high")
23212339Sjason@lowepower.com    low_coverage_threshold = Param.Float(0.125,
23312339Sjason@lowepower.com        "A prefetch coverage factor smaller than this is considered low")
23412339Sjason@lowepower.com    high_accuracy_threshold = Param.Float(0.5,
23512339Sjason@lowepower.com        "A prefetch accuracy factor bigger than this is considered high")
23612339Sjason@lowepower.com    low_accuracy_threshold = Param.Float(0.25,
23712339Sjason@lowepower.com        "A prefetch accuracy factor smaller than this is considered low")
23812339Sjason@lowepower.com    high_cache_hit_threshold = Param.Float(0.875,
23912339Sjason@lowepower.com        "A cache hit ratio bigger than this is considered high")
24012339Sjason@lowepower.com    low_cache_hit_threshold = Param.Float(0.75,
24112339Sjason@lowepower.com        "A cache hit ratio smaller than this is considered low")
24212339Sjason@lowepower.com    epoch_cycles = Param.Cycles(256000, "Cycles in an epoch period")
24312339Sjason@lowepower.com    offchip_memory_latency = Param.Latency("30ns",
24412339Sjason@lowepower.com        "Memory latency used to compute the required memory bandwidth")
24512339Sjason@lowepower.com
24612339Sjason@lowepower.comclass AMPMPrefetcher(QueuedPrefetcher):
24712339Sjason@lowepower.com    type = 'AMPMPrefetcher'
24812339Sjason@lowepower.com    cxx_class = 'AMPMPrefetcher'
24912339Sjason@lowepower.com    cxx_header = "mem/cache/prefetch/access_map_pattern_matching.hh"
25012339Sjason@lowepower.com    ampm = Param.AccessMapPatternMatching( AccessMapPatternMatching(),
25112339Sjason@lowepower.com        "Access Map Pattern Matching object")
25212339Sjason@lowepower.com
25312339Sjason@lowepower.comclass DeltaCorrelatingPredictionTables(SimObject):
25412339Sjason@lowepower.com    type = 'DeltaCorrelatingPredictionTables'
25512339Sjason@lowepower.com    cxx_class = 'DeltaCorrelatingPredictionTables'
25612339Sjason@lowepower.com    cxx_header = "mem/cache/prefetch/delta_correlating_prediction_tables.hh"
25712339Sjason@lowepower.com    deltas_per_entry = Param.Unsigned(20,
25812339Sjason@lowepower.com        "Number of deltas stored in each table entry")
25912339Sjason@lowepower.com    delta_bits = Param.Unsigned(12, "Bits per delta")
26012339Sjason@lowepower.com    delta_mask_bits = Param.Unsigned(8,
26112339Sjason@lowepower.com        "Lower bits to mask when comparing deltas")
26212339Sjason@lowepower.com    table_entries = Param.MemorySize("128",
26312339Sjason@lowepower.com        "Number of entries in the table")
26412339Sjason@lowepower.com    table_assoc = Param.Unsigned(128,
26512339Sjason@lowepower.com        "Associativity of the table")
26612339Sjason@lowepower.com    table_indexing_policy = Param.BaseIndexingPolicy(
26712339Sjason@lowepower.com        SetAssociative(entry_size = 1, assoc = Parent.table_assoc,
26812339Sjason@lowepower.com        size = Parent.table_entries),
26912339Sjason@lowepower.com        "Indexing policy of the table")
27012339Sjason@lowepower.com    table_replacement_policy = Param.BaseReplacementPolicy(LRURP(),
27112339Sjason@lowepower.com        "Replacement policy of the table")
27212339Sjason@lowepower.com
27312339Sjason@lowepower.comclass DCPTPrefetcher(QueuedPrefetcher):
27412339Sjason@lowepower.com    type = 'DCPTPrefetcher'
27512339Sjason@lowepower.com    cxx_class = 'DCPTPrefetcher'
27612339Sjason@lowepower.com    cxx_header = "mem/cache/prefetch/delta_correlating_prediction_tables.hh"
27712339Sjason@lowepower.com    dcpt = Param.DeltaCorrelatingPredictionTables(
27812339Sjason@lowepower.com        DeltaCorrelatingPredictionTables(),
27912339Sjason@lowepower.com        "Delta Correlating Prediction Tables object")
28012339Sjason@lowepower.com
28112339Sjason@lowepower.comclass IrregularStreamBufferPrefetcher(QueuedPrefetcher):
28212339Sjason@lowepower.com    type = "IrregularStreamBufferPrefetcher"
28312339Sjason@lowepower.com    cxx_class = "IrregularStreamBufferPrefetcher"
28412339Sjason@lowepower.com    cxx_header = "mem/cache/prefetch/irregular_stream_buffer.hh"
28512339Sjason@lowepower.com
28612339Sjason@lowepower.com    max_counter_value = Param.Unsigned(3,
28712339Sjason@lowepower.com        "Maximum value of the confidence counter")
28812339Sjason@lowepower.com    chunk_size = Param.Unsigned(256,
28912339Sjason@lowepower.com        "Maximum number of addresses in a temporal stream")
29012339Sjason@lowepower.com    degree = Param.Unsigned(4, "Number of prefetches to generate")
29112339Sjason@lowepower.com    training_unit_assoc = Param.Unsigned(128,
29212339Sjason@lowepower.com        "Associativity of the training unit")
29312339Sjason@lowepower.com    training_unit_entries = Param.MemorySize("128",
29412339Sjason@lowepower.com        "Number of entries of the training unit")
29512339Sjason@lowepower.com    training_unit_indexing_policy = Param.BaseIndexingPolicy(
29612339Sjason@lowepower.com        SetAssociative(entry_size = 1, assoc = Parent.training_unit_assoc,
29712339Sjason@lowepower.com        size = Parent.training_unit_entries),
29812339Sjason@lowepower.com        "Indexing policy of the training unit")
29912339Sjason@lowepower.com    training_unit_replacement_policy = Param.BaseReplacementPolicy(LRURP(),
30012339Sjason@lowepower.com        "Replacement policy of the training unit")
30112339Sjason@lowepower.com
30212339Sjason@lowepower.com    prefetch_candidates_per_entry = Param.Unsigned(16,
30312339Sjason@lowepower.com        "Number of prefetch candidates stored in a SP-AMC entry")
30412339Sjason@lowepower.com    address_map_cache_assoc = Param.Unsigned(128,
30512339Sjason@lowepower.com        "Associativity of the PS/SP AMCs")
30612339Sjason@lowepower.com    address_map_cache_entries = Param.MemorySize("128",
30712339Sjason@lowepower.com        "Number of entries of the PS/SP AMCs")
30812339Sjason@lowepower.com    ps_address_map_cache_indexing_policy = Param.BaseIndexingPolicy(
30912339Sjason@lowepower.com        SetAssociative(entry_size = 1,
31012339Sjason@lowepower.com        assoc = Parent.address_map_cache_assoc,
31112339Sjason@lowepower.com        size = Parent.address_map_cache_entries),
31212339Sjason@lowepower.com        "Indexing policy of the Physical-to-Structural Address Map Cache")
31312339Sjason@lowepower.com    ps_address_map_cache_replacement_policy = Param.BaseReplacementPolicy(
31412339Sjason@lowepower.com        LRURP(),
31512339Sjason@lowepower.com        "Replacement policy of the Physical-to-Structural Address Map Cache")
31612339Sjason@lowepower.com    sp_address_map_cache_indexing_policy = Param.BaseIndexingPolicy(
31712339Sjason@lowepower.com        SetAssociative(entry_size = 1,
31812339Sjason@lowepower.com        assoc = Parent.address_map_cache_assoc,
31912339Sjason@lowepower.com        size = Parent.address_map_cache_entries),
32012339Sjason@lowepower.com        "Indexing policy of the Structural-to-Physical Address Mao Cache")
32112339Sjason@lowepower.com    sp_address_map_cache_replacement_policy = Param.BaseReplacementPolicy(
32212339Sjason@lowepower.com        LRURP(),
32312339Sjason@lowepower.com        "Replacement policy of the Structural-to-Physical Address Map Cache")
32412339Sjason@lowepower.com
32512339Sjason@lowepower.comclass SlimAccessMapPatternMatching(AccessMapPatternMatching):
32612339Sjason@lowepower.com    start_degree = 2
32712339Sjason@lowepower.com    limit_stride = 4
32812339Sjason@lowepower.com
32912339Sjason@lowepower.comclass SlimDeltaCorrelatingPredictionTables(DeltaCorrelatingPredictionTables):
33012339Sjason@lowepower.com    table_entries = "256"
33112339Sjason@lowepower.com    table_assoc = 256
33212339Sjason@lowepower.com    deltas_per_entry = 9
33312339Sjason@lowepower.com
33412339Sjason@lowepower.comclass SlimAMPMPrefetcher(QueuedPrefetcher):
33512339Sjason@lowepower.com    type = 'SlimAMPMPrefetcher'
33612339Sjason@lowepower.com    cxx_class = 'SlimAMPMPrefetcher'
33712339Sjason@lowepower.com    cxx_header = "mem/cache/prefetch/slim_ampm.hh"
33812339Sjason@lowepower.com
33912339Sjason@lowepower.com    ampm = Param.AccessMapPatternMatching(SlimAccessMapPatternMatching(),
34012339Sjason@lowepower.com        "Access Map Pattern Matching object")
34112339Sjason@lowepower.com    dcpt = Param.DeltaCorrelatingPredictionTables(
34212339Sjason@lowepower.com        SlimDeltaCorrelatingPredictionTables(),
34312339Sjason@lowepower.com        "Delta Correlating Prediction Tables object")
34412339Sjason@lowepower.com
34512339Sjason@lowepower.comclass BOPPrefetcher(QueuedPrefetcher):
34612339Sjason@lowepower.com    type = "BOPPrefetcher"
34712339Sjason@lowepower.com    cxx_class = "BOPPrefetcher"
34812339Sjason@lowepower.com    cxx_header = "mem/cache/prefetch/bop.hh"
34912339Sjason@lowepower.com    score_max = Param.Unsigned(31, "Max. score to update the best offset")
35012339Sjason@lowepower.com    round_max = Param.Unsigned(100, "Max. round to update the best offset")
35112339Sjason@lowepower.com    bad_score = Param.Unsigned(10, "Score at which the HWP is disabled")
35212339Sjason@lowepower.com    rr_size = Param.Unsigned(64, "Number of entries of each RR bank")
35312339Sjason@lowepower.com    tag_bits = Param.Unsigned(12, "Bits used to store the tag")
35412339Sjason@lowepower.com    offset_list_size = Param.Unsigned(46,
35512339Sjason@lowepower.com                "Number of entries in the offsets list")
35612339Sjason@lowepower.com    negative_offsets_enable = Param.Bool(True,
35712339Sjason@lowepower.com                "Initialize the offsets list also with negative values \
35812339Sjason@lowepower.com                (i.e. the table will have half of the entries with positive \
35912339Sjason@lowepower.com                offsets and the other half with negative ones)")
36012339Sjason@lowepower.com    delay_queue_enable = Param.Bool(True, "Enable the delay queue")
36112339Sjason@lowepower.com    delay_queue_size = Param.Unsigned(15,
36212339Sjason@lowepower.com                "Number of entries in the delay queue")
36312339Sjason@lowepower.com    delay_queue_cycles = Param.Cycles(60,
36412339Sjason@lowepower.com                "Cycles to delay a write in the left RR table from the delay \
36512339Sjason@lowepower.com                queue")
36612339Sjason@lowepower.com
36712339Sjason@lowepower.comclass SBOOEPrefetcher(QueuedPrefetcher):
36812339Sjason@lowepower.com    type = 'SBOOEPrefetcher'
36912339Sjason@lowepower.com    cxx_class = 'SBOOEPrefetcher'
37012339Sjason@lowepower.com    cxx_header = "mem/cache/prefetch/sbooe.hh"
37112339Sjason@lowepower.com    latency_buffer_size = Param.Int(32, "Entries in the latency buffer")
37212339Sjason@lowepower.com    sequential_prefetchers = Param.Int(9, "Number of sequential prefetchers")
37312339Sjason@lowepower.com    sandbox_entries = Param.Int(1024, "Size of the address buffer")
37412339Sjason@lowepower.com    score_threshold_pct = Param.Percent(25, "Min. threshold to issue a \
37512339Sjason@lowepower.com        prefetch. The value is the percentage of sandbox entries to use")
37612339Sjason@lowepower.com