summaryrefslogtreecommitdiff
path: root/src/mem/cache/blk.hh
diff options
context:
space:
mode:
authorDaniel R. Carvalho <odanrc@yahoo.com.br>2018-03-27 11:53:33 +0200
committerDaniel Carvalho <odanrc@yahoo.com.br>2018-05-03 14:25:29 +0000
commitc149983d931054d8cf88d2977a1f03a0b8b3b543 (patch)
tree1651101f29d8b06098394ffb078bf2716348664a /src/mem/cache/blk.hh
parentddb80527e37e505e74b04755da502934ce8f0645 (diff)
downloadgem5-c149983d931054d8cf88d2977a1f03a0b8b3b543.tar.xz
mem-cache: ReplacementPolicy specific replacement data
Replacement data is specific for each replacement policy, and thus should be instantiated differently by each policy. Touch() and reset() do not need to be aware of CacheBlk, as they only update its ReplacementData. Invalidate() makes replacement policies independent of cache blocks, by removing the awareness of the valid state. An inheritable base ReplaceableEntry class was created to allow usage of replacement policies with any table-like structure. Change-Id: I998917d800fa48504ed95abffa2f1b7bfd68522b Reviewed-on: https://gem5-review.googlesource.com/9421 Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Diffstat (limited to 'src/mem/cache/blk.hh')
-rw-r--r--src/mem/cache/blk.hh20
1 files changed, 5 insertions, 15 deletions
diff --git a/src/mem/cache/blk.hh b/src/mem/cache/blk.hh
index 65f32ff91..b57c61b63 100644
--- a/src/mem/cache/blk.hh
+++ b/src/mem/cache/blk.hh
@@ -51,6 +51,7 @@
#include <list>
#include "base/printable.hh"
+#include "mem/cache/replacement_policies/base.hh"
#include "mem/packet.hh"
#include "mem/request.hh"
@@ -76,7 +77,7 @@ enum CacheBlkStatusBits : unsigned {
* A Basic Cache block.
* Contains the tag, status, and a pointer to data.
*/
-class CacheBlk
+class CacheBlk : public ReplaceableEntry
{
public:
/** Task Id associated with this block */
@@ -109,9 +110,9 @@ class CacheBlk
int set, way;
/**
- * Whether this block has been touched since simulation started.
- * Used to calculate number of used tags.
- */
+ * Whether this block has been touched since simulation started.
+ * Used to calculate number of used tags.
+ */
bool isTouched;
/** Number of references to this block since it was brought in. */
@@ -123,17 +124,6 @@ class CacheBlk
/** Tick on which the block was inserted in the cache. */
Tick tickInserted;
- /**
- * Replacement policy data. As of now it is only an update timestamp.
- * Tick on which the block was last touched.
- */
- Tick lastTouchTick;
-
- /**
- * Re-Reference Interval Prediction Value. Used with RRIP repl policy.
- */
- unsigned rrpv;
-
protected:
/**
* Represents that the indicated thread context has a "lock" on