diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2015-03-27 04:55:55 -0400 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2015-03-27 04:55:55 -0400 |
commit | 7bae98459cc442f0c22d4eeac5901b61ea39c801 (patch) | |
tree | 112d5d799c511fa5b4306d08d73ad7012d0aef9b /src/mem/cache/mshr_queue.cc | |
parent | 15f0d9ff1441886eb6431544d9d3571f56a14840 (diff) | |
download | gem5-7bae98459cc442f0c22d4eeac5901b61ea39c801.tar.xz |
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.
Diffstat (limited to 'src/mem/cache/mshr_queue.cc')
-rw-r--r-- | src/mem/cache/mshr_queue.cc | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/src/mem/cache/mshr_queue.cc b/src/mem/cache/mshr_queue.cc index 72e9b2ec3..788793aff 100644 --- a/src/mem/cache/mshr_queue.cc +++ b/src/mem/cache/mshr_queue.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 ARM Limited + * Copyright (c) 2012-2013, 2015 ARM Limited * All rights reserved. * * The license below extends only to copyright in the software and shall @@ -66,13 +66,13 @@ MSHRQueue::MSHRQueue(const std::string &_label, } MSHR * -MSHRQueue::findMatch(Addr addr, bool is_secure) const +MSHRQueue::findMatch(Addr blk_addr, bool is_secure) const { MSHR::ConstIterator i = allocatedList.begin(); MSHR::ConstIterator end = allocatedList.end(); for (; i != end; ++i) { MSHR *mshr = *i; - if (mshr->addr == addr && mshr->isSecure == is_secure) { + if (mshr->blkAddr == blk_addr && mshr->isSecure == is_secure) { return mshr; } } @@ -80,7 +80,8 @@ MSHRQueue::findMatch(Addr addr, bool is_secure) const } bool -MSHRQueue::findMatches(Addr addr, bool is_secure, vector<MSHR*>& matches) const +MSHRQueue::findMatches(Addr blk_addr, bool is_secure, + vector<MSHR*>& matches) const { // Need an empty vector assert(matches.empty()); @@ -89,7 +90,7 @@ MSHRQueue::findMatches(Addr addr, bool is_secure, vector<MSHR*>& matches) const MSHR::ConstIterator end = allocatedList.end(); for (; i != end; ++i) { MSHR *mshr = *i; - if (mshr->addr == addr && mshr->isSecure == is_secure) { + if (mshr->blkAddr == blk_addr && mshr->isSecure == is_secure) { retval = true; matches.push_back(mshr); } @@ -106,7 +107,7 @@ MSHRQueue::checkFunctional(PacketPtr pkt, Addr blk_addr) MSHR::ConstIterator end = allocatedList.end(); for (; i != end; ++i) { MSHR *mshr = *i; - if (mshr->addr == blk_addr && mshr->checkFunctional(pkt)) { + if (mshr->blkAddr == blk_addr && mshr->checkFunctional(pkt)) { pkt->popLabel(); return true; } @@ -117,20 +118,14 @@ MSHRQueue::checkFunctional(PacketPtr pkt, Addr blk_addr) MSHR * -MSHRQueue::findPending(Addr addr, int size, bool is_secure) const +MSHRQueue::findPending(Addr blk_addr, bool is_secure) const { MSHR::ConstIterator i = readyList.begin(); MSHR::ConstIterator end = readyList.end(); for (; i != end; ++i) { MSHR *mshr = *i; - if (mshr->isSecure == is_secure) { - if (mshr->addr < addr) { - if (mshr->addr + mshr->size > addr) - return mshr; - } else { - if (addr + size > mshr->addr) - return mshr; - } + if (mshr->blkAddr == blk_addr && mshr->isSecure == is_secure) { + return mshr; } } return NULL; @@ -157,15 +152,15 @@ MSHRQueue::addToReadyList(MSHR *mshr) MSHR * -MSHRQueue::allocate(Addr addr, int size, PacketPtr &pkt, - Tick when, Counter order) +MSHRQueue::allocate(Addr blk_addr, unsigned blk_size, PacketPtr pkt, + Tick when_ready, Counter order) { assert(!freeList.empty()); MSHR *mshr = freeList.front(); assert(mshr->getNumTargets() == 0); freeList.pop_front(); - mshr->allocate(addr, size, pkt, when, order); + mshr->allocate(blk_addr, blk_size, pkt, when_ready, order); mshr->allocIter = allocatedList.insert(allocatedList.end(), mshr); mshr->readyIter = addToReadyList(mshr); |