mem-cache: Make findVictim non-const
In order to acquire stats when a victim is found,
findVictim must be made const.
Change-Id: I493c7849f07625c90b2b95fd220f50751f4d0f52
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22604
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
diff --git a/src/mem/cache/tags/base.hh b/src/mem/cache/tags/base.hh
index 0a9f16b..88d08ca 100644
--- a/src/mem/cache/tags/base.hh
+++ b/src/mem/cache/tags/base.hh
@@ -280,7 +280,7 @@
*/
virtual CacheBlk* findVictim(Addr addr, const bool is_secure,
const std::size_t size,
- std::vector<CacheBlk*>& evict_blks) const = 0;
+ std::vector<CacheBlk*>& evict_blks) = 0;
/**
* Access block and update replacement data. May not succeed, in which case
diff --git a/src/mem/cache/tags/base_set_assoc.hh b/src/mem/cache/tags/base_set_assoc.hh
index efb08ca..0949994 100644
--- a/src/mem/cache/tags/base_set_assoc.hh
+++ b/src/mem/cache/tags/base_set_assoc.hh
@@ -167,7 +167,7 @@
*/
CacheBlk* findVictim(Addr addr, const bool is_secure,
const std::size_t size,
- std::vector<CacheBlk*>& evict_blks) const override
+ std::vector<CacheBlk*>& evict_blks) override
{
// Get possible entries to be victimized
const std::vector<ReplaceableEntry*> entries =
diff --git a/src/mem/cache/tags/compressed_tags.cc b/src/mem/cache/tags/compressed_tags.cc
index 1394be8..1871a7a 100644
--- a/src/mem/cache/tags/compressed_tags.cc
+++ b/src/mem/cache/tags/compressed_tags.cc
@@ -103,7 +103,7 @@
CacheBlk*
CompressedTags::findVictim(Addr addr, const bool is_secure,
const std::size_t compressed_size,
- std::vector<CacheBlk*>& evict_blks) const
+ std::vector<CacheBlk*>& evict_blks)
{
// Get all possible locations of this superblock
const std::vector<ReplaceableEntry*> superblock_entries =
diff --git a/src/mem/cache/tags/compressed_tags.hh b/src/mem/cache/tags/compressed_tags.hh
index 2c2a699..cce76fc 100644
--- a/src/mem/cache/tags/compressed_tags.hh
+++ b/src/mem/cache/tags/compressed_tags.hh
@@ -109,7 +109,7 @@
*/
CacheBlk* findVictim(Addr addr, const bool is_secure,
const std::size_t compressed_size,
- std::vector<CacheBlk*>& evict_blks) const override;
+ std::vector<CacheBlk*>& evict_blks) override;
/**
* Insert the new block into the cache and update replacement data.
diff --git a/src/mem/cache/tags/fa_lru.cc b/src/mem/cache/tags/fa_lru.cc
index 5738dcb..2b3ef1b 100644
--- a/src/mem/cache/tags/fa_lru.cc
+++ b/src/mem/cache/tags/fa_lru.cc
@@ -197,7 +197,7 @@
CacheBlk*
FALRU::findVictim(Addr addr, const bool is_secure, const std::size_t size,
- std::vector<CacheBlk*>& evict_blks) const
+ std::vector<CacheBlk*>& evict_blks)
{
// The victim is always stored on the tail for the FALRU
FALRUBlk* victim = tail;
diff --git a/src/mem/cache/tags/fa_lru.hh b/src/mem/cache/tags/fa_lru.hh
index 2ca9f4d..199a82f 100644
--- a/src/mem/cache/tags/fa_lru.hh
+++ b/src/mem/cache/tags/fa_lru.hh
@@ -225,7 +225,7 @@
*/
CacheBlk* findVictim(Addr addr, const bool is_secure,
const std::size_t size,
- std::vector<CacheBlk*>& evict_blks) const override;
+ std::vector<CacheBlk*>& evict_blks) override;
/**
* Insert the new block into the cache and update replacement data.
diff --git a/src/mem/cache/tags/sector_tags.cc b/src/mem/cache/tags/sector_tags.cc
index 77fb53c..610cba8 100644
--- a/src/mem/cache/tags/sector_tags.cc
+++ b/src/mem/cache/tags/sector_tags.cc
@@ -222,7 +222,7 @@
CacheBlk*
SectorTags::findVictim(Addr addr, const bool is_secure, const std::size_t size,
- std::vector<CacheBlk*>& evict_blks) const
+ std::vector<CacheBlk*>& evict_blks)
{
// Get possible entries to be victimized
const std::vector<ReplaceableEntry*> sector_entries =
diff --git a/src/mem/cache/tags/sector_tags.hh b/src/mem/cache/tags/sector_tags.hh
index 13638b4..905a87a 100644
--- a/src/mem/cache/tags/sector_tags.hh
+++ b/src/mem/cache/tags/sector_tags.hh
@@ -157,7 +157,7 @@
*/
CacheBlk* findVictim(Addr addr, const bool is_secure,
const std::size_t size,
- std::vector<CacheBlk*>& evict_blks) const override;
+ std::vector<CacheBlk*>& evict_blks) override;
/**
* Calculate a block's offset in a sector from the address.