1/* 2 * Copyright (c) 2013,2016-2017 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#include "mem/cache/tags/fa_lru.hh" 49 50#include <cassert> 51#include <sstream> 52 53#include "base/intmath.hh" 54#include "base/logging.hh" 55 |
56FALRU::FALRU(const Params *p) 57 : BaseTags(p), cacheBoundaries(nullptr) 58{ 59 if (!isPowerOf2(blkSize)) 60 fatal("cache block size (in bytes) `%d' must be a power of two", 61 blkSize); 62 if (!isPowerOf2(size)) 63 fatal("Cache Size must be power of 2 for now"); --- 51 unchanged lines hidden (view full) --- 115 delete[] cacheBoundaries; 116 117 delete[] blks; 118} 119 120void 121FALRU::regStats() 122{ |
123 BaseTags::regStats(); 124 hits 125 .init(numCaches+1) 126 .name(name() + ".falru_hits") 127 .desc("The number of hits in each cache size.") 128 ; 129 misses 130 .init(numCaches+1) 131 .name(name() + ".falru_misses") 132 .desc("The number of misses in each cache size.") 133 ; 134 accesses 135 .name(name() + ".falru_accesses") 136 .desc("The number of accesses to the FA LRU cache.") 137 ; 138 139 for (unsigned i = 0; i <= numCaches; ++i) { |
140 std::stringstream size_str; |
141 if (i < 3){ 142 size_str << (1<<(i+7)) <<"K"; 143 } else { 144 size_str << (1<<(i-3)) <<"M"; 145 } 146 147 hits.subname(i, size_str.str()); 148 hits.subdesc(i, "Hits in a " + size_str.str() +" cache"); --- 188 unchanged lines hidden --- |