// Initial target is used just for stats
MSHR::Target *initial_tgt = mshr->getTarget();
- CacheBlk *blk = tags->findBlock(pkt->getAddr(), pkt->isSecure());
int stats_cmd_idx = initial_tgt->pkt->cmdToIndex();
Tick miss_latency = curTick() - initial_tgt->recvTime;
PacketList writebacks;
miss_latency;
}
+ // upgrade deferred targets if we got exclusive
+ if (!pkt->sharedAsserted()) {
+ mshr->promoteExclusive();
+ }
+
bool is_fill = !mshr->isForward &&
(pkt->isRead() || pkt->cmd == MemCmd::UpgradeResp);
+ CacheBlk *blk = tags->findBlock(pkt->getAddr(), pkt->isSecure());
+
if (is_fill && !is_error) {
DPRINTF(Cache, "Block for addr %#llx being updated in Cache\n",
pkt->getAddr());
- // give mshr a chance to do some dirty work
- mshr->handleFill(pkt, blk);
-
blk = handleFill(pkt, blk, writebacks);
assert(blk != NULL);
}
// from above.
if (tgt_pkt->cmd == MemCmd::WriteLineReq) {
assert(!is_error);
-
+ // we got the block in exclusive state, so promote any
+ // deferred targets if possible
+ mshr->promoteExclusive();
// NB: we use the original packet here and not the response!
- mshr->handleFill(tgt_pkt, blk);
blk = handleFill(tgt_pkt, blk, writebacks);
assert(blk != NULL);
void
-MSHR::handleFill(PacketPtr pkt, CacheBlk *blk)
+MSHR::promoteExclusive()
{
- if (!pkt->sharedAsserted()
- && !(hasPostInvalidate() || hasPostDowngrade())
- && deferredTargets.needsExclusive) {
+ if (deferredTargets.needsExclusive &&
+ !(hasPostInvalidate() || hasPostDowngrade())) {
// We got an exclusive response, but we have deferred targets
// which are waiting to request an exclusive copy (not because
// of a pending invalidate). This can happen if the original