mem-cache: Fix non-bijective function in Skewed caches
[gem5.git] / src / mem / cache / blk.hh
index 48deef52a4a32f3a805794476743cce309bb50b1..3bb0317cc43b7c4b6a9c6164ee86291036e67305 100644 (file)
@@ -406,10 +406,17 @@ class TempCacheBlk final : public CacheBlk
     Addr _addr;
 
   public:
-    TempCacheBlk() : CacheBlk() {}
+    /**
+     * Creates a temporary cache block, with its own storage.
+     * @param size The size (in bytes) of this cache block.
+     */
+    TempCacheBlk(unsigned size) : CacheBlk()
+    {
+        data = new uint8_t[size];
+    }
     TempCacheBlk(const TempCacheBlk&) = delete;
     TempCacheBlk& operator=(const TempCacheBlk&) = delete;
-    ~TempCacheBlk() {};
+    ~TempCacheBlk() { delete [] data; };
 
     /**
      * Invalidate the block and clear all state.
@@ -420,15 +427,8 @@ class TempCacheBlk final : public CacheBlk
         _addr = MaxAddr;
     }
 
-    /**
-     * Set member variables when a block insertion occurs. A TempCacheBlk does
-     * not have all the information required to regenerate the block's address,
-     * so it is provided the address itself for easy regeneration.
-     *
-     * @param addr Block address.
-     * @param is_secure Whether the block is in secure space or not.
-     */
-    void insert(const Addr addr, const bool is_secure)
+    void insert(const Addr addr, const bool is_secure,
+                const int src_master_ID=0, const uint32_t task_ID=0) override
     {
         // Set block address
         _addr = addr;