{}
-inline void
-MSHR::TargetList::add(PacketPtr pkt, Tick readyTime,
- Counter order, Target::Source source, bool markPending)
+void
+MSHR::TargetList::updateFlags(PacketPtr pkt, Target::Source source)
{
if (source != Target::FromSnoop) {
if (pkt->needsWritable()) {
hasUpgrade = true;
}
}
+}
+
+void
+MSHR::TargetList::populateFlags()
+{
+ resetFlags();
+ for (auto& t: *this) {
+ updateFlags(t.pkt, t.source);
+ }
+}
+inline void
+MSHR::TargetList::add(PacketPtr pkt, Tick readyTime,
+ Counter order, Target::Source source, bool markPending)
+{
+ updateFlags(pkt, source);
if (markPending) {
// Iterate over the SenderState stack and see if we find
// an MSHR entry. If we do, set the downstreamPending
bool hasUpgrade;
TargetList();
+
+ /**
+ * Use the provided packet and the source to update the
+ * flags of this TargetList.
+ *
+ * @param pkt Packet considered for the flag update
+ * @param source Indicates the source of the packet
+ */
+ void updateFlags(PacketPtr pkt, Target::Source source);
+
void resetFlags() { needsWritable = hasUpgrade = false; }
+
+ /**
+ * Goes through the list of targets and uses them to populate
+ * the flags of this TargetList. When the function returns the
+ * flags are consistent with the properties of packets in the
+ * list.
+ */
+ void populateFlags();
+
bool isReset() const { return !needsWritable && !hasUpgrade; }
void add(PacketPtr pkt, Tick readyTime, Counter order,
Target::Source source, bool markPending);