Cache.py revision 5875
16019Shines@cs.fsu.edu# Copyright (c) 2005-2007 The Regents of The University of Michigan 212509Schuan.zhu@arm.com# All rights reserved. 37093Sgblack@eecs.umich.edu# 47093Sgblack@eecs.umich.edu# Redistribution and use in source and binary forms, with or without 57093Sgblack@eecs.umich.edu# modification, are permitted provided that the following conditions are 67093Sgblack@eecs.umich.edu# met: redistributions of source code must retain the above copyright 77093Sgblack@eecs.umich.edu# notice, this list of conditions and the following disclaimer; 87093Sgblack@eecs.umich.edu# redistributions in binary form must reproduce the above copyright 97093Sgblack@eecs.umich.edu# notice, this list of conditions and the following disclaimer in the 107093Sgblack@eecs.umich.edu# documentation and/or other materials provided with the distribution; 117093Sgblack@eecs.umich.edu# neither the name of the copyright holders nor the names of its 127093Sgblack@eecs.umich.edu# contributors may be used to endorse or promote products derived from 137093Sgblack@eecs.umich.edu# this software without specific prior written permission. 146019Shines@cs.fsu.edu# 156019Shines@cs.fsu.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 166019Shines@cs.fsu.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 176019Shines@cs.fsu.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 186019Shines@cs.fsu.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 196019Shines@cs.fsu.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 206019Shines@cs.fsu.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 216019Shines@cs.fsu.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 226019Shines@cs.fsu.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 236019Shines@cs.fsu.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 246019Shines@cs.fsu.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 256019Shines@cs.fsu.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 266019Shines@cs.fsu.edu# 276019Shines@cs.fsu.edu# Authors: Nathan Binkert 286019Shines@cs.fsu.edu 296019Shines@cs.fsu.edufrom m5.params import * 306019Shines@cs.fsu.edufrom m5.proxy import Self 316019Shines@cs.fsu.edufrom MemObject import MemObject 326019Shines@cs.fsu.edu 336019Shines@cs.fsu.educlass Prefetch(Enum): vals = ['none', 'tagged', 'stride', 'ghb'] 346019Shines@cs.fsu.edu 356019Shines@cs.fsu.educlass BaseCache(MemObject): 366019Shines@cs.fsu.edu type = 'BaseCache' 376019Shines@cs.fsu.edu assoc = Param.Int("associativity") 386019Shines@cs.fsu.edu block_size = Param.Int("block size in bytes") 396019Shines@cs.fsu.edu latency = Param.Latency("Latency") 406019Shines@cs.fsu.edu hash_delay = Param.Int(1, "time in cycles of hash access") 416735Sgblack@eecs.umich.edu max_miss_count = Param.Counter(0, 426735Sgblack@eecs.umich.edu "number of misses to handle before calling exit") 4310037SARM gem5 Developers mshrs = Param.Int("number of MSHRs (max outstanding requests)") 4410037SARM gem5 Developers prioritizeRequests = Param.Bool(False, 456019Shines@cs.fsu.edu "always service demand misses first") 466019Shines@cs.fsu.edu repl = Param.Repl(NULL, "replacement policy") 476019Shines@cs.fsu.edu size = Param.MemorySize("capacity in bytes") 4811793Sbrandon.potter@amd.com subblock_size = Param.Int(0, 4911793Sbrandon.potter@amd.com "Size of subblock in IIC used for compression") 5010037SARM gem5 Developers tgts_per_mshr = Param.Int("max number of accesses per MSHR") 5110037SARM gem5 Developers trace_addr = Param.Addr(0, "address to trace") 5210037SARM gem5 Developers two_queue = Param.Bool(False, 538229Snate@binkert.org "whether the lifo should have two queue replacement") 548229Snate@binkert.org write_buffers = Param.Int(8, "number of write buffers") 556019Shines@cs.fsu.edu prefetch_on_access = Param.Bool(False, 568232Snate@binkert.org "notify the hardware prefetcher on every access (not just misses)") 578782Sgblack@eecs.umich.edu prefetcher_size = Param.Int(100, 586019Shines@cs.fsu.edu "Number of entries in the hardware prefetch queue") 596019Shines@cs.fsu.edu prefetch_past_page = Param.Bool(False, 606019Shines@cs.fsu.edu "Allow prefetches to cross virtual page boundaries") 616019Shines@cs.fsu.edu prefetch_serial_squash = Param.Bool(False, 6210037SARM gem5 Developers "Squash prefetches with a later time on a subsequent miss") 6310037SARM gem5 Developers prefetch_degree = Param.Int(1, 6410037SARM gem5 Developers "Degree of the prefetch depth") 6510037SARM gem5 Developers prefetch_latency = Param.Latency(10 * Self.latency, 6610037SARM gem5 Developers "Latency of the prefetcher") 6710037SARM gem5 Developers prefetch_policy = Param.Prefetch('none', 6810037SARM gem5 Developers "Type of prefetcher to use") 6910037SARM gem5 Developers prefetch_cache_check_push = Param.Bool(True, 7010037SARM gem5 Developers "Check if in cache on push or pop of prefetch queue") 7110037SARM gem5 Developers prefetch_use_cpu_id = Param.Bool(True, 7210037SARM gem5 Developers "Use the CPU ID to separate calculations of prefetches") 7310037SARM gem5 Developers prefetch_data_accesses_only = Param.Bool(False, 7410037SARM gem5 Developers "Only prefetch on data not on instruction accesses") 7510037SARM gem5 Developers cpu_side = Port("Port on side closer to CPU") 7610037SARM gem5 Developers mem_side = Port("Port on side closer to MEM") 7710037SARM gem5 Developers cpu_side_filter_ranges = VectorParam.AddrRange([], 7810037SARM gem5 Developers "What addresses shouldn't be passed through the side of the bridge") 7910037SARM gem5 Developers mem_side_filter_ranges = VectorParam.AddrRange([], 8010037SARM gem5 Developers "What addresses shouldn't be passed through the side of the bridge") 8110037SARM gem5 Developers addr_range = VectorParam.AddrRange(AllMemory, "The address range in bytes") 8210037SARM gem5 Developers