summaryrefslogtreecommitdiff
path: root/src/mem/cache/blk.cc
diff options
context:
space:
mode:
authorDaniel R. Carvalho <odanrc@yahoo.com.br>2018-04-13 17:12:36 +0200
committerDaniel Carvalho <odanrc@yahoo.com.br>2018-05-08 21:46:21 +0000
commit0b0629cda6cbb4fdc1c1087c762c27c426e8a1c9 (patch)
treedf68c654288b7bb55c496f84d71674d8d77b262b /src/mem/cache/blk.cc
parent376f1b2ff7034f4d084a087a68307b11042d2a9d (diff)
downloadgem5-0b0629cda6cbb4fdc1c1087c762c27c426e8a1c9.tar.xz
mem-cache: Create block insertion function
Create a block insertion function to be used when inserting blocks. This resets the number of references to 1 (the insertion is taken into account), sets the insertion tick, and set secure state. Change-Id: Ifc34cbbd1c125207ce47912d188809221c7a157e Reviewed-on: https://gem5-review.googlesource.com/9824 Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Diffstat (limited to 'src/mem/cache/blk.cc')
-rw-r--r--src/mem/cache/blk.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/mem/cache/blk.cc b/src/mem/cache/blk.cc
index 9475bda31..233f38052 100644
--- a/src/mem/cache/blk.cc
+++ b/src/mem/cache/blk.cc
@@ -43,6 +43,36 @@
#include "base/cprintf.hh"
void
+CacheBlk::insert(const Addr tag, const State is_secure,
+ const int src_master_ID, const uint32_t task_ID)
+{
+ // Touch block
+ isTouched = true;
+
+ // Set block tag
+ this->tag = tag;
+
+ // Set source requestor ID
+ srcMasterId = src_master_ID;
+
+ // Set task ID
+ task_id = task_ID;
+
+ // Set insertion tick as current tick
+ tickInserted = curTick();
+
+ // Insertion counts as a reference to the block
+ refCount = 1;
+
+ // Set secure state
+ if (is_secure) {
+ status = BlkSecure;
+ } else {
+ status = 0;
+ }
+}
+
+void
CacheBlkPrintWrapper::print(std::ostream &os, int verbosity,
const std::string &prefix) const
{