// if any of the deferred targets were upper-level cache
// requests marked downstreamPending, need to clear that
assert(!downstreamPending); // not pending here anymore
- deferredTargets.clearDownstreamPending();
- // this clears out deferredTargets too
- targets.splice(targets.end(), deferredTargets);
- deferredTargets.resetFlags();
+
+ auto last_it = std::find_if(
+ deferredTargets.begin(), deferredTargets.end(),
+ [](MSHR::Target &t) {
+ assert(t.source == Target::FromCPU);
+ return t.pkt->req->isCacheInvalidate();
+ });
+ deferredTargets.clearDownstreamPending(deferredTargets.begin(),
+ last_it);
+ targets.splice(targets.end(), deferredTargets,
+ deferredTargets.begin(), last_it);
+ // We need to update the flags for the target lists after the
+ // modifications
+ deferredTargets.populateFlags();
}
}
bool promoteDeferredTargets();
+ /**
+ * Promotes deferred targets that do not require writable
+ *
+ * Requests in the deferred target list are moved to the target
+ * list up until the first target that is a cache maintenance
+ * operation or needs a writable copy of the block
+ */
void promoteWritable();
bool checkFunctional(PacketPtr pkt);