Tags.py revision 10263:c00b5ba43967
19155SN/A# Copyright (c) 2012-2013 ARM Limited 29155SN/A# All rights reserved. 39155SN/A# 49155SN/A# The license below extends only to copyright in the software and shall 59155SN/A# not be construed as granting a license to any other intellectual 69155SN/A# property including but not limited to intellectual property relating 79155SN/A# to a hardware implementation of the functionality of the software 89155SN/A# licensed hereunder. You may use the software subject to the license 99155SN/A# terms below provided that you ensure that this notice is replicated 109155SN/A# unmodified and in its entirety in all distributions of the software, 119155SN/A# modified or unmodified, in source code or in binary form. 129155SN/A# 139155SN/A# Redistribution and use in source and binary forms, with or without 149155SN/A# modification, are permitted provided that the following conditions are 159155SN/A# met: redistributions of source code must retain the above copyright 169155SN/A# notice, this list of conditions and the following disclaimer; 179155SN/A# redistributions in binary form must reproduce the above copyright 189155SN/A# notice, this list of conditions and the following disclaimer in the 199155SN/A# documentation and/or other materials provided with the distribution; 209155SN/A# neither the name of the copyright holders nor the names of its 219155SN/A# contributors may be used to endorse or promote products derived from 229155SN/A# this software without specific prior written permission. 239155SN/A# 249155SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 259155SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 269155SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 279155SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 289155SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 299155SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 309155SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 319105SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 3210441Snilay@cs.wisc.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 3310441Snilay@cs.wisc.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 349105SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 359105SN/A# 369105SN/A# Authors: Prakash Ramrakhyani 379105SN/A 3810919Sbrandon.potter@amd.comfrom m5.params import * 399297SN/Afrom m5.proxy import * 409105SN/Afrom ClockedObject import ClockedObject 419297SN/A 429105SN/Aclass BaseTags(ClockedObject): 439297SN/A type = 'BaseTags' 449105SN/A abstract = True 459184SN/A cxx_header = "mem/cache/tags/base.hh" 469105SN/A # Get the size from the parent (cache) 479105SN/A size = Param.MemorySize(Parent.size, "capacity in bytes") 4810919Sbrandon.potter@amd.com 499105SN/A # Get the block size from the parent (system) 509297SN/A block_size = Param.Int(Parent.cache_line_size, "block size in bytes") 519105SN/A 529297SN/A # Get the hit latency from the parent (cache) 539297SN/A hit_latency = Param.Cycles(Parent.hit_latency, 5410314Snilay@cs.wisc.edu "The hit latency for this cache") 559105SN/A 569297SN/Aclass BaseSetAssoc(BaseTags): 579105SN/A type = 'BaseSetAssoc' 589105SN/A abstract = True 599105SN/A cxx_header = "mem/cache/tags/base_set_assoc.hh" 609105SN/A assoc = Param.Int(Parent.assoc, "associativity") 619297SN/A sequential_access = Param.Bool(Parent.sequential_access, 629105SN/A "Whether to access tags and data sequentially") 6310314Snilay@cs.wisc.edu 649105SN/Aclass LRU(BaseSetAssoc): 659297SN/A type = 'LRU' 6610917Sbrandon.potter@amd.com cxx_class = 'LRU' 6710919Sbrandon.potter@amd.com cxx_header = "mem/cache/tags/lru.hh" 689105SN/A 699105SN/Aclass RandomRepl(BaseSetAssoc): 709105SN/A type = 'RandomRepl' 7110314Snilay@cs.wisc.edu cxx_class = 'RandomRepl' 729105SN/A cxx_header = "mem/cache/tags/random_repl.hh" 7310978Sdavid.hashe@amd.com 7410978Sdavid.hashe@amd.comclass FALRU(BaseTags): 7510969Sdavid.hashe@amd.com type = 'FALRU' 769105SN/A cxx_class = 'FALRU' 779105SN/A cxx_header = "mem/cache/tags/fa_lru.hh" 789105SN/A