Prefetcher.py revision 10052
16145SN/A# Copyright (c) 2012 ARM Limited
28683SN/A# All rights reserved.
36145SN/A#
46145SN/A# The license below extends only to copyright in the software and shall
56145SN/A# not be construed as granting a license to any other intellectual
66145SN/A# property including but not limited to intellectual property relating
76145SN/A# to a hardware implementation of the functionality of the software
86145SN/A# licensed hereunder.  You may use the software subject to the license
96145SN/A# terms below provided that you ensure that this notice is replicated
106145SN/A# unmodified and in its entirety in all distributions of the software,
116145SN/A# modified or unmodified, in source code or in binary form.
126145SN/A#
136145SN/A# Copyright (c) 2005 The Regents of The University of Michigan
146145SN/A# All rights reserved.
156145SN/A#
166145SN/A# Redistribution and use in source and binary forms, with or without
176145SN/A# modification, are permitted provided that the following conditions are
186145SN/A# met: redistributions of source code must retain the above copyright
196145SN/A# notice, this list of conditions and the following disclaimer;
206145SN/A# redistributions in binary form must reproduce the above copyright
216145SN/A# notice, this list of conditions and the following disclaimer in the
226145SN/A# documentation and/or other materials provided with the distribution;
236145SN/A# neither the name of the copyright holders nor the names of its
246145SN/A# contributors may be used to endorse or promote products derived from
256145SN/A# this software without specific prior written permission.
266145SN/A#
276145SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
286145SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
2910441Snilay@cs.wisc.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3010441Snilay@cs.wisc.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
316145SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
327055SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
336145SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
346145SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
357039SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
369104SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3710301Snilay@cs.wisc.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
389105SN/A#
398174SN/A# Authors: Ron Dreslinski
407039SN/A
417039SN/Afrom ClockedObject import ClockedObject
427039SN/Afrom m5.params import *
4310301Snilay@cs.wisc.edufrom m5.proxy import *
4410301Snilay@cs.wisc.edu
4510301Snilay@cs.wisc.educlass BasePrefetcher(ClockedObject):
4610301Snilay@cs.wisc.edu    type = 'BasePrefetcher'
477039SN/A    abstract = True
487039SN/A    cxx_header = "mem/cache/prefetch/base.hh"
496145SN/A    size = Param.Int(100,
507039SN/A         "Number of entries in the hardware prefetch queue")
517039SN/A    cross_pages = Param.Bool(False,
527039SN/A         "Allow prefetches to cross virtual page boundaries")
536876SN/A    serial_squash = Param.Bool(False,
547039SN/A         "Squash prefetches with a later time on a subsequent miss")
557039SN/A    degree = Param.Int(1,
566145SN/A         "Degree of the prefetch depth")
577039SN/A    latency = Param.Cycles('1', "Latency of the prefetcher")
586145SN/A    use_master_id = Param.Bool(True,
597039SN/A         "Use the master id to separate calculations of prefetches")
607039SN/A    data_accesses_only = Param.Bool(False,
618165SN/A         "Only prefetch on data not on instruction accesses")
627039SN/A    on_miss_only = Param.Bool(False,
636145SN/A         "Only prefetch on miss (as opposed to always)")
647039SN/A    on_read_only = Param.Bool(False,
658165SN/A         "Only prefetch on read requests (write requests ignored)")
667039SN/A    on_prefetch = Param.Bool(True,
676145SN/A         "Let lower cache prefetcher train on prefetch requests")
687039SN/A    sys = Param.System(Parent.any, "System this device belongs to")
697039SN/A
706145SN/Aclass GHBPrefetcher(BasePrefetcher):
717039SN/A    type = 'GHBPrefetcher'
727039SN/A    cxx_class = 'GHBPrefetcher'
737039SN/A    cxx_header = "mem/cache/prefetch/ghb.hh"
747039SN/A
756145SN/Aclass StridePrefetcher(BasePrefetcher):
767039SN/A    type = 'StridePrefetcher'
777839SN/A    cxx_class = 'StridePrefetcher'
788193SN/A    cxx_header = "mem/cache/prefetch/stride.hh"
798193SN/A
808193SN/Aclass TaggedPrefetcher(BasePrefetcher):
818193SN/A    type = 'TaggedPrefetcher'
826145SN/A    cxx_class = 'TaggedPrefetcher'
837039SN/A    cxx_header = "mem/cache/prefetch/tagged.hh"
847039SN/A
856145SN/A
867039SN/A
877039SN/A
886145SN/A