mem-cache: Add match functions to QueueEntry

Having the caller decide the matching logic is error-prone, and
frequently ends up with the secure bit being forgotten. This
change adds matching functions to the QueueEntry to avoid this
problem.

As a side effect the signature of findPending has been changed.

Change-Id: I6e494a821c1e6e841ab103ec69632c0e1b269a08
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17530
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
This commit is contained in:
Daniel R. Carvalho
2019-01-24 15:00:18 +01:00
committed by Daniel Carvalho
parent d4cee4dc66
commit 2d84dc46ba
7 changed files with 100 additions and 19 deletions

View File

@@ -119,13 +119,40 @@ class QueueEntry : public Packet::SenderState
/** True if the entry targets the secure memory space. */
bool isSecure;
QueueEntry() : readyTime(0), _isUncacheable(false),
inService(false), order(0), blkAddr(0), blkSize(0),
isSecure(false)
QueueEntry()
: readyTime(0), _isUncacheable(false),
inService(false), order(0), blkAddr(0), blkSize(0), isSecure(false)
{}
bool isUncacheable() const { return _isUncacheable; }
/**
* Check if entry corresponds to the one being looked for.
*
* @param addr Address to match against.
* @param is_secure Whether the target should be in secure space or not.
* @return True if entry matches given information.
*/
virtual bool matchBlockAddr(const Addr addr, const bool is_secure)
const = 0;
/**
* Check if entry contains a packet that corresponds to the one being
* looked for.
*
* @param pkt The packet to search for.
* @return True if any of its targets' packets matches the given one.
*/
virtual bool matchBlockAddr(const PacketPtr pkt) const = 0;
/**
* Check if given entry's packets conflict with this' entries packets.
*
* @param entry Other entry to compare against.
* @return True if entry matches given information.
*/
virtual bool conflictAddr(const QueueEntry* entry) const = 0;
/**
* Send this queue entry as a downstream packet, with the exact
* behaviour depending on the specific entry type.