From 37bcb128fac31c7b0040fe03bc64b07d9b543ec6 Mon Sep 17 00:00:00 2001 From: "Daniel R. Carvalho" Date: Fri, 19 Oct 2018 12:28:25 +0200 Subject: [PATCH] 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 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22604 Tested-by: kokoro Reviewed-by: Nikos Nikoleris Maintainer: Nikos Nikoleris --- src/mem/cache/tags/base.hh | 2 +- src/mem/cache/tags/base_set_assoc.hh | 2 +- src/mem/cache/tags/compressed_tags.cc | 2 +- src/mem/cache/tags/compressed_tags.hh | 2 +- src/mem/cache/tags/fa_lru.cc | 2 +- src/mem/cache/tags/fa_lru.hh | 2 +- src/mem/cache/tags/sector_tags.cc | 2 +- src/mem/cache/tags/sector_tags.hh | 2 +- 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& evict_blks) const = 0; + std::vector& 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& evict_blks) const override + std::vector& evict_blks) override { // Get possible entries to be victimized const std::vector 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& evict_blks) const + std::vector& evict_blks) { // Get all possible locations of this superblock const std::vector 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& evict_blks) const override; + std::vector& 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& evict_blks) const + std::vector& 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& evict_blks) const override; + std::vector& 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& evict_blks) const + std::vector& evict_blks) { // Get possible entries to be victimized const std::vector 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& evict_blks) const override; + std::vector& evict_blks) override; /** * Calculate a block's offset in a sector from the address. -- 2.30.2