summaryrefslogtreecommitdiff
path: root/src/mem/request.hh
diff options
context:
space:
mode:
authorAndreas Sandberg <Andreas.Sandberg@ARM.com>2015-05-05 03:22:33 -0400
committerAndreas Sandberg <Andreas.Sandberg@ARM.com>2015-05-05 03:22:33 -0400
commit48281375ee23283d24cf9d7fe5f6315afdb3a6fc (patch)
tree8452e0a52752b913ac40fe9299c6d40f859d7e79 /src/mem/request.hh
parent1da634ace00dbae3165228b36655a62538c7c88d (diff)
downloadgem5-48281375ee23283d24cf9d7fe5f6315afdb3a6fc.tar.xz
mem, cpu: Add a separate flag for strictly ordered memory
The Request::UNCACHEABLE flag currently has two different functions. The first, and obvious, function is to prevent the memory system from caching data in the request. The second function is to prevent reordering and speculation in CPU models. This changeset gives the order/speculation requirement a separate flag (Request::STRICT_ORDER). This flag prevents CPU models from doing the following optimizations: * Speculation: CPU models are not allowed to issue speculative loads. * Write combining: CPU models and caches are not allowed to merge writes to the same cache line. Note: The memory system may still reorder accesses unless the UNCACHEABLE flag is set. It is therefore expected that the STRICT_ORDER flag is combined with the UNCACHEABLE flag to prevent this behavior.
Diffstat (limited to 'src/mem/request.hh')
-rw-r--r--src/mem/request.hh21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/mem/request.hh b/src/mem/request.hh
index 029636100..5a2130029 100644
--- a/src/mem/request.hh
+++ b/src/mem/request.hh
@@ -101,8 +101,24 @@ class Request
static const FlagsType INST_FETCH = 0x00000100;
/** The virtual address is also the physical address. */
static const FlagsType PHYSICAL = 0x00000200;
- /** The request is to an uncacheable address. */
- static const FlagsType UNCACHEABLE = 0x00001000;
+ /**
+ * The request is to an uncacheable address.
+ *
+ * @note Uncacheable accesses may be reordered by CPU models. The
+ * STRICT_ORDER flag should be set if such reordering is
+ * undesirable.
+ */
+ static const FlagsType UNCACHEABLE = 0x00000400;
+ /**
+ * The request is required to be strictly ordered by <i>CPU
+ * models</i> and is non-speculative.
+ *
+ * A strictly ordered request is guaranteed to never be re-ordered
+ * or executed speculatively by a CPU model. The memory system may
+ * still reorder requests in caches unless the UNCACHEABLE flag is
+ * set as well.
+ */
+ static const FlagsType STRICT_ORDER = 0x00000800;
/** This request is to a memory mapped register. */
static const FlagsType MMAPPED_IPR = 0x00002000;
/** This request is a clear exclusive. */
@@ -618,6 +634,7 @@ class Request
/** Accessor functions for flags. Note that these are for testing
only; setting flags should be done via setFlags(). */
bool isUncacheable() const { return _flags.isSet(UNCACHEABLE); }
+ bool isStrictlyOrdered() const { return _flags.isSet(STRICT_ORDER); }
bool isInstFetch() const { return _flags.isSet(INST_FETCH); }
bool isPrefetch() const { return _flags.isSet(PREFETCH); }
bool isLLSC() const { return _flags.isSet(LLSC); }