X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmem%2Fcache%2Fwrite_queue_entry.cc;h=f3106e4bcbeead9e30392e74cce915788c91c4ab;hb=6ff7e6db89844f2f5febc9e6647945d7a4b9dee4;hp=e393731b7e0d6c54c5e9a7b74cce52742724a32e;hpb=56865ad1154c7c3fde2ae6b7329d0c888390f781;p=gem5.git diff --git a/src/mem/cache/write_queue_entry.cc b/src/mem/cache/write_queue_entry.cc index e393731b7..f3106e4bc 100644 --- a/src/mem/cache/write_queue_entry.cc +++ b/src/mem/cache/write_queue_entry.cc @@ -66,10 +66,10 @@ WriteQueueEntry::TargetList::add(PacketPtr pkt, Tick readyTime, } bool -WriteQueueEntry::TargetList::checkFunctional(PacketPtr pkt) +WriteQueueEntry::TargetList::trySatisfyFunctional(PacketPtr pkt) { for (auto& t : *this) { - if (pkt->checkFunctional(t.pkt)) { + if (pkt->trySatisfyFunctional(t.pkt)) { return true; } } @@ -112,6 +112,9 @@ WriteQueueEntry::allocate(Addr blk_addr, unsigned blk_size, PacketPtr target, "a cacheable eviction or a writeclean"); targets.add(target, when_ready, _order); + + // All targets must refer to the same block + assert(target->matchBlockAddr(targets.front().pkt, blkSize)); } void @@ -122,16 +125,16 @@ WriteQueueEntry::deallocate() } bool -WriteQueueEntry::checkFunctional(PacketPtr pkt) +WriteQueueEntry::trySatisfyFunctional(PacketPtr pkt) { // For printing, we treat the WriteQueueEntry as a whole as single // entity. For other requests, we iterate over the individual // targets since that's where the actual data lies. if (pkt->isPrint()) { - pkt->checkFunctional(this, blkAddr, isSecure, blkSize, nullptr); + pkt->trySatisfyFunctional(this, blkAddr, isSecure, blkSize, nullptr); return false; } else { - return targets.checkFunctional(pkt); + return targets.trySatisfyFunctional(pkt); } } @@ -141,6 +144,27 @@ WriteQueueEntry::sendPacket(BaseCache &cache) return cache.sendWriteQueuePacket(this); } +bool +WriteQueueEntry::matchBlockAddr(const Addr addr, const bool is_secure) const +{ + assert(hasTargets()); + return (blkAddr == addr) && (isSecure == is_secure); +} + +bool +WriteQueueEntry::matchBlockAddr(const PacketPtr pkt) const +{ + assert(hasTargets()); + return pkt->matchBlockAddr(blkAddr, isSecure, blkSize); +} + +bool +WriteQueueEntry::conflictAddr(const QueueEntry* entry) const +{ + assert(hasTargets()); + return entry->matchBlockAddr(blkAddr, isSecure); +} + void WriteQueueEntry::print(std::ostream &os, int verbosity, const std::string &prefix) const