mem-cache: Add print function to ReplaceableEntry
[gem5.git] / src / mem / cache / cache_blk.cc
index a77fc630af385c3df73c2fb871f1a3ea877a6751..c4730caebc718d29714e9b76729dbf559743c474 100644 (file)
@@ -46,6 +46,9 @@ void
 CacheBlk::insert(const Addr tag, const bool is_secure,
                  const int src_master_ID, const uint32_t task_ID)
 {
+    // Make sure that the block has been properly invalidated
+    assert(status == 0);
+
     // Set block tag
     this->tag = tag;
 
@@ -63,10 +66,11 @@ CacheBlk::insert(const Addr tag, const bool is_secure,
 
     // Set secure state
     if (is_secure) {
-        status = BlkSecure;
-    } else {
-        status = 0;
+        setSecure();
     }
+
+    // Validate block
+    setValid();
 }
 
 void