summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel R. Carvalho <odanrc@yahoo.com.br>2018-10-19 12:28:25 +0200
committerDaniel Carvalho <odanrc@yahoo.com.br>2020-01-17 16:31:03 +0000
commit37bcb128fac31c7b0040fe03bc64b07d9b543ec6 (patch)
tree728bee050fdc9617d899f9d594d3bcdfa52d7cc6
parent7ff32d7b53b1a699f4383d3c9c5279b6ab894d55 (diff)
downloadgem5-37bcb128fac31c7b0040fe03bc64b07d9b543ec6.tar.xz
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>
-rw-r--r--src/mem/cache/tags/base.hh2
-rw-r--r--src/mem/cache/tags/base_set_assoc.hh2
-rw-r--r--src/mem/cache/tags/compressed_tags.cc2
-rw-r--r--src/mem/cache/tags/compressed_tags.hh2
-rw-r--r--src/mem/cache/tags/fa_lru.cc2
-rw-r--r--src/mem/cache/tags/fa_lru.hh2
-rw-r--r--src/mem/cache/tags/sector_tags.cc2
-rw-r--r--src/mem/cache/tags/sector_tags.hh2
8 files changed, 8 insertions, 8 deletions
diff --git a/src/mem/cache/tags/base.hh b/src/mem/cache/tags/base.hh
index 0a9f16bd3..88d08ca8f 100644
--- a/src/mem/cache/tags/base.hh
+++ b/src/mem/cache/tags/base.hh
@@ -280,7 +280,7 @@ class BaseTags : public ClockedObject
*/
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 efb08caa6..094999404 100644
--- a/src/mem/cache/tags/base_set_assoc.hh
+++ b/src/mem/cache/tags/base_set_assoc.hh
@@ -167,7 +167,7 @@ class BaseSetAssoc : public BaseTags
*/
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 1394be855..1871a7ad6 100644
--- a/src/mem/cache/tags/compressed_tags.cc
+++ b/src/mem/cache/tags/compressed_tags.cc
@@ -103,7 +103,7 @@ CompressedTags::tagsInit()
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 2c2a69987..cce76fc7b 100644
--- a/src/mem/cache/tags/compressed_tags.hh
+++ b/src/mem/cache/tags/compressed_tags.hh
@@ -109,7 +109,7 @@ class CompressedTags : public SectorTags
*/
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 5738dcb50..2b3ef1b5c 100644
--- a/src/mem/cache/tags/fa_lru.cc
+++ b/src/mem/cache/tags/fa_lru.cc
@@ -197,7 +197,7 @@ FALRU::findBlockBySetAndWay(int set, int way) const
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 2ca9f4da4..199a82f5f 100644
--- a/src/mem/cache/tags/fa_lru.hh
+++ b/src/mem/cache/tags/fa_lru.hh
@@ -225,7 +225,7 @@ class FALRU : public BaseTags
*/
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 77fb53cda..610cba8ce 100644
--- a/src/mem/cache/tags/sector_tags.cc
+++ b/src/mem/cache/tags/sector_tags.cc
@@ -222,7 +222,7 @@ SectorTags::findBlock(Addr addr, bool is_secure) const
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 13638b4a5..905a87aaf 100644
--- a/src/mem/cache/tags/sector_tags.hh
+++ b/src/mem/cache/tags/sector_tags.hh
@@ -157,7 +157,7 @@ class SectorTags : public BaseTags
*/
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.