1/* 2 * Copyright (c) 2012-2014,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 --- 34 unchanged lines hidden (view full) --- 43/** 44 * @file 45 * Declaration of a base set associative tag store. 46 */ 47 48#ifndef __MEM_CACHE_TAGS_BASE_SET_ASSOC_HH__ 49#define __MEM_CACHE_TAGS_BASE_SET_ASSOC_HH__ 50 |
51#include <functional> |
52#include <string> 53#include <vector> 54 55#include "base/logging.hh" 56#include "base/types.hh" 57#include "debug/CacheRepl.hh" 58#include "mem/cache/base.hh" 59#include "mem/cache/blk.hh" --- 234 unchanged lines hidden (view full) --- 294 * @param block The block. 295 * @return the block address. 296 */ 297 Addr regenerateBlkAddr(const CacheBlk* blk) const override 298 { 299 return ((blk->tag << tagShift) | ((Addr)blk->set << setShift)); 300 } 301 |
302 void forEachBlk(std::function<void(CacheBlk &)> visitor) override { 303 for (CacheBlk& blk : blks) { 304 visitor(blk); 305 } 306 } |
307 |
308 bool anyBlk(std::function<bool(CacheBlk &)> visitor) override { |
309 for (CacheBlk& blk : blks) { |
310 if (visitor(blk)) { 311 return true; 312 } |
313 } |
314 return false; |
315 } 316}; 317 318#endif //__MEM_CACHE_TAGS_BASE_SET_ASSOC_HH__ |