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>
This commit is contained in:
Daniel R. Carvalho
2019-02-11 14:19:57 +01:00
committed by Daniel Carvalho
parent 9f32d74db8
commit d4cee4dc66
8 changed files with 83 additions and 12 deletions

View File

@@ -72,12 +72,12 @@ PacketQueue::retry()
}
bool
PacketQueue::hasAddr(Addr addr) const
PacketQueue::checkConflict(const PacketPtr pkt, const int blk_size) const
{
// caller is responsible for ensuring that all packets have the
// same alignment
for (const auto& p : transmitList) {
if (p.pkt->getAddr() == addr)
if (p.pkt->matchBlockAddr(pkt, blk_size))
return true;
}
return false;
@@ -138,8 +138,7 @@ PacketQueue::schedSendTiming(PacketPtr pkt, Tick when)
auto it = transmitList.end();
while (it != transmitList.begin()) {
--it;
if ((forceOrder && it->pkt->getAddr() == pkt->getAddr()) ||
it->tick <= when) {
if ((forceOrder && it->pkt->matchAddr(pkt)) || it->tick <= when) {
// emplace inserts the element before the position pointed to by
// the iterator, so advance it one step
transmitList.emplace(++it, when, pkt);