112600Sodanrc@yahoo.com.br# Copyright (c) 2018 Inria
212600Sodanrc@yahoo.com.br# All rights reserved.
312600Sodanrc@yahoo.com.br#
412600Sodanrc@yahoo.com.br# Redistribution and use in source and binary forms, with or without
512600Sodanrc@yahoo.com.br# modification, are permitted provided that the following conditions are
612600Sodanrc@yahoo.com.br# met: redistributions of source code must retain the above copyright
712600Sodanrc@yahoo.com.br# notice, this list of conditions and the following disclaimer;
812600Sodanrc@yahoo.com.br# redistributions in binary form must reproduce the above copyright
912600Sodanrc@yahoo.com.br# notice, this list of conditions and the following disclaimer in the
1012600Sodanrc@yahoo.com.br# documentation and/or other materials provided with the distribution;
1112600Sodanrc@yahoo.com.br# neither the name of the copyright holders nor the names of its
1212600Sodanrc@yahoo.com.br# contributors may be used to endorse or promote products derived from
1312600Sodanrc@yahoo.com.br# this software without specific prior written permission.
1412600Sodanrc@yahoo.com.br#
1512600Sodanrc@yahoo.com.br# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1612600Sodanrc@yahoo.com.br# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1712600Sodanrc@yahoo.com.br# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1812600Sodanrc@yahoo.com.br# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1912600Sodanrc@yahoo.com.br# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2012600Sodanrc@yahoo.com.br# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2112600Sodanrc@yahoo.com.br# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2212600Sodanrc@yahoo.com.br# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2312600Sodanrc@yahoo.com.br# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2412600Sodanrc@yahoo.com.br# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2512600Sodanrc@yahoo.com.br# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2612600Sodanrc@yahoo.com.br#
2712600Sodanrc@yahoo.com.br# Authors: Daniel Carvalho
2812600Sodanrc@yahoo.com.br
2912600Sodanrc@yahoo.com.brfrom m5.params import *
3012600Sodanrc@yahoo.com.brfrom m5.proxy import *
3112600Sodanrc@yahoo.com.brfrom m5.SimObject import SimObject
3212600Sodanrc@yahoo.com.br
3312600Sodanrc@yahoo.com.brclass BaseReplacementPolicy(SimObject):
3412600Sodanrc@yahoo.com.br    type = 'BaseReplacementPolicy'
3512600Sodanrc@yahoo.com.br    abstract = True
3612600Sodanrc@yahoo.com.br    cxx_header = "mem/cache/replacement_policies/base.hh"
3712600Sodanrc@yahoo.com.br
3812607Sodanrc@yahoo.com.brclass FIFORP(BaseReplacementPolicy):
3912607Sodanrc@yahoo.com.br    type = 'FIFORP'
4012607Sodanrc@yahoo.com.br    cxx_class = 'FIFORP'
4112607Sodanrc@yahoo.com.br    cxx_header = "mem/cache/replacement_policies/fifo_rp.hh"
4212607Sodanrc@yahoo.com.br
4312685Sodanrc@yahoo.com.brclass SecondChanceRP(FIFORP):
4412685Sodanrc@yahoo.com.br    type = 'SecondChanceRP'
4512685Sodanrc@yahoo.com.br    cxx_class = 'SecondChanceRP'
4612685Sodanrc@yahoo.com.br    cxx_header = "mem/cache/replacement_policies/second_chance_rp.hh"
4712685Sodanrc@yahoo.com.br
4812628Sodanrc@yahoo.com.brclass LFURP(BaseReplacementPolicy):
4912628Sodanrc@yahoo.com.br    type = 'LFURP'
5012628Sodanrc@yahoo.com.br    cxx_class = 'LFURP'
5112628Sodanrc@yahoo.com.br    cxx_header = "mem/cache/replacement_policies/lfu_rp.hh"
5212628Sodanrc@yahoo.com.br
5312600Sodanrc@yahoo.com.brclass LRURP(BaseReplacementPolicy):
5412600Sodanrc@yahoo.com.br    type = 'LRURP'
5512600Sodanrc@yahoo.com.br    cxx_class = 'LRURP'
5612600Sodanrc@yahoo.com.br    cxx_header = "mem/cache/replacement_policies/lru_rp.hh"
5712600Sodanrc@yahoo.com.br
5812634Sodanrc@yahoo.com.brclass BIPRP(LRURP):
5912634Sodanrc@yahoo.com.br    type = 'BIPRP'
6012634Sodanrc@yahoo.com.br    cxx_class = 'BIPRP'
6112634Sodanrc@yahoo.com.br    cxx_header = "mem/cache/replacement_policies/bip_rp.hh"
6212634Sodanrc@yahoo.com.br    btp = Param.Percent(3, "Percentage of blocks to be inserted as MRU")
6312634Sodanrc@yahoo.com.br
6412635Sodanrc@yahoo.com.brclass LIPRP(BIPRP):
6512635Sodanrc@yahoo.com.br    btp = 0
6612635Sodanrc@yahoo.com.br
6712601Sodanrc@yahoo.com.brclass MRURP(BaseReplacementPolicy):
6812601Sodanrc@yahoo.com.br    type = 'MRURP'
6912601Sodanrc@yahoo.com.br    cxx_class = 'MRURP'
7012601Sodanrc@yahoo.com.br    cxx_header = "mem/cache/replacement_policies/mru_rp.hh"
7112601Sodanrc@yahoo.com.br
7212600Sodanrc@yahoo.com.brclass RandomRP(BaseReplacementPolicy):
7312600Sodanrc@yahoo.com.br    type = 'RandomRP'
7412600Sodanrc@yahoo.com.br    cxx_class = 'RandomRP'
7512600Sodanrc@yahoo.com.br    cxx_header = "mem/cache/replacement_policies/random_rp.hh"
7612626Sodanrc@yahoo.com.br
7712626Sodanrc@yahoo.com.brclass BRRIPRP(BaseReplacementPolicy):
7812626Sodanrc@yahoo.com.br    type = 'BRRIPRP'
7912626Sodanrc@yahoo.com.br    cxx_class = 'BRRIPRP'
8012626Sodanrc@yahoo.com.br    cxx_header = "mem/cache/replacement_policies/brrip_rp.hh"
8114211Sodanrc@yahoo.com.br    num_bits = Param.Int(2, "Number of bits per RRPV")
8212626Sodanrc@yahoo.com.br    hit_priority = Param.Bool(False,
8312626Sodanrc@yahoo.com.br        "Prioritize evicting blocks that havent had a hit recently")
8412626Sodanrc@yahoo.com.br    btp = Param.Percent(3,
8512626Sodanrc@yahoo.com.br        "Percentage of blocks to be inserted with long RRPV")
8612627Sodanrc@yahoo.com.br
8712627Sodanrc@yahoo.com.brclass RRIPRP(BRRIPRP):
8813849Sanis.peysieux@inria.fr    btp = 100
8912672Sodanrc@yahoo.com.br
9012672Sodanrc@yahoo.com.brclass NRURP(BRRIPRP):
9113849Sanis.peysieux@inria.fr    btp = 100
9214211Sodanrc@yahoo.com.br    num_bits = 1
9313221Sodanrc@yahoo.com.br
9413221Sodanrc@yahoo.com.brclass TreePLRURP(BaseReplacementPolicy):
9513221Sodanrc@yahoo.com.br    type = 'TreePLRURP'
9613221Sodanrc@yahoo.com.br    cxx_class = 'TreePLRURP'
9713221Sodanrc@yahoo.com.br    cxx_header = "mem/cache/replacement_policies/tree_plru_rp.hh"
9813221Sodanrc@yahoo.com.br    num_leaves = Param.Int(Parent.assoc, "Number of leaves in each tree")
99