From 48281375ee23283d24cf9d7fe5f6315afdb3a6fc Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Tue, 5 May 2015 03:22:33 -0400 Subject: 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. --- src/cpu/minor/lsq.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cpu/minor/lsq.cc') diff --git a/src/cpu/minor/lsq.cc b/src/cpu/minor/lsq.cc index ff609deac..db57daa37 100644 --- a/src/cpu/minor/lsq.cc +++ b/src/cpu/minor/lsq.cc @@ -926,7 +926,7 @@ LSQ::tryToSendToTransfers(LSQRequestPtr request) bool is_load = request->isLoad; bool is_llsc = request->request.isLLSC(); bool is_swap = request->request.isSwap(); - bool bufferable = !(request->request.isUncacheable() || + bool bufferable = !(request->request.isStrictlyOrdered() || is_llsc || is_swap); if (is_load) { -- cgit v1.2.3