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>
This commit is contained in:
Daniel R. Carvalho
2018-10-19 12:28:25 +02:00
committed by Daniel Carvalho
parent 7ff32d7b53
commit 37bcb128fa
8 changed files with 8 additions and 8 deletions

View File

@@ -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

View File

@@ -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 =

View File

@@ -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 =

View File

@@ -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.

View File

@@ -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;

View File

@@ -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.

View File

@@ -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 =

View File

@@ -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.