2015-05-05 09:22:22 +02:00
|
|
|
# Copyright (c) 2012-2013, 2015 ARM Limited
|
2012-10-15 14:10:54 +02:00
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# The license below extends only to copyright in the software and shall
|
|
|
|
# not be construed as granting a license to any other intellectual
|
|
|
|
# property including but not limited to intellectual property relating
|
|
|
|
# to a hardware implementation of the functionality of the software
|
|
|
|
# licensed hereunder. You may use the software subject to the license
|
|
|
|
# terms below provided that you ensure that this notice is replicated
|
|
|
|
# unmodified and in its entirety in all distributions of the software,
|
|
|
|
# modified or unmodified, in source code or in binary form.
|
|
|
|
#
|
2007-05-28 04:21:17 +02:00
|
|
|
# Copyright (c) 2005-2007 The Regents of The University of Michigan
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions are
|
|
|
|
# met: redistributions of source code must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer;
|
|
|
|
# redistributions in binary form must reproduce the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer in the
|
|
|
|
# documentation and/or other materials provided with the distribution;
|
|
|
|
# neither the name of the copyright holders nor the names of its
|
|
|
|
# contributors may be used to endorse or promote products derived from
|
|
|
|
# this software without specific prior written permission.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
#
|
|
|
|
# Authors: Nathan Binkert
|
|
|
|
|
2006-09-05 02:14:07 +02:00
|
|
|
from m5.params import *
|
2012-02-12 23:07:39 +01:00
|
|
|
from m5.proxy import *
|
2006-06-30 22:25:35 +02:00
|
|
|
from MemObject import MemObject
|
2012-02-12 23:07:38 +01:00
|
|
|
from Prefetcher import BasePrefetcher
|
2013-06-27 11:49:50 +02:00
|
|
|
from Tags import *
|
2005-04-03 03:36:08 +02:00
|
|
|
|
2006-06-30 22:25:35 +02:00
|
|
|
class BaseCache(MemObject):
|
2005-02-03 03:13:01 +01:00
|
|
|
type = 'BaseCache'
|
2012-11-02 17:32:01 +01:00
|
|
|
cxx_header = "mem/cache/base.hh"
|
2015-05-05 09:22:22 +02:00
|
|
|
|
|
|
|
size = Param.MemorySize("Capacity")
|
|
|
|
assoc = Param.Unsigned("Associativity")
|
|
|
|
|
|
|
|
hit_latency = Param.Cycles("Hit latency")
|
|
|
|
response_latency = Param.Cycles("Latency for the return path on a miss");
|
|
|
|
|
2005-01-15 10:12:25 +01:00
|
|
|
max_miss_count = Param.Counter(0,
|
2015-05-05 09:22:22 +02:00
|
|
|
"Number of misses to handle before calling exit")
|
|
|
|
|
|
|
|
mshrs = Param.Unsigned("Number of MSHRs (max outstanding requests)")
|
|
|
|
demand_mshr_reserve = Param.Unsigned(1, "MSHRs reserved for demand access")
|
|
|
|
tgts_per_mshr = Param.Unsigned("Max number of accesses per MSHR")
|
|
|
|
write_buffers = Param.Unsigned(8, "Number of write buffers")
|
|
|
|
|
2008-07-16 20:10:33 +02:00
|
|
|
forward_snoops = Param.Bool(True,
|
2015-05-05 09:22:22 +02:00
|
|
|
"Forward snoops from mem side to cpu side")
|
2011-03-18 01:20:19 +01:00
|
|
|
is_top_level = Param.Bool(False, "Is this cache at the top level (e.g. L1)")
|
2015-05-05 09:22:22 +02:00
|
|
|
|
2012-02-12 23:07:38 +01:00
|
|
|
prefetcher = Param.BasePrefetcher(NULL,"Prefetcher attached to cache")
|
2015-05-05 09:22:22 +02:00
|
|
|
prefetch_on_access = Param.Bool(False,
|
|
|
|
"Notify the hardware prefetcher on every access (not just misses)")
|
|
|
|
|
|
|
|
tags = Param.BaseTags(LRU(), "Tag store (replacement policy)")
|
2014-01-24 22:29:30 +01:00
|
|
|
sequential_access = Param.Bool(False,
|
|
|
|
"Whether to access tags and data sequentially")
|
2015-05-05 09:22:22 +02:00
|
|
|
|
|
|
|
cpu_side = SlavePort("Upstream port closer to the CPU and/or device")
|
|
|
|
mem_side = MasterPort("Downstream port closer to memory")
|
|
|
|
|
|
|
|
addr_ranges = VectorParam.AddrRange([AllMemory],
|
|
|
|
"Address range for the CPU-side port (to allow striping)")
|
|
|
|
|
|
|
|
system = Param.System(Parent.any, "System we belong to")
|