From f61818b3708becf5ac11247b3ff357596cff4b93 Mon Sep 17 00:00:00 2001 From: Tom Rollet Date: Thu, 9 Sep 2021 15:09:20 +0200 Subject: [PATCH] cpu-o3: remove false dummy entry in LSQ The constructor of the LoadQueue and StoreQueue were adding an additional entry compared to the given configuration. The removed comment was saying that this additional entry was used as a dummy entry. This is not necessary anymore with the current structure. It was even leading to incorrect behavior as a loadQueue could have one more outstanding load than specified by the configuration. Valgrind does not spot any illegal access. Change-Id: I41507d003e4d55e91215e21f57119af7b3e4d465 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50732 Reviewed-by: Bobby R. Bruce Maintainer: Bobby R. Bruce Tested-by: kokoro --- src/cpu/o3/lsq_unit.cc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/cpu/o3/lsq_unit.cc b/src/cpu/o3/lsq_unit.cc index 34db032fd0..8b7bca5589 100644 --- a/src/cpu/o3/lsq_unit.cc +++ b/src/cpu/o3/lsq_unit.cc @@ -200,7 +200,7 @@ LSQUnit::completeDataAccess(PacketPtr pkt) } LSQUnit::LSQUnit(uint32_t lqEntries, uint32_t sqEntries) - : lsqID(-1), storeQueue(sqEntries+1), loadQueue(lqEntries+1), + : lsqID(-1), storeQueue(sqEntries), loadQueue(lqEntries), storesToWB(0), htmStarts(0), htmStops(0), lastRetiredHtmUid(0), @@ -417,20 +417,16 @@ LSQUnit::getMemDepViolator() unsigned LSQUnit::numFreeLoadEntries() { - //LQ has an extra dummy entry to differentiate - //empty/full conditions. Subtract 1 from the free entries. DPRINTF(LSQUnit, "LQ size: %d, #loads occupied: %d\n", - 1 + loadQueue.capacity(), loadQueue.size()); + loadQueue.capacity(), loadQueue.size()); return loadQueue.capacity() - loadQueue.size(); } unsigned LSQUnit::numFreeStoreEntries() { - //SQ has an extra dummy entry to differentiate - //empty/full conditions. Subtract 1 from the free entries. DPRINTF(LSQUnit, "SQ size: %d, #stores occupied: %d\n", - 1 + storeQueue.capacity(), storeQueue.size()); + storeQueue.capacity(), storeQueue.size()); return storeQueue.capacity() - storeQueue.size(); }