fa_lru.hh (13162:b6a5d452d52d) fa_lru.hh (13163:55923cb33a7e)
1/*
2 * Copyright (c) 2012-2013,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

--- 39 unchanged lines hidden (view full) ---

48
49#ifndef __MEM_CACHE_TAGS_FA_LRU_HH__
50#define __MEM_CACHE_TAGS_FA_LRU_HH__
51
52#include <cstdint>
53#include <functional>
54#include <string>
55#include <unordered_map>
1/*
2 * Copyright (c) 2012-2013,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

--- 39 unchanged lines hidden (view full) ---

48
49#ifndef __MEM_CACHE_TAGS_FA_LRU_HH__
50#define __MEM_CACHE_TAGS_FA_LRU_HH__
51
52#include <cstdint>
53#include <functional>
54#include <string>
55#include <unordered_map>
56#include <vector>
56
57#include "base/bitfield.hh"
58#include "base/intmath.hh"
59#include "base/logging.hh"
60#include "base/statistics.hh"
61#include "base/types.hh"
62#include "mem/cache/blk.hh"
63#include "mem/cache/tags/base.hh"

--- 203 unchanged lines hidden (view full) ---

267 public:
268 CacheTracking(unsigned min_size, unsigned max_size,
269 unsigned block_size)
270 : blkSize(block_size),
271 minTrackedSize(min_size),
272 numTrackedCaches(max_size > min_size ?
273 floorLog2(max_size) - floorLog2(min_size) : 0),
274 inAllCachesMask(mask(numTrackedCaches)),
57
58#include "base/bitfield.hh"
59#include "base/intmath.hh"
60#include "base/logging.hh"
61#include "base/statistics.hh"
62#include "base/types.hh"
63#include "mem/cache/blk.hh"
64#include "mem/cache/tags/base.hh"

--- 203 unchanged lines hidden (view full) ---

268 public:
269 CacheTracking(unsigned min_size, unsigned max_size,
270 unsigned block_size)
271 : blkSize(block_size),
272 minTrackedSize(min_size),
273 numTrackedCaches(max_size > min_size ?
274 floorLog2(max_size) - floorLog2(min_size) : 0),
275 inAllCachesMask(mask(numTrackedCaches)),
275 boundaries(new FALRUBlk *[numTrackedCaches])
276 boundaries(numTrackedCaches)
276 {
277 fatal_if(numTrackedCaches > sizeof(CachesMask) * 8,
278 "Not enough bits (%s) in type CachesMask type to keep "
279 "track of %d caches\n", sizeof(CachesMask),
280 numTrackedCaches);
281 }
282
277 {
278 fatal_if(numTrackedCaches > sizeof(CachesMask) * 8,
279 "Not enough bits (%s) in type CachesMask type to keep "
280 "track of %d caches\n", sizeof(CachesMask),
281 numTrackedCaches);
282 }
283
283 ~CacheTracking()
284 {
285 delete[] boundaries;
286 }
287
288 /**
289 * Initialiaze cache blocks and the tracking mechanism
290 *
291 * All blocks in the cache need to be initialized once.
292 *
293 * @param blk the MRU block
294 * @param blk the LRU block
295 */

--- 55 unchanged lines hidden (view full) ---

351 const unsigned blkSize;
352 /** The smallest cache we are tracking */
353 const unsigned minTrackedSize;
354 /** The number of different size caches being tracked. */
355 const int numTrackedCaches;
356 /** A mask for all cache being tracked. */
357 const CachesMask inAllCachesMask;
358 /** Array of pointers to blocks at the cache boundaries. */
284 /**
285 * Initialiaze cache blocks and the tracking mechanism
286 *
287 * All blocks in the cache need to be initialized once.
288 *
289 * @param blk the MRU block
290 * @param blk the LRU block
291 */

--- 55 unchanged lines hidden (view full) ---

347 const unsigned blkSize;
348 /** The smallest cache we are tracking */
349 const unsigned minTrackedSize;
350 /** The number of different size caches being tracked. */
351 const int numTrackedCaches;
352 /** A mask for all cache being tracked. */
353 const CachesMask inAllCachesMask;
354 /** Array of pointers to blocks at the cache boundaries. */
359 FALRUBlk** boundaries;
355 std::vector<FALRUBlk*> boundaries;
360
361 protected:
362 /**
363 * @defgroup FALRUStats Fully Associative LRU specific statistics
364 * The FA lru stack lets us track multiple cache sizes at once. These
365 * statistics track the hits and misses for different cache sizes.
366 * @{
367 */

--- 16 unchanged lines hidden ---
356
357 protected:
358 /**
359 * @defgroup FALRUStats Fully Associative LRU specific statistics
360 * The FA lru stack lets us track multiple cache sizes at once. These
361 * statistics track the hits and misses for different cache sizes.
362 * @{
363 */

--- 16 unchanged lines hidden ---