base.hh (13217:725b1701b4ee) | base.hh (13219:454ecc63338d) |
---|---|
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 --- 48 unchanged lines hidden (view full) --- 57#include "base/logging.hh" 58#include "base/statistics.hh" 59#include "base/types.hh" 60#include "mem/cache/blk.hh" 61#include "params/BaseTags.hh" 62#include "sim/clocked_object.hh" 63 64class BaseCache; | 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 --- 48 unchanged lines hidden (view full) --- 57#include "base/logging.hh" 58#include "base/statistics.hh" 59#include "base/types.hh" 60#include "mem/cache/blk.hh" 61#include "params/BaseTags.hh" 62#include "sim/clocked_object.hh" 63 64class BaseCache; |
65class IndexingPolicy; |
|
65class ReplaceableEntry; 66 67/** 68 * A common base class of Cache tagstore objects. 69 */ 70class BaseTags : public ClockedObject 71{ 72 protected: --- 9 unchanged lines hidden (view full) --- 82 * The total access latency of the cache. This latency 83 * is different depending on the cache access mode 84 * (parallel or sequential) 85 */ 86 const Cycles accessLatency; 87 /** Pointer to the parent cache. */ 88 BaseCache *cache; 89 | 66class ReplaceableEntry; 67 68/** 69 * A common base class of Cache tagstore objects. 70 */ 71class BaseTags : public ClockedObject 72{ 73 protected: --- 9 unchanged lines hidden (view full) --- 83 * The total access latency of the cache. This latency 84 * is different depending on the cache access mode 85 * (parallel or sequential) 86 */ 87 const Cycles accessLatency; 88 /** Pointer to the parent cache. */ 89 BaseCache *cache; 90 |
91 /** Indexing policy */ 92 BaseIndexingPolicy *indexingPolicy; 93 |
|
90 /** 91 * The number of tags that need to be touched to meet the warmup 92 * percentage. 93 */ 94 const unsigned warmupBound; 95 /** Marked true when the cache is warmed up. */ 96 bool warmedUp; 97 --- 58 unchanged lines hidden (view full) --- 156 157 /** 158 * Set the parent cache back pointer. 159 * 160 * @param _cache Pointer to parent cache. 161 */ 162 void setCache(BaseCache *_cache); 163 | 94 /** 95 * The number of tags that need to be touched to meet the warmup 96 * percentage. 97 */ 98 const unsigned warmupBound; 99 /** Marked true when the cache is warmed up. */ 100 bool warmedUp; 101 --- 58 unchanged lines hidden (view full) --- 160 161 /** 162 * Set the parent cache back pointer. 163 * 164 * @param _cache Pointer to parent cache. 165 */ 166 void setCache(BaseCache *_cache); 167 |
164 /** 165 * Find all possible block locations for insertion and replacement of 166 * an address. Should be called immediately before ReplacementPolicy's 167 * findVictim() not to break cache resizing. 168 * Returns blocks in all ways belonging to the set of the address. 169 * 170 * @param addr The addr to a find possible locations for. 171 * @return The possible locations. 172 */ 173 virtual std::vector<ReplaceableEntry*> getPossibleLocations( 174 const Addr addr) const; 175 | |
176 public: 177 typedef BaseTagsParams Params; 178 BaseTags(const Params *p); 179 180 /** 181 * Destructor. 182 */ 183 virtual ~BaseTags() {} --- 37 unchanged lines hidden (view full) --- 221 222 /** 223 * Find a block given set and way. 224 * 225 * @param set The set of the block. 226 * @param way The way of the block. 227 * @return The block. 228 */ | 168 public: 169 typedef BaseTagsParams Params; 170 BaseTags(const Params *p); 171 172 /** 173 * Destructor. 174 */ 175 virtual ~BaseTags() {} --- 37 unchanged lines hidden (view full) --- 213 214 /** 215 * Find a block given set and way. 216 * 217 * @param set The set of the block. 218 * @param way The way of the block. 219 * @return The block. 220 */ |
229 virtual ReplaceableEntry* findBlockBySetAndWay(int set, int way) const = 0; | 221 virtual ReplaceableEntry* findBlockBySetAndWay(int set, int way) const; |
230 231 /** 232 * Align an address to the block size. 233 * @param addr the address to align. 234 * @return The block address. 235 */ 236 Addr blkAlign(Addr addr) const 237 { --- 60 unchanged lines hidden (view full) --- 298 * @param evict_blks Cache blocks to be evicted. 299 * @return Cache block to be replaced. 300 */ 301 virtual CacheBlk* findVictim(Addr addr, const bool is_secure, 302 std::vector<CacheBlk*>& evict_blks) const = 0; 303 304 virtual CacheBlk* accessBlock(Addr addr, bool is_secure, Cycles &lat) = 0; 305 | 222 223 /** 224 * Align an address to the block size. 225 * @param addr the address to align. 226 * @return The block address. 227 */ 228 Addr blkAlign(Addr addr) const 229 { --- 60 unchanged lines hidden (view full) --- 290 * @param evict_blks Cache blocks to be evicted. 291 * @return Cache block to be replaced. 292 */ 293 virtual CacheBlk* findVictim(Addr addr, const bool is_secure, 294 std::vector<CacheBlk*>& evict_blks) const = 0; 295 296 virtual CacheBlk* accessBlock(Addr addr, bool is_secure, Cycles &lat) = 0; 297 |
306 virtual Addr extractTag(Addr addr) const = 0; | 298 /** 299 * Generate the tag from the given address. 300 * 301 * @param addr The address to get the tag from. 302 * @return The tag of the address. 303 */ 304 virtual Addr extractTag(const Addr addr) const; |
307 308 /** 309 * Insert the new block into the cache and update stats. 310 * 311 * @param addr Address of the block. 312 * @param is_secure Whether the block is in secure space or not. 313 * @param src_master_ID The source requestor ID. 314 * @param task_ID The new task ID. --- 68 unchanged lines hidden --- | 305 306 /** 307 * Insert the new block into the cache and update stats. 308 * 309 * @param addr Address of the block. 310 * @param is_secure Whether the block is in secure space or not. 311 * @param src_master_ID The source requestor ID. 312 * @param task_ID The new task ID. --- 68 unchanged lines hidden --- |