Tom Rollet has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/50732 )

Change subject: cpu-o3: remove false dummy entry in LSQ
......................................................................

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 <[email protected]>
Maintainer: Bobby R. Bruce <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/cpu/o3/lsq_unit.cc
1 file changed, 28 insertions(+), 7 deletions(-)

Approvals:
  Bobby R. Bruce: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass




diff --git a/src/cpu/o3/lsq_unit.cc b/src/cpu/o3/lsq_unit.cc
index 34db032..8b7bca5 100644
--- a/src/cpu/o3/lsq_unit.cc
+++ b/src/cpu/o3/lsq_unit.cc
@@ -200,7 +200,7 @@
 }

 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 @@
 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();

  }

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/50732
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I41507d003e4d55e91215e21f57119af7b3e4d465
Gerrit-Change-Number: 50732
Gerrit-PatchSet: 3
Gerrit-Owner: Tom Rollet <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Bobby R. Bruce <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Hoa Nguyen <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Tom Rollet <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to