fa_lru.hh (12600:e670dd17c8cf) | fa_lru.hh (12636:9859213e2662) |
---|---|
1/* 2 * Copyright (c) 2012-2013,2016 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 "mem/packet.hh" 58#include "params/FALRU.hh" 59 60/** 61 * A fully associative cache block. 62 */ 63class FALRUBlk : public CacheBlk 64{ | 1/* 2 * Copyright (c) 2012-2013,2016 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 "mem/packet.hh" 58#include "params/FALRU.hh" 59 60/** 61 * A fully associative cache block. 62 */ 63class FALRUBlk : public CacheBlk 64{ |
65public: | 65 public: |
66 /** The previous block in LRU order. */ 67 FALRUBlk *prev; 68 /** The next block in LRU order. */ 69 FALRUBlk *next; 70 71 /** 72 * A bit mask of the sizes of cache that this block is resident in. 73 * Each bit represents a power of 2 in MB size cache. --- 72 unchanged lines hidden (view full) --- 146 Stats::Vector misses; 147 /** Total number of accesses. */ 148 Stats::Scalar accesses; 149 150 /** 151 * @} 152 */ 153 | 66 /** The previous block in LRU order. */ 67 FALRUBlk *prev; 68 /** The next block in LRU order. */ 69 FALRUBlk *next; 70 71 /** 72 * A bit mask of the sizes of cache that this block is resident in. 73 * Each bit represents a power of 2 in MB size cache. --- 72 unchanged lines hidden (view full) --- 146 Stats::Vector misses; 147 /** Total number of accesses. */ 148 Stats::Scalar accesses; 149 150 /** 151 * @} 152 */ 153 |
154public: 155 | 154 public: |
156 typedef FALRUParams Params; 157 158 /** 159 * Construct and initialize this cache tagstore. 160 */ 161 FALRU(const Params *p); 162 ~FALRU(); 163 --- 40 unchanged lines hidden (view full) --- 204 /** 205 * Find replacement victim based on address. 206 * 207 * @param addr Address to find a victim for. 208 * @return Cache block to be replaced. 209 */ 210 CacheBlk* findVictim(Addr addr) override; 211 | 155 typedef FALRUParams Params; 156 157 /** 158 * Construct and initialize this cache tagstore. 159 */ 160 FALRU(const Params *p); 161 ~FALRU(); 162 --- 40 unchanged lines hidden (view full) --- 203 /** 204 * Find replacement victim based on address. 205 * 206 * @param addr Address to find a victim for. 207 * @return Cache block to be replaced. 208 */ 209 CacheBlk* findVictim(Addr addr) override; 210 |
211 /** 212 * Insert the new block into the cache and update replacement data. 213 * 214 * @param pkt Packet holding the address to update 215 * @param blk The block to update. 216 */ |
|
212 void insertBlock(PacketPtr pkt, CacheBlk *blk) override; 213 214 /** 215 * Find the cache block given set and way 216 * @param set The set of the block. 217 * @param way The way of the block. 218 * @return The cache block. 219 */ --- 49 unchanged lines hidden (view full) --- 269 * \param visitor Visitor to call on each block. 270 */ 271 void forEachBlk(CacheBlkVisitor &visitor) override { 272 for (int i = 0; i < numBlocks; i++) { 273 if (!visitor(blks[i])) 274 return; 275 } 276 } | 217 void insertBlock(PacketPtr pkt, CacheBlk *blk) override; 218 219 /** 220 * Find the cache block given set and way 221 * @param set The set of the block. 222 * @param way The way of the block. 223 * @return The cache block. 224 */ --- 49 unchanged lines hidden (view full) --- 274 * \param visitor Visitor to call on each block. 275 */ 276 void forEachBlk(CacheBlkVisitor &visitor) override { 277 for (int i = 0; i < numBlocks; i++) { 278 if (!visitor(blks[i])) 279 return; 280 } 281 } |
277 | |
278}; 279 280#endif // __MEM_CACHE_TAGS_FA_LRU_HH__ | 282}; 283 284#endif // __MEM_CACHE_TAGS_FA_LRU_HH__ |