summaryrefslogtreecommitdiff
path: root/src/mem/cache/mshr.hh
diff options
context:
space:
mode:
authorNikos Nikoleris <nikos.nikoleris@arm.com>2016-12-05 16:48:18 -0500
committerNikos Nikoleris <nikos.nikoleris@arm.com>2016-12-05 16:48:18 -0500
commitd28c2906f4125ce8704ce9cefa471f1a5050eeae (patch)
treed08ceec1036d613e97b858ae077afdc3225bf83a /src/mem/cache/mshr.hh
parentf7a5de3becd60b93d89684f8e387046c497c183a (diff)
downloadgem5-d28c2906f4125ce8704ce9cefa471f1a5050eeae.tar.xz
mem: Keep track of allocOnFill in the TargetList
Previously the information of whether a response was allocating or not was a property of the MSHR. This change makes this flag a property of the TargetList. Differernt TargetLists, e.g. the targets and the deferred targets lists might have different values. Additionally, the information about whether each of the target expects an allocating response is stored inside the TargetList container. This allows for repopulating the flag in case some of the targets are removed. Change-Id: If3ec2516992f42a6d9da907009ffe3ab8d0d2021 Reviewed-by: Andreas Hansson <andreas.hansson@arm.com> Reviewed-by: Stephan Diestelhorst <stephan.diestelhorst@arm.com>
Diffstat (limited to 'src/mem/cache/mshr.hh')
-rw-r--r--src/mem/cache/mshr.hh45
1 files changed, 36 insertions, 9 deletions
diff --git a/src/mem/cache/mshr.hh b/src/mem/cache/mshr.hh
index 253f5f388..437f8d4e4 100644
--- a/src/mem/cache/mshr.hh
+++ b/src/mem/cache/mshr.hh
@@ -128,11 +128,14 @@ class MSHR : public QueueEntry, public Printable
const Source source; //!< Request from cpu, memory, or prefetcher?
const bool markedPending; //!< Did we mark upstream MSHR
//!< as downstreamPending?
+ const bool allocOnFill; //!< Should the response servicing this
+ //!< target list allocate in the cache?
Target(PacketPtr _pkt, Tick _readyTime, Counter _order,
- Source _source, bool _markedPending)
+ Source _source, bool _markedPending, bool alloc_on_fill)
: recvTime(curTick()), readyTime(_readyTime), order(_order),
- pkt(_pkt), source(_source), markedPending(_markedPending)
+ pkt(_pkt), source(_source), markedPending(_markedPending),
+ allocOnFill(alloc_on_fill)
{}
};
@@ -141,6 +144,8 @@ class MSHR : public QueueEntry, public Printable
public:
bool needsWritable;
bool hasUpgrade;
+ /** Set when the response should allocate on fill */
+ bool allocOnFill;
TargetList();
@@ -150,10 +155,12 @@ class MSHR : public QueueEntry, public Printable
*
* @param pkt Packet considered for the flag update
* @param source Indicates the source of the packet
+ * @param alloc_on_fill Whether the pkt would allocate on a fill
*/
- void updateFlags(PacketPtr pkt, Target::Source source);
+ void updateFlags(PacketPtr pkt, Target::Source source,
+ bool alloc_on_fill);
- void resetFlags() { needsWritable = hasUpgrade = false; }
+ void resetFlags() { needsWritable = hasUpgrade = allocOnFill = false; }
/**
* Goes through the list of targets and uses them to populate
@@ -163,9 +170,29 @@ class MSHR : public QueueEntry, public Printable
*/
void populateFlags();
- bool isReset() const { return !needsWritable && !hasUpgrade; }
+ /**
+ * Tests if the flags of this TargetList have their default
+ * values.
+ */
+ bool isReset() const {
+ return !needsWritable && !hasUpgrade && !allocOnFill;
+ }
+
+ /**
+ * Add the specified packet in the TargetList. This function
+ * stores information related to the added packet and updates
+ * accordingly the flags.
+ *
+ * @param pkt Packet considered for adding
+ * @param readTime Tick at which the packet is processed by this cache
+ * @param order A counter giving a unique id to each target
+ * @param source Indicates the source agent of the packet
+ * @param markPending Set for deferred targets or pending MSHRs
+ * @param alloc_on_fill Whether it should allocate on a fill
+ */
void add(PacketPtr pkt, Tick readyTime, Counter order,
- Target::Source source, bool markPending);
+ Target::Source source, bool markPending,
+ bool alloc_on_fill);
/**
* Convert upgrades to the equivalent request if the cache line they
@@ -184,9 +211,6 @@ class MSHR : public QueueEntry, public Printable
/** MSHR list iterator. */
typedef List::iterator Iterator;
- /** Keep track of whether we should allocate on fill or not */
- bool allocOnFill;
-
/** The pending* and post* flags are only valid if inService is
* true. Using the accessor functions lets us detect if these
* flags are accessed improperly.
@@ -209,6 +233,9 @@ class MSHR : public QueueEntry, public Printable
bool sendPacket(Cache &cache);
+ bool allocOnFill() const {
+ return targets.allocOnFill;
+ }
private:
/**