blk->invalidate();
}
+void
+BaseCache::evictBlock(CacheBlk *blk, PacketList &writebacks)
+{
+ PacketPtr pkt = evictBlock(blk);
+ if (pkt) {
+ writebacks.push_back(pkt);
+ }
+}
+
PacketPtr
BaseCache::writebackBlk(CacheBlk *blk)
{
* @param blk Block to invalidate
* @param writebacks Return a list of packets with writebacks
*/
- virtual void evictBlock(CacheBlk *blk, PacketList &writebacks) = 0;
+ void evictBlock(CacheBlk *blk, PacketList &writebacks);
/**
* Invalidate a cache block.
// flush and invalidate any existing block
CacheBlk *old_blk(tags->findBlock(pkt->getAddr(), pkt->isSecure()));
if (old_blk && old_blk->isValid()) {
- evictBlock(old_blk, writebacks);
+ BaseCache::evictBlock(old_blk, writebacks);
}
blk = nullptr;
return pkt;
}
-void
-Cache::evictBlock(CacheBlk *blk, PacketList &writebacks)
-{
- PacketPtr pkt = evictBlock(blk);
- if (pkt) {
- writebacks.push_back(pkt);
- }
-}
-
PacketPtr
Cache::cleanEvictBlk(CacheBlk *blk)
{
M5_NODISCARD PacketPtr evictBlock(CacheBlk *blk) override;
- void evictBlock(CacheBlk *blk, PacketList &writebacks) override;
-
/**
* Create a CleanEvict request for the given block.
*
return pkt;
}
-void
-NoncoherentCache::evictBlock(CacheBlk *blk, PacketList &writebacks)
-{
- PacketPtr pkt = evictBlock(blk);
- if (pkt) {
- writebacks.push_back(pkt);
- }
-}
-
NoncoherentCache*
NoncoherentCacheParams::create()
{
M5_NODISCARD PacketPtr evictBlock(CacheBlk *blk) override;
- void evictBlock(CacheBlk *blk, PacketList &writebacks) override;
-
public:
NoncoherentCache(const NoncoherentCacheParams *p);
};