diff --git a/src/mem/cache/base.cc b/src/mem/cache/base.cc index ce6cbe89ca..e738167066 100644 --- a/src/mem/cache/base.cc +++ b/src/mem/cache/base.cc @@ -773,7 +773,8 @@ BaseCache::updateBlockData(CacheBlk *blk, const PacketPtr cpkt, bool has_old_data) { CacheDataUpdateProbeArg data_update( - regenerateBlkAddr(blk), blk->isSecure(), accessor); + regenerateBlkAddr(blk), blk->isSecure(), + blk->getSrcRequestorId(), accessor); if (ppDataUpdate->hasListeners()) { if (has_old_data) { data_update.oldData = std::vector(blk->data, @@ -790,6 +791,7 @@ BaseCache::updateBlockData(CacheBlk *blk, const PacketPtr cpkt, if (cpkt) { data_update.newData = std::vector(blk->data, blk->data + (blkSize / sizeof(uint64_t))); + data_update.hwPrefetched = blk->wasPrefetched(); } ppDataUpdate->notify(data_update); } @@ -812,7 +814,8 @@ BaseCache::cmpAndSwap(CacheBlk *blk, PacketPtr pkt) // Get a copy of the old block's contents for the probe before the update CacheDataUpdateProbeArg data_update( - regenerateBlkAddr(blk), blk->isSecure(), accessor); + regenerateBlkAddr(blk), blk->isSecure(), blk->getSrcRequestorId(), + accessor); if (ppDataUpdate->hasListeners()) { data_update.oldData = std::vector(blk->data, blk->data + (blkSize / sizeof(uint64_t))); @@ -1110,7 +1113,8 @@ BaseCache::satisfyRequest(PacketPtr pkt, CacheBlk *blk, bool, bool) // Get a copy of the old block's contents for the probe before // the update CacheDataUpdateProbeArg data_update( - regenerateBlkAddr(blk), blk->isSecure(), accessor); + regenerateBlkAddr(blk), blk->isSecure(), + blk->getSrcRequestorId(), accessor); if (ppDataUpdate->hasListeners()) { data_update.oldData = std::vector(blk->data, blk->data + (blkSize / sizeof(uint64_t))); @@ -1129,6 +1133,7 @@ BaseCache::satisfyRequest(PacketPtr pkt, CacheBlk *blk, bool, bool) if (ppDataUpdate->hasListeners()) { data_update.newData = std::vector(blk->data, blk->data + (blkSize / sizeof(uint64_t))); + data_update.hwPrefetched = blk->wasPrefetched(); ppDataUpdate->notify(data_update); } diff --git a/src/mem/cache/cache_probe_arg.hh b/src/mem/cache/cache_probe_arg.hh index b70e0269ee..49c0171e2f 100644 --- a/src/mem/cache/cache_probe_arg.hh +++ b/src/mem/cache/cache_probe_arg.hh @@ -95,17 +95,23 @@ struct CacheDataUpdateProbeArg Addr addr; /** Whether the block belongs to the secure address space. */ bool isSecure; + /** Block original requestor */ + const RequestorID requestorID; /** The stale data contents. If zero-sized this update is a fill. */ std::vector oldData; /** The new data contents. If zero-sized this is an invalidation. */ std::vector newData; + /** Set if the update is from a prefetch or evicting a prefetched + * block that was never used. */ + bool hwPrefetched; /** Accessor for the cache */ CacheAccessor &accessor; CacheDataUpdateProbeArg(Addr _addr, bool is_secure, + RequestorID _requestorID, CacheAccessor &_accessor) - : addr(_addr), isSecure(is_secure), oldData(), newData(), - accessor(_accessor) + : addr(_addr), isSecure(is_secure), requestorID(_requestorID), + oldData(), newData(), accessor(_accessor) { } };