From 25095534039245002b7e529eaa9ddef01a84d059 Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Fri, 12 Aug 2016 14:11:45 +0100 Subject: mem: Add a FromCache packet attribute This patch adds a FromCache attribute to the packet, and updates a number of the existing request commands to reflect that the request originates from a cache. The attribute simplifies checking if a requests came from a cache or not, and this is used by both the cache and snoop filter in follow-on patches. Change-Id: Ib0a7a080bbe4d6036ddd84b46fd45bc7eb41cd8f Reviewed-by: Nikos Nikoleris Reviewed-by: Jason Lowe-Power Reviewed-by: Tony Gutierrez Reviewed-by: Steve Reinhardt --- src/mem/cache/cache.cc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/mem/cache') diff --git a/src/mem/cache/cache.cc b/src/mem/cache/cache.cc index 15c2b7a54..c3f289123 100644 --- a/src/mem/cache/cache.cc +++ b/src/mem/cache/cache.cc @@ -191,14 +191,8 @@ Cache::satisfyCpuSideRequest(PacketPtr pkt, CacheBlk *blk, assert(pkt->hasRespData()); pkt->setDataFromBlock(blk->data, blkSize); - // determine if this read is from a (coherent) cache, or not - // by looking at the command type; we could potentially add a - // packet attribute such as 'FromCache' to make this check a - // bit cleaner - if (pkt->cmd == MemCmd::ReadExReq || - pkt->cmd == MemCmd::ReadSharedReq || - pkt->cmd == MemCmd::ReadCleanReq || - pkt->cmd == MemCmd::SCUpgradeFailReq) { + // determine if this read is from a (coherent) cache or not + if (pkt->fromCache()) { assert(pkt->getSize() == blkSize); // special handling for coherent block requests from // upper-level caches -- cgit v1.2.3