}
std::memcpy(blk->data, pkt->getPtr<uint8_t>(), blkSize);
blk->status |= BlkDirty;
+ if (pkt->isSupplyExclusive()) {
+ blk->status |= BlkWritable;
+ }
// nothing else to do; writeback doesn't expect response
assert(!pkt->needsResponse());
incHitCount(pkt, id);
Request *writebackReq =
new Request(tags->regenerateBlkAddr(blk->tag, blk->set), blkSize, 0);
PacketPtr writeback = new Packet(writebackReq, MemCmd::Writeback, -1);
+ if (blk->isWritable()) {
+ writeback->setSupplyExclusive();
+ }
writeback->allocate();
std::memcpy(writeback->getPtr<uint8_t>(), blk->data, blkSize);
pkt->assertMemInhibit();
if (!pkt->needsExclusive()) {
pkt->assertShared();
+ // the writeback is no longer the exclusive copy in the system
+ wb_pkt->clearSupplyExclusive();
} else {
// if we're not asserting the shared line, we need to
// invalidate our copy. we'll do that below as long as
void setExpressSnoop() { flags.set(EXPRESS_SNOOP); }
bool isExpressSnoop() { return flags.isSet(EXPRESS_SNOOP); }
void setSupplyExclusive() { flags.set(SUPPLY_EXCLUSIVE); }
+ void clearSupplyExclusive() { flags.clear(SUPPLY_EXCLUSIVE); }
bool isSupplyExclusive() { return flags.isSet(SUPPLY_EXCLUSIVE); }
// Network error conditions... encapsulate them as methods since