Tags.py revision 9796
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
499796Sprakash.ramrakhyani@arm.com    # Get the block size from the parent (cache)
509796Sprakash.ramrakhyani@arm.com    block_size = Param.Int(Parent.block_size, "block size in bytes")
519796Sprakash.ramrakhyani@arm.com
529796Sprakash.ramrakhyani@arm.com    # Get the hit latency from the parent (cache)
539796Sprakash.ramrakhyani@arm.com    hit_latency = Param.Cycles(Parent.hit_latency,
549796Sprakash.ramrakhyani@arm.com                               "The hit latency for this cache")
559796Sprakash.ramrakhyani@arm.com
569796Sprakash.ramrakhyani@arm.comclass LRU(BaseTags):
579796Sprakash.ramrakhyani@arm.com    type = 'LRU'
589796Sprakash.ramrakhyani@arm.com    cxx_class = 'LRU'
599796Sprakash.ramrakhyani@arm.com    cxx_header = "mem/cache/tags/lru.hh"
609796Sprakash.ramrakhyani@arm.com    assoc = Param.Int(Parent.assoc, "associativity")
619796Sprakash.ramrakhyani@arm.com
629796Sprakash.ramrakhyani@arm.comclass FALRU(BaseTags):
639796Sprakash.ramrakhyani@arm.com    type = 'FALRU'
649796Sprakash.ramrakhyani@arm.com    cxx_class = 'FALRU'
659796Sprakash.ramrakhyani@arm.com    cxx_header = "mem/cache/tags/fa_lru.hh"
66