bool destValid;
enum Flag {
- // Snoop flags
+ // Snoop response flags
MemInhibit,
Shared,
+ // Special control flags
+ /// Special timing-mode atomic snoop for multi-level coherence.
+ ExpressSnoop,
+ /// Does supplier have exclusive copy?
+ /// Useful for multi-level coherence.
+ SupplyExclusive,
NUM_PACKET_FLAGS
};
// Snoop flags
void assertMemInhibit() { flags[MemInhibit] = true; }
- void assertShared() { flags[Shared] = true; }
bool memInhibitAsserted() { return flags[MemInhibit]; }
+ void assertShared() { flags[Shared] = true; }
bool sharedAsserted() { return flags[Shared]; }
+ // Special control flags
+ void setExpressSnoop() { flags[ExpressSnoop] = true; }
+ bool isExpressSnoop() { return flags[ExpressSnoop]; }
+ void setSupplyExclusive() { flags[SupplyExclusive] = true; }
+ bool isSupplyExclusive() { return flags[SupplyExclusive]; }
+
// Network error conditions... encapsulate them as methods since
// their encoding keeps changing (from result field to command
// field, etc.)
}
/** Alternate constructor for copying a packet. Copy all fields
- * *except* set data allocation as static... even if the original
- * packet's data was dynamic, we don't want to free it when the
- * new packet is deallocated. Note that if original packet used
- * dynamic data, user must guarantee that the new packet's
- * lifetime is less than that of the original packet. */
- Packet(Packet *origPkt)
+ * *except* if the original packet's data was dynamic, don't copy
+ * that, as we can't guarantee that the new packet's lifetime is
+ * less than that of the original packet. In this case the new
+ * packet should allocate its own data. */
+ Packet(Packet *origPkt, bool clearFlags = false)
: cmd(origPkt->cmd), req(origPkt->req),
- data(NULL), staticData(false), dynamicData(false), arrayData(false),
+ data(origPkt->staticData ? origPkt->data : NULL),
+ staticData(origPkt->staticData),
+ dynamicData(false), arrayData(false),
addr(origPkt->addr), size(origPkt->size),
src(origPkt->src), dest(origPkt->dest),
addrSizeValid(origPkt->addrSizeValid),
srcValid(origPkt->srcValid), destValid(origPkt->destValid),
- flags(origPkt->flags),
+ flags(clearFlags ? 0 : origPkt->flags),
time(curTick), senderState(origPkt->senderState)
{
}
/** If there isn't data in the packet, allocate some. */
void allocate();
- /** Do the packet modify the same addresses. */
- bool intersect(PacketPtr p);
-
/**
* Check a functional request against a memory value represented
* by a base/size pair and an associated data array. If the