*/
virtual CacheBlk * findBlock(Addr addr, bool is_secure) const = 0;
+ /**
+ * Find a block given set and way.
+ *
+ * @param set The set of the block.
+ * @param way The way of the block.
+ * @return The block.
+ */
+ virtual ReplaceableEntry* findBlockBySetAndWay(int set, int way) const = 0;
+
/**
* Align an address to the block size.
* @param addr the address to align.
return (addr & blkMask);
}
- /**
- * Find the cache block given set and way
- * @param set The set of the block.
- * @param way The way of the block.
- * @return The cache block.
- */
- virtual CacheBlk *findBlockBySetAndWay(int set, int way) const = 0;
-
/**
* Limit the allocation for the cache ways.
* @param ways The maximum number of ways available for replacement.
return blk;
}
-CacheBlk*
+ReplaceableEntry*
BaseSetAssoc::findBlockBySetAndWay(int set, int way) const
{
return sets[set].blks[way];
*/
void invalidate(CacheBlk *blk) override;
- /**
- * Find the cache block given set and way
- * @param set The set of the block.
- * @param way The way of the block.
- * @return The cache block.
- */
- CacheBlk *findBlockBySetAndWay(int set, int way) const override;
-
/**
* Access block and update replacement data. May not succeed, in which case
* nullptr is returned. This has all the implications of a cache
*/
CacheBlk* findBlock(Addr addr, bool is_secure) const override;
+ /**
+ * Find a block given set and way.
+ *
+ * @param set The set of the block.
+ * @param way The way of the block.
+ * @return The block.
+ */
+ ReplaceableEntry* findBlockBySetAndWay(int set, int way) const override;
+
/**
* Find replacement victim based on address.
*
return blk;
}
-CacheBlk*
+ReplaceableEntry*
FALRU::findBlockBySetAndWay(int set, int way) const
{
assert(set == 0);
*/
CacheBlk* findBlock(Addr addr, bool is_secure) const override;
+ /**
+ * Find a block given set and way.
+ *
+ * @param set The set of the block.
+ * @param way The way of the block.
+ * @return The block.
+ */
+ ReplaceableEntry* findBlockBySetAndWay(int set, int way) const override;
+
/**
* Find replacement victim based on address.
*
*/
void insertBlock(PacketPtr pkt, CacheBlk *blk) override;
- /**
- * Find the cache block given set and way
- * @param set The set of the block.
- * @param way The way of the block.
- * @return The cache block.
- */
- CacheBlk* findBlockBySetAndWay(int set, int way) const override;
-
/**
* Generate the tag from the addres. For fully associative this is just the
* block address.