summaryrefslogtreecommitdiff
path: root/src/mem/cache
diff options
context:
space:
mode:
authorDaniel R. Carvalho <odanrc@yahoo.com.br>2019-02-11 14:19:57 +0100
committerDaniel Carvalho <odanrc@yahoo.com.br>2019-04-19 16:34:00 +0000
commitd4cee4dc66e175dd6cea7e9bcbe815a7d2d35462 (patch)
tree1a752ebda1a8a5c85dc9bd8471050f48a2e7ed8a /src/mem/cache
parent9f32d74db86c8977ab16f2671830f6cdfe3c068b (diff)
downloadgem5-d4cee4dc66e175dd6cea7e9bcbe815a7d2d35462.tar.xz
mem: Add packet matching functions
Add both block and non-block-aligned packet matching functions, so that both address and secure bits are checked when checking whether a packet matches a request. Change-Id: Id0069befb925d112e06f250741cb47d9dfa249cc Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17533 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Maintainer: Jason Lowe-Power <jason@lowepower.com> Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Diffstat (limited to 'src/mem/cache')
-rw-r--r--src/mem/cache/base.cc2
-rw-r--r--src/mem/cache/base.hh6
-rw-r--r--src/mem/cache/cache.cc4
3 files changed, 7 insertions, 5 deletions
diff --git a/src/mem/cache/base.cc b/src/mem/cache/base.cc
index f43c2ecf3..ddcfd80a7 100644
--- a/src/mem/cache/base.cc
+++ b/src/mem/cache/base.cc
@@ -2451,7 +2451,7 @@ BaseCache::CacheReqPacketQueue::sendDeferredPacket()
} else {
// let our snoop responses go first if there are responses to
// the same addresses
- if (checkConflictingSnoop(entry->blkAddr)) {
+ if (checkConflictingSnoop(entry->getTarget()->pkt)) {
return;
}
waitingOnRetry = entry->sendPacket(cache);
diff --git a/src/mem/cache/base.hh b/src/mem/cache/base.hh
index a45dcba6f..8d5ed11d0 100644
--- a/src/mem/cache/base.hh
+++ b/src/mem/cache/base.hh
@@ -189,10 +189,12 @@ class BaseCache : public MemObject
* send out, and if so simply stall any requests, and schedule
* a send event at the same time as the next snoop response is
* being sent out.
+ *
+ * @param pkt The packet to check for conflicts against.
*/
- bool checkConflictingSnoop(Addr addr)
+ bool checkConflictingSnoop(const PacketPtr pkt)
{
- if (snoopRespQueue.hasAddr(addr)) {
+ if (snoopRespQueue.checkConflict(pkt, cache.blkSize)) {
DPRINTF(CachePort, "Waiting for snoop response to be "
"sent\n");
Tick when = snoopRespQueue.deferredPacketReadyTime();
diff --git a/src/mem/cache/cache.cc b/src/mem/cache/cache.cc
index eac278a3b..4643e1d35 100644
--- a/src/mem/cache/cache.cc
+++ b/src/mem/cache/cache.cc
@@ -383,7 +383,7 @@ Cache::handleTimingReqMiss(PacketPtr pkt, CacheBlk *blk, Tick forward_time,
pkt->req->masterId());
pf = new Packet(req, pkt->cmd);
pf->allocate();
- assert(pf->getAddr() == pkt->getAddr());
+ assert(pf->matchAddr(pkt));
assert(pf->getSize() == pkt->getSize());
}
@@ -781,7 +781,7 @@ Cache::serviceMSHRTargets(MSHR *mshr, const PacketPtr pkt, CacheBlk *blk)
pkt->payloadDelay;
if (pkt->isRead() && !is_error) {
// sanity check
- assert(pkt->getAddr() == tgt_pkt->getAddr());
+ assert(pkt->matchAddr(tgt_pkt));
assert(pkt->getSize() >= tgt_pkt->getSize());
tgt_pkt->setData(pkt->getConstPtr<uint8_t>());