RubyCache.py revision 10919
19888Sandreas@sandberg.pp.se# Copyright (c) 2009 Advanced Micro Devices, Inc. 29888Sandreas@sandberg.pp.se# All rights reserved. 39888Sandreas@sandberg.pp.se# 49888Sandreas@sandberg.pp.se# Redistribution and use in source and binary forms, with or without 59888Sandreas@sandberg.pp.se# modification, are permitted provided that the following conditions are 69888Sandreas@sandberg.pp.se# met: redistributions of source code must retain the above copyright 79888Sandreas@sandberg.pp.se# notice, this list of conditions and the following disclaimer; 89888Sandreas@sandberg.pp.se# redistributions in binary form must reproduce the above copyright 99888Sandreas@sandberg.pp.se# notice, this list of conditions and the following disclaimer in the 109888Sandreas@sandberg.pp.se# documentation and/or other materials provided with the distribution; 119888Sandreas@sandberg.pp.se# neither the name of the copyright holders nor the names of its 129888Sandreas@sandberg.pp.se# contributors may be used to endorse or promote products derived from 139888Sandreas@sandberg.pp.se# this software without specific prior written permission. 149888Sandreas@sandberg.pp.se# 159888Sandreas@sandberg.pp.se# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 169888Sandreas@sandberg.pp.se# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 179888Sandreas@sandberg.pp.se# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 189888Sandreas@sandberg.pp.se# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 199888Sandreas@sandberg.pp.se# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 209888Sandreas@sandberg.pp.se# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 219888Sandreas@sandberg.pp.se# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 229888Sandreas@sandberg.pp.se# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 239888Sandreas@sandberg.pp.se# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 249888Sandreas@sandberg.pp.se# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 259888Sandreas@sandberg.pp.se# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 269888Sandreas@sandberg.pp.se# 279888Sandreas@sandberg.pp.se# Authors: Steve Reinhardt 289888Sandreas@sandberg.pp.se# Brad Beckmann 299888Sandreas@sandberg.pp.se 309888Sandreas@sandberg.pp.sefrom m5.params import * 319888Sandreas@sandberg.pp.sefrom m5.proxy import * 329888Sandreas@sandberg.pp.sefrom m5.SimObject import SimObject 339888Sandreas@sandberg.pp.se 349888Sandreas@sandberg.pp.seclass RubyCache(SimObject): 359888Sandreas@sandberg.pp.se type = 'RubyCache' 369888Sandreas@sandberg.pp.se cxx_class = 'CacheMemory' 379888Sandreas@sandberg.pp.se cxx_header = "mem/ruby/structures/CacheMemory.hh" 389899Sandreas@sandberg.pp.se size = Param.MemorySize("capacity in bytes"); 399899Sandreas@sandberg.pp.se latency = Param.Cycles(""); 409899Sandreas@sandberg.pp.se assoc = Param.Int(""); 419899Sandreas@sandberg.pp.se replacement_policy = Param.String("PSEUDO_LRU", ""); 429899Sandreas@sandberg.pp.se start_index_bit = Param.Int(6, "index start, default 6 for 64-byte line"); 439899Sandreas@sandberg.pp.se is_icache = Param.Bool(False, "is instruction only cache"); 449899Sandreas@sandberg.pp.se 459899Sandreas@sandberg.pp.se dataArrayBanks = Param.Int(1, "Number of banks for the data array") 469899Sandreas@sandberg.pp.se tagArrayBanks = Param.Int(1, "Number of banks for the tag array") 479888Sandreas@sandberg.pp.se dataAccessLatency = Param.Cycles(1, "cycles for a data array access") 489888Sandreas@sandberg.pp.se tagAccessLatency = Param.Cycles(1, "cycles for a tag array access") 499888Sandreas@sandberg.pp.se resourceStalls = Param.Bool(False, "stall if there is a resource failure") 509888Sandreas@sandberg.pp.se ruby_system = Param.RubySystem(Parent.any, "") 519888Sandreas@sandberg.pp.se