1/* 2 * Copyright (c) 2012-2014,2016-2018 ARM Limited 3 * All rights reserved. 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 47 unchanged lines hidden (view full) --- 56#include "base/callback.hh" 57#include "base/logging.hh" 58#include "base/statistics.hh" 59#include "base/types.hh" 60#include "mem/cache/cache_blk.hh" 61#include "params/BaseTags.hh" 62#include "sim/clocked_object.hh" 63 |
64class System; |
65class IndexingPolicy; 66class ReplaceableEntry; 67 68/** 69 * A common base class of Cache tagstore objects. 70 */ 71class BaseTags : public ClockedObject 72{ 73 protected: 74 /** The block size of the cache. */ 75 const unsigned blkSize; 76 /** Mask out all bits that aren't part of the block offset. */ 77 const Addr blkMask; 78 /** The size of the cache. */ 79 const unsigned size; 80 /** The tag lookup latency of the cache. */ 81 const Cycles lookupLatency; 82 |
83 /** System we are currently operating in. */ 84 System *system; |
85 86 /** Indexing policy */ 87 BaseIndexingPolicy *indexingPolicy; 88 89 /** 90 * The number of tags that need to be touched to meet the warmup 91 * percentage. 92 */ --- 55 unchanged lines hidden (view full) --- 148 Stats::Scalar tagAccesses; 149 /** Number of data blocks consulted over all accesses. */ 150 Stats::Scalar dataAccesses; 151 152 /** 153 * @} 154 */ 155 |
156 public: 157 typedef BaseTagsParams Params; 158 BaseTags(const Params *p); 159 160 /** 161 * Destructor. 162 */ 163 virtual ~BaseTags() {} 164 165 /** |
166 * Initialize blocks. Must be overriden by every subclass that uses 167 * a block type different from its parent's, as the current Python 168 * code generation does not allow templates. |
169 */ |
170 virtual void tagsInit() = 0; |
171 172 /** 173 * Register local statistics. 174 */ 175 void regStats(); 176 177 /** 178 * Average in the reference count for valid blocks when the simulation --- 201 unchanged lines hidden --- |