Deleted Added
sdiff udiff text old ( 13162:b6a5d452d52d ) new ( 13163:55923cb33a7e )
full compact
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
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)),
275 boundaries(new FALRUBlk *[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
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. */
359 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 ---