From: Tiago Mück Date: Fri, 26 Jul 2019 20:18:56 +0000 (-0500) Subject: cpu-minor: fix store-release issuing X-Git-Tag: v20.1.0.0~642 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2b63ba5700cd2dc6f2aaf34184aceb93e610dbba;p=gem5.git cpu-minor: fix store-release issuing Store with release flag are treated like store conditionals and are not bufferable. Also they are only sent when the store buffer is empty to satisfy the release semantics. Change-Id: I253ec5ecd39901b14d0dc8efbc82cf7e4b07f08f Signed-off-by: Tiago Mück Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27135 Reviewed-by: Anthony Gutierrez Maintainer: Anthony Gutierrez Tested-by: kokoro Tested-by: Gem5 Cloud Project GCB service account <345032938727@cloudbuild.gserviceaccount.com> --- diff --git a/src/cpu/minor/lsq.cc b/src/cpu/minor/lsq.cc index e50d49832..e4a9dc024 100644 --- a/src/cpu/minor/lsq.cc +++ b/src/cpu/minor/lsq.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014,2017-2018 ARM Limited + * Copyright (c) 2013-2014,2017-2018,2020 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall @@ -1029,10 +1029,11 @@ LSQ::tryToSendToTransfers(LSQRequestPtr request) bool is_load = request->isLoad; bool is_llsc = request->request->isLLSC(); + bool is_release = request->request->isRelease(); bool is_swap = request->request->isSwap(); bool is_atomic = request->request->isAtomic(); bool bufferable = !(request->request->isStrictlyOrdered() || - is_llsc || is_swap || is_atomic); + is_llsc || is_swap || is_atomic || is_release); if (is_load) { if (numStoresInTransfers != 0) { @@ -1050,6 +1051,15 @@ LSQ::tryToSendToTransfers(LSQRequestPtr request) } } + // Process store conditionals or store release after all previous + // stores are completed + if (((!is_load && is_llsc) || is_release) && + !storeBuffer.isDrained()) { + DPRINTF(MinorMem, "Memory access needs to wait for store buffer" + " to drain\n"); + return; + } + /* Check if this is the head instruction (and so must be executable as * its stream sequence number was checked above) for loads which must * not be speculatively issued and stores which must be issued here */