mem-cache: Make the block invalidate functions virtual
authorNikos Nikoleris <nikos.nikoleris@arm.com>
Thu, 29 Jun 2017 03:46:51 +0000 (04:46 +0100)
committerNikos Nikoleris <nikos.nikoleris@arm.com>
Wed, 7 Mar 2018 10:34:16 +0000 (10:34 +0000)
This change makes the cache block invalidation function in the
BaseTags and CacheBlk class virtual to enable derived classes.

Change-Id: I2e64b01c6ca637f16d10474fc8b08eeec3f23453
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/8287
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
src/mem/cache/blk.hh

index 66f05c88479d1a8eccd891ec102cf3368b3e9e98..7dd0a92aed21c92a2db01b66a5721686e430d1f5 100644 (file)
@@ -170,6 +170,7 @@ class CacheBlk
 
     CacheBlk(const CacheBlk&) = delete;
     CacheBlk& operator=(const CacheBlk&) = delete;
+    virtual ~CacheBlk() {};
 
     /**
      * Checks the write permissions of this block.
@@ -205,7 +206,7 @@ class CacheBlk
     /**
      * Invalidate the block and clear all state.
      */
-    void invalidate()
+    virtual void invalidate()
     {
         tag = MaxAddr;
         task_id = ContextSwitchTaskId::Unknown;