RubyCache.py revision 10970
19341SAndreas.Sandberg@arm.com# Copyright (c) 2009 Advanced Micro Devices, Inc. 29341SAndreas.Sandberg@arm.com# All rights reserved. 39341SAndreas.Sandberg@arm.com# 49341SAndreas.Sandberg@arm.com# Redistribution and use in source and binary forms, with or without 59341SAndreas.Sandberg@arm.com# modification, are permitted provided that the following conditions are 69341SAndreas.Sandberg@arm.com# met: redistributions of source code must retain the above copyright 79341SAndreas.Sandberg@arm.com# notice, this list of conditions and the following disclaimer; 89341SAndreas.Sandberg@arm.com# redistributions in binary form must reproduce the above copyright 99341SAndreas.Sandberg@arm.com# notice, this list of conditions and the following disclaimer in the 109341SAndreas.Sandberg@arm.com# documentation and/or other materials provided with the distribution; 119341SAndreas.Sandberg@arm.com# neither the name of the copyright holders nor the names of its 129341SAndreas.Sandberg@arm.com# contributors may be used to endorse or promote products derived from 139341SAndreas.Sandberg@arm.com# this software without specific prior written permission. 149341SAndreas.Sandberg@arm.com# 159341SAndreas.Sandberg@arm.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 169341SAndreas.Sandberg@arm.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 179341SAndreas.Sandberg@arm.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 189341SAndreas.Sandberg@arm.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 199341SAndreas.Sandberg@arm.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 209341SAndreas.Sandberg@arm.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 219341SAndreas.Sandberg@arm.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 229341SAndreas.Sandberg@arm.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 239341SAndreas.Sandberg@arm.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 249341SAndreas.Sandberg@arm.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 259341SAndreas.Sandberg@arm.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 269341SAndreas.Sandberg@arm.com# 279341SAndreas.Sandberg@arm.com# Authors: Steve Reinhardt 289341SAndreas.Sandberg@arm.com# Brad Beckmann 299341SAndreas.Sandberg@arm.com 309341SAndreas.Sandberg@arm.comfrom m5.params import * 319341SAndreas.Sandberg@arm.comfrom m5.proxy import * 329341SAndreas.Sandberg@arm.comfrom PseudoLRUReplacementPolicy import PseudoLRUReplacementPolicy 339341SAndreas.Sandberg@arm.comfrom m5.SimObject import SimObject 349341SAndreas.Sandberg@arm.com 359341SAndreas.Sandberg@arm.comclass RubyCache(SimObject): 369341SAndreas.Sandberg@arm.com type = 'RubyCache' 379341SAndreas.Sandberg@arm.com cxx_class = 'CacheMemory' 389341SAndreas.Sandberg@arm.com cxx_header = "mem/ruby/structures/CacheMemory.hh" 399341SAndreas.Sandberg@arm.com size = Param.MemorySize("capacity in bytes"); 409341SAndreas.Sandberg@arm.com latency = Param.Cycles(""); 419341SAndreas.Sandberg@arm.com assoc = Param.Int(""); 429341SAndreas.Sandberg@arm.com replacement_policy = Param.ReplacementPolicy(PseudoLRUReplacementPolicy(), 439341SAndreas.Sandberg@arm.com "") 449341SAndreas.Sandberg@arm.com start_index_bit = Param.Int(6, "index start, default 6 for 64-byte line"); 459341SAndreas.Sandberg@arm.com is_icache = Param.Bool(False, "is instruction only cache"); 469341SAndreas.Sandberg@arm.com 47 dataArrayBanks = Param.Int(1, "Number of banks for the data array") 48 tagArrayBanks = Param.Int(1, "Number of banks for the tag array") 49 dataAccessLatency = Param.Cycles(1, "cycles for a data array access") 50 tagAccessLatency = Param.Cycles(1, "cycles for a tag array access") 51 resourceStalls = Param.Bool(False, "stall if there is a resource failure") 52 ruby_system = Param.RubySystem(Parent.any, "") 53