summaryrefslogtreecommitdiff
path: root/src/mem/cache
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2016-08-12 14:11:45 +0100
committerAndreas Hansson <andreas.hansson@arm.com>2016-08-12 14:11:45 +0100
commit25095534039245002b7e529eaa9ddef01a84d059 (patch)
tree2cb83b69ff13946906f4e7122064c72b8eaed9fc /src/mem/cache
parentda07c5c26aff7f453df478d8335d50b53ed777ae (diff)
downloadgem5-25095534039245002b7e529eaa9ddef01a84d059.tar.xz
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 <nikos.nikoleris@arm.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com> Reviewed-by: Steve Reinhardt <stever@gmail.com>
Diffstat (limited to 'src/mem/cache')
-rw-r--r--src/mem/cache/cache.cc10
1 files changed, 2 insertions, 8 deletions
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