diff options
author | Nikos Nikoleris <nikos.nikoleris@arm.com> | 2018-05-30 11:54:57 +0100 |
---|---|---|
committer | Nikos Nikoleris <nikos.nikoleris@arm.com> | 2018-05-31 17:45:23 +0000 |
commit | 51f83a3cffa9f068afb3ca35327420c72713900a (patch) | |
tree | 017ea6bb77e05424c2f0a4050dbfade4dbd0c74a /src/mem/cache/blk.hh | |
parent | 56865ad1154c7c3fde2ae6b7329d0c888390f781 (diff) | |
download | gem5-51f83a3cffa9f068afb3ca35327420c72713900a.tar.xz |
mem-cache: Replace block visitor with std::function
This change modifies forEachBlk tags function to accept std::function
as parameter. It also adds an anyBlk tags function that given a
condition, it iterates through the blocks and returns whether the
condition is met.
Finally, it uses forEachBlk to implement the print, computeStats and
cleanupRefs functions that also work for the FALRU class.
Change-Id: I2f75f4baa1fdd5a1d343a63ecace3eb9458fbf03
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/10621
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Diffstat (limited to 'src/mem/cache/blk.hh')
-rw-r--r-- | src/mem/cache/blk.hh | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/src/mem/cache/blk.hh b/src/mem/cache/blk.hh index 951abd5be..c94c3ba7d 100644 --- a/src/mem/cache/blk.hh +++ b/src/mem/cache/blk.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2017 ARM Limited + * Copyright (c) 2012-2018 ARM Limited * All rights reserved. * * The license below extends only to copyright in the software and shall @@ -409,20 +409,4 @@ class CacheBlkPrintWrapper : public Printable const std::string &prefix = "") const; }; -/** - * Base class for cache block visitor, operating on the cache block - * base class (later subclassed for the various tag classes). This - * visitor class is used as part of the forEachBlk interface in the - * tag classes. - */ -class CacheBlkVisitor -{ - public: - - CacheBlkVisitor() {} - virtual ~CacheBlkVisitor() {} - - virtual bool operator()(CacheBlk &blk) = 0; -}; - #endif //__MEM_CACHE_BLK_HH__ |