Deleted Added
sdiff udiff text old ( 12636:9859213e2662 ) new ( 12637:bfc3cb9c7e6c )
full compact
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{
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) {
143 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 ---