fa_lru.cc (12636:9859213e2662) | fa_lru.cc (12637:bfc3cb9c7e6c) |
---|---|
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 | 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 |
56using namespace std; 57 | |
58FALRU::FALRU(const Params *p) 59 : BaseTags(p), cacheBoundaries(nullptr) 60{ 61 if (!isPowerOf2(blkSize)) 62 fatal("cache block size (in bytes) `%d' must be a power of two", 63 blkSize); 64 if (!isPowerOf2(size)) 65 fatal("Cache Size must be power of 2 for now"); --- 51 unchanged lines hidden (view full) --- 117 delete[] cacheBoundaries; 118 119 delete[] blks; 120} 121 122void 123FALRU::regStats() 124{ | 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{ |
125 using namespace Stats; | |
126 BaseTags::regStats(); 127 hits 128 .init(numCaches+1) 129 .name(name() + ".falru_hits") 130 .desc("The number of hits in each cache size.") 131 ; 132 misses 133 .init(numCaches+1) 134 .name(name() + ".falru_misses") 135 .desc("The number of misses in each cache size.") 136 ; 137 accesses 138 .name(name() + ".falru_accesses") 139 .desc("The number of accesses to the FA LRU cache.") 140 ; 141 142 for (unsigned i = 0; i <= numCaches; ++i) { | 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) { |
143 stringstream size_str; | 140 std::stringstream size_str; |
144 if (i < 3){ 145 size_str << (1<<(i+7)) <<"K"; 146 } else { 147 size_str << (1<<(i-3)) <<"M"; 148 } 149 150 hits.subname(i, size_str.str()); 151 hits.subdesc(i, "Hits in a " + size_str.str() +" cache"); --- 188 unchanged lines hidden --- | 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 --- |