summaryrefslogtreecommitdiff
path: root/src/mem/cache/blk.hh
diff options
context:
space:
mode:
authorNikos Nikoleris <nikos.nikoleris@arm.com>2016-10-31 13:33:35 +0000
committerNikos Nikoleris <nikos.nikoleris@arm.com>2018-03-07 10:33:36 +0000
commit9bd467bf72854b613bb366e8adac75c9cfe883c3 (patch)
tree49cf3ea60a7598789541becf25bdec6397f9eba2 /src/mem/cache/blk.hh
parentf80e7c072fcac179b98dbbac8cc90dba68af9cf4 (diff)
downloadgem5-9bd467bf72854b613bb366e8adac75c9cfe883c3.tar.xz
mem-cache: Make invalidate a common function between tag classes
invalidate was defined as a separate function in the base associative and fully-associative tags classes although both functions should implement identical functionality. This patch moves the invalidate function in the base tags class. Change-Id: I206ee969b00ab9e05873c6d87531474fcd712907 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/8286 Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Diffstat (limited to 'src/mem/cache/blk.hh')
-rw-r--r--src/mem/cache/blk.hh17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/mem/cache/blk.hh b/src/mem/cache/blk.hh
index 44691c122..66f05c884 100644
--- a/src/mem/cache/blk.hh
+++ b/src/mem/cache/blk.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2016 ARM Limited
+ * Copyright (c) 2012-2017 ARM Limited
* All rights reserved.
*
* The license below extends only to copyright in the software and shall
@@ -164,12 +164,9 @@ class CacheBlk
public:
CacheBlk()
- : task_id(ContextSwitchTaskId::Unknown),
- tag(0), data(0), status(0), whenReady(0),
- set(-1), way(-1), isTouched(false), refCount(0),
- srcMasterId(Request::invldMasterId),
- tickInserted(0)
- {}
+ {
+ invalidate();
+ }
CacheBlk(const CacheBlk&) = delete;
CacheBlk& operator=(const CacheBlk&) = delete;
@@ -210,8 +207,14 @@ class CacheBlk
*/
void invalidate()
{
+ tag = MaxAddr;
+ task_id = ContextSwitchTaskId::Unknown;
status = 0;
+ whenReady = MaxTick;
isTouched = false;
+ refCount = 0;
+ srcMasterId = Request::invldMasterId;
+ tickInserted = MaxTick;
lockList.clear();
}