Tags.py revision 12665
19796Sprakash.ramrakhyani@arm.com# Copyright (c) 2012-2013 ARM Limited
29796Sprakash.ramrakhyani@arm.com# All rights reserved.
39796Sprakash.ramrakhyani@arm.com#
49796Sprakash.ramrakhyani@arm.com# The license below extends only to copyright in the software and shall
59796Sprakash.ramrakhyani@arm.com# not be construed as granting a license to any other intellectual
69796Sprakash.ramrakhyani@arm.com# property including but not limited to intellectual property relating
79796Sprakash.ramrakhyani@arm.com# to a hardware implementation of the functionality of the software
89796Sprakash.ramrakhyani@arm.com# licensed hereunder.  You may use the software subject to the license
99796Sprakash.ramrakhyani@arm.com# terms below provided that you ensure that this notice is replicated
109796Sprakash.ramrakhyani@arm.com# unmodified and in its entirety in all distributions of the software,
119796Sprakash.ramrakhyani@arm.com# modified or unmodified, in source code or in binary form.
129796Sprakash.ramrakhyani@arm.com#
139796Sprakash.ramrakhyani@arm.com# Redistribution and use in source and binary forms, with or without
149796Sprakash.ramrakhyani@arm.com# modification, are permitted provided that the following conditions are
159796Sprakash.ramrakhyani@arm.com# met: redistributions of source code must retain the above copyright
169796Sprakash.ramrakhyani@arm.com# notice, this list of conditions and the following disclaimer;
179796Sprakash.ramrakhyani@arm.com# redistributions in binary form must reproduce the above copyright
189796Sprakash.ramrakhyani@arm.com# notice, this list of conditions and the following disclaimer in the
199796Sprakash.ramrakhyani@arm.com# documentation and/or other materials provided with the distribution;
209796Sprakash.ramrakhyani@arm.com# neither the name of the copyright holders nor the names of its
219796Sprakash.ramrakhyani@arm.com# contributors may be used to endorse or promote products derived from
229796Sprakash.ramrakhyani@arm.com# this software without specific prior written permission.
239796Sprakash.ramrakhyani@arm.com#
249796Sprakash.ramrakhyani@arm.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
259796Sprakash.ramrakhyani@arm.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
269796Sprakash.ramrakhyani@arm.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
279796Sprakash.ramrakhyani@arm.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
289796Sprakash.ramrakhyani@arm.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
299796Sprakash.ramrakhyani@arm.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
309796Sprakash.ramrakhyani@arm.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
319796Sprakash.ramrakhyani@arm.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
329796Sprakash.ramrakhyani@arm.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
339796Sprakash.ramrakhyani@arm.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
349796Sprakash.ramrakhyani@arm.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
359796Sprakash.ramrakhyani@arm.com#
369796Sprakash.ramrakhyani@arm.com# Authors: Prakash Ramrakhyani
379796Sprakash.ramrakhyani@arm.com
389796Sprakash.ramrakhyani@arm.comfrom m5.params import *
399796Sprakash.ramrakhyani@arm.comfrom m5.proxy import *
409796Sprakash.ramrakhyani@arm.comfrom ClockedObject import ClockedObject
419796Sprakash.ramrakhyani@arm.com
429796Sprakash.ramrakhyani@arm.comclass BaseTags(ClockedObject):
439796Sprakash.ramrakhyani@arm.com    type = 'BaseTags'
449796Sprakash.ramrakhyani@arm.com    abstract = True
459796Sprakash.ramrakhyani@arm.com    cxx_header = "mem/cache/tags/base.hh"
469796Sprakash.ramrakhyani@arm.com    # Get the size from the parent (cache)
479796Sprakash.ramrakhyani@arm.com    size = Param.MemorySize(Parent.size, "capacity in bytes")
489796Sprakash.ramrakhyani@arm.com
499814Sandreas.hansson@arm.com    # Get the block size from the parent (system)
509814Sandreas.hansson@arm.com    block_size = Param.Int(Parent.cache_line_size, "block size in bytes")
519796Sprakash.ramrakhyani@arm.com
5211722Ssophiane.senni@gmail.com    # Get the tag lookup latency from the parent (cache)
5311722Ssophiane.senni@gmail.com    tag_latency = Param.Cycles(Parent.tag_latency,
5411722Ssophiane.senni@gmail.com                               "The tag lookup latency for this cache")
5511722Ssophiane.senni@gmail.com
5611722Ssophiane.senni@gmail.com    # Get the RAM access latency from the parent (cache)
5711722Ssophiane.senni@gmail.com    data_latency = Param.Cycles(Parent.data_latency,
5811722Ssophiane.senni@gmail.com                               "The data access latency for this cache")
5911722Ssophiane.senni@gmail.com
6012513Sodanrc@yahoo.com.br    # Get the warmup percentage from the parent (cache)
6112513Sodanrc@yahoo.com.br    warmup_percentage = Param.Percent(Parent.warmup_percentage,
6212513Sodanrc@yahoo.com.br        "Percentage of tags to be touched to warm up the cache")
6312513Sodanrc@yahoo.com.br
6411722Ssophiane.senni@gmail.com    sequential_access = Param.Bool(Parent.sequential_access,
6511722Ssophiane.senni@gmail.com        "Whether to access tags and data sequentially")
669796Sprakash.ramrakhyani@arm.com
6710263Satgutier@umich.educlass BaseSetAssoc(BaseTags):
6810263Satgutier@umich.edu    type = 'BaseSetAssoc'
6910263Satgutier@umich.edu    cxx_header = "mem/cache/tags/base_set_assoc.hh"
7010263Satgutier@umich.edu    assoc = Param.Int(Parent.assoc, "associativity")
7110263Satgutier@umich.edu
7212600Sodanrc@yahoo.com.br    # Get replacement policy from the parent (cache)
7312600Sodanrc@yahoo.com.br    replacement_policy = Param.BaseReplacementPolicy(
7412600Sodanrc@yahoo.com.br        Parent.replacement_policy, "Replacement policy")
759796Sprakash.ramrakhyani@arm.com
769796Sprakash.ramrakhyani@arm.comclass FALRU(BaseTags):
779796Sprakash.ramrakhyani@arm.com    type = 'FALRU'
789796Sprakash.ramrakhyani@arm.com    cxx_class = 'FALRU'
799796Sprakash.ramrakhyani@arm.com    cxx_header = "mem/cache/tags/fa_lru.hh"
8012665Snikos.nikoleris@arm.com
8112665Snikos.nikoleris@arm.com    min_tracked_cache_size = Param.MemorySize("128kB", "Minimum cache size for"
8212665Snikos.nikoleris@arm.com                                              " which we track statistics")
83