mem-cache: Forward declare ReplaceableEntry
[gem5.git] / src / mem / cache / base.hh
index 04225c12f67906d1daeef116685169f85df1b0e9..4ba256b95dbef1a521abd5a50da54bbe040a9ba8 100644 (file)
@@ -334,7 +334,7 @@ class BaseCache : public MemObject
      * is an outstanding request that accesses the victim block) or
      * when we want to avoid allocation (e.g., exclusive caches)
      */
-    CacheBlk *tempBlock;
+    TempCacheBlk *tempBlock;
 
     /**
      * Upstream caches need this packet until true is returned, so
@@ -389,6 +389,16 @@ class BaseCache : public MemObject
             cmd.isLLSC();
     }
 
+    /**
+     * Regenerate block address using tags.
+     * Block address regeneration depends on whether we're using a temporary
+     * block or not.
+     *
+     * @param blk The block to regenerate address.
+     * @return The block's address.
+     */
+    Addr regenerateBlkAddr(CacheBlk* blk);
+
     /**
      * Does all the processing necessary to perform the provided request.
      * @param pkt The memory request to perform.
@@ -649,14 +659,14 @@ class BaseCache : public MemObject
      *
      * Find a victim block and if necessary prepare writebacks for any
      * existing data. May return nullptr if there are no replaceable
-     * blocks.
+     * blocks. If a replaceable block is found, it inserts the new block in
+     * its place. The new block, however, is not set as valid yet.
      *
-     * @param addr Physical address of the new block
-     * @param is_secure Set if the block should be secure
+     * @param pkt Packet holding the address to update
      * @param writebacks A list of writeback packets for the evicted blocks
      * @return the allocated block
      */
-    CacheBlk *allocateBlock(Addr addr, bool is_secure, PacketList &writebacks);
+    CacheBlk *allocateBlock(const PacketPtr pkt, PacketList &writebacks);
     /**
      * Evict a cache block.
      *