summaryrefslogtreecommitdiff
path: root/src/mem/cache/tags/base.hh
diff options
context:
space:
mode:
authorDaniel R. Carvalho <odanrc@yahoo.com.br>2018-03-09 15:04:20 +0100
committerDaniel Carvalho <odanrc@yahoo.com.br>2018-10-10 18:17:42 +0000
commitd204e56b2b9b8ad561fc258ebdc50ae8365159e1 (patch)
tree52783a7a32db7d055cb85e5454e6512c22cb2b1c /src/mem/cache/tags/base.hh
parent99a6c94e58b6375c0d524530cab2a27b6ea0f2bc (diff)
downloadgem5-d204e56b2b9b8ad561fc258ebdc50ae8365159e1.tar.xz
mem-cache: Use possible locations to find block
Use possible locations to find block to make it placement policy independent. Change-Id: I4c9d9e1e1ff91ce12e85ca1970f927d8f4f5a93b Reviewed-on: https://gem5-review.googlesource.com/c/8884 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'src/mem/cache/tags/base.hh')
-rw-r--r--src/mem/cache/tags/base.hh20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/mem/cache/tags/base.hh b/src/mem/cache/tags/base.hh
index 385d25c9f..7badc46c2 100644
--- a/src/mem/cache/tags/base.hh
+++ b/src/mem/cache/tags/base.hh
@@ -161,6 +161,18 @@ class BaseTags : public ClockedObject
*/
void setCache(BaseCache *_cache);
+ /**
+ * Find all possible block locations for insertion and replacement of
+ * an address. Should be called immediately before ReplacementPolicy's
+ * findVictim() not to break cache resizing.
+ * Returns blocks in all ways belonging to the set of the address.
+ *
+ * @param addr The addr to a find possible locations for.
+ * @return The possible locations.
+ */
+ virtual std::vector<ReplaceableEntry*> getPossibleLocations(
+ const Addr addr) const;
+
public:
typedef BaseTagsParams Params;
BaseTags(const Params *p);
@@ -199,9 +211,13 @@ class BaseTags : public ClockedObject
std::string print();
/**
- * Find a block using the memory address
+ * Finds the block in the cache without touching it.
+ *
+ * @param addr The address to look for.
+ * @param is_secure True if the target memory space is secure.
+ * @return Pointer to the cache block.
*/
- virtual CacheBlk * findBlock(Addr addr, bool is_secure) const = 0;
+ virtual CacheBlk *findBlock(Addr addr, bool is_secure) const;
/**
* Find a block given set and way.