diff options
author | Nikos Nikoleris <nikos.nikoleris@arm.com> | 2016-12-05 16:48:17 -0500 |
---|---|---|
committer | Nikos Nikoleris <nikos.nikoleris@arm.com> | 2016-12-05 16:48:17 -0500 |
commit | f7a5de3becd60b93d89684f8e387046c497c183a (patch) | |
tree | 6f0d30bcff179db5654dba49af6ef4726571155e /src/mem/cache/mshr.cc | |
parent | 3d0a537862dc66f7bd1ffb0965651a14297f2e80 (diff) | |
download | gem5-f7a5de3becd60b93d89684f8e387046c497c183a.tar.xz |
mem: Add support for repopulating the flags of an MSHR TargetList
This patch adds support for repopulating the flags of an MSHR
TargetList. The added functionality makes it possible to remove
targets from a TargetList without leaving it in an inconsistent state.
Change-Id: I3f7a8e97bfd3e2e49bebad056d11bbfb087aad91
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Reviewed-by: Stephan Diestelhorst <stephan.diestelhorst@arm.com>
Diffstat (limited to 'src/mem/cache/mshr.cc')
-rw-r--r-- | src/mem/cache/mshr.cc | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/mem/cache/mshr.cc b/src/mem/cache/mshr.cc index 86b5a4c08..dd827ae12 100644 --- a/src/mem/cache/mshr.cc +++ b/src/mem/cache/mshr.cc @@ -74,9 +74,8 @@ MSHR::TargetList::TargetList() {} -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()) { @@ -90,7 +89,22 @@ MSHR::TargetList::add(PacketPtr pkt, Tick readyTime, 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 |