Deleted Added
sdiff udiff text old ( 12727:56c23b54bcb1 ) new ( 12728:57bdea4f96aa )
full compact
1/*
2 * Copyright (c) 2012-2014,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
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated

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

45 * @file
46 * Declaration of a common base class for cache tagstore objects.
47 */
48
49#ifndef __MEM_CACHE_TAGS_BASE_HH__
50#define __MEM_CACHE_TAGS_BASE_HH__
51
52#include <cassert>
53#include <string>
54
55#include "base/callback.hh"
56#include "base/logging.hh"
57#include "base/statistics.hh"
58#include "base/types.hh"
59#include "mem/cache/blk.hh"
60#include "mem/packet.hh"

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

172 * Register local statistics.
173 */
174 void regStats();
175
176 /**
177 * Average in the reference count for valid blocks when the simulation
178 * exits.
179 */
180 virtual void cleanupRefs() {}
181
182 /**
183 * Computes stats just prior to dump event
184 */
185 virtual void computeStats() {}
186
187 /**
188 * Print all tags used
189 */
190 virtual std::string print() const = 0;
191
192 /**
193 * Find a block using the memory address
194 */
195 virtual CacheBlk * findBlock(Addr addr, bool is_secure) const = 0;
196
197 /**
198 * Align an address to the block size.

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

284 *
285 * @param block The block.
286 * @return the block address.
287 */
288 virtual Addr regenerateBlkAddr(const CacheBlk* blk) const = 0;
289
290 virtual int extractSet(Addr addr) const = 0;
291
292 virtual void forEachBlk(CacheBlkVisitor &visitor) = 0;
293};
294
295class BaseTagsCallback : public Callback
296{
297 BaseTags *tags;
298 public:
299 BaseTagsCallback(BaseTags *t) : tags(t) {}
300 virtual void process() { tags->cleanupRefs(); };
301};
302
303class BaseTagsDumpCallback : public Callback
304{
305 BaseTags *tags;
306 public:
307 BaseTagsDumpCallback(BaseTags *t) : tags(t) {}
308 virtual void process() { tags->computeStats(); };
309};
310
311#endif //__MEM_CACHE_TAGS_BASE_HH__