From 7bae98459cc442f0c22d4eeac5901b61ea39c801 Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Fri, 27 Mar 2015 04:55:55 -0400 Subject: mem: Align all MSHR entries to block boundaries This patch aligns all MSHR queue entries to block boundaries to simplify checks for matches. Previously there were corner cases that could lead to existing entries not being identified as matches. There are, rather alarmingly, a few regressions that change with this patch. --- src/mem/cache/base.hh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/mem/cache/base.hh') diff --git a/src/mem/cache/base.hh b/src/mem/cache/base.hh index cd2f55246..16160dba3 100644 --- a/src/mem/cache/base.hh +++ b/src/mem/cache/base.hh @@ -217,6 +217,11 @@ class BaseCache : public MemObject MSHR *allocateBufferInternal(MSHRQueue *mq, Addr addr, int size, PacketPtr pkt, Tick time, bool requestBus) { + // check that the address is block aligned since we rely on + // this in a number of places when checking for matches and + // overlap + assert(addr == blockAlign(addr)); + MSHR *mshr = mq->allocate(addr, size, pkt, time, order++); if (mq->isFull()) { @@ -506,7 +511,7 @@ class BaseCache : public MemObject { assert(pkt->isWrite() && !pkt->isRead()); return allocateBufferInternal(&writeBuffer, - pkt->getAddr(), pkt->getSize(), + blockAlign(pkt->getAddr()), blkSize, pkt, time, requestBus); } @@ -515,7 +520,7 @@ class BaseCache : public MemObject assert(pkt->req->isUncacheable()); assert(pkt->isRead()); return allocateBufferInternal(&mshrQueue, - pkt->getAddr(), pkt->getSize(), + blockAlign(pkt->getAddr()), blkSize, pkt, time, requestBus); } -- cgit v1.2.3