diff --git a/src/cpu/minor/lsq.cc b/src/cpu/minor/lsq.cc index e50d49832d..e4a9dc024e 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 */