summaryrefslogtreecommitdiff
path: root/src/cpu/o3/store_set.cc
diff options
context:
space:
mode:
authorAli Saidi <Ali.Saidi@ARM.com>2011-08-19 15:08:07 -0500
committerAli Saidi <Ali.Saidi@ARM.com>2011-08-19 15:08:07 -0500
commitb6203360ef684a8dc32981221336f5d216ce2668 (patch)
treee4c8e7b374b2685f19016b0f3e79633a858ef8d2 /src/cpu/o3/store_set.cc
parent5f425b8bd1ac70b61fc57b7ec44c52cd7d8de9fb (diff)
downloadgem5-b6203360ef684a8dc32981221336f5d216ce2668.tar.xz
LSQ: Set store predictor to periodically clear itself as recommended in the storesets paper.
This patch improves performance by as much as 10% on some spec benchmarks.
Diffstat (limited to 'src/cpu/o3/store_set.cc')
-rw-r--r--src/cpu/o3/store_set.cc25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/cpu/o3/store_set.cc b/src/cpu/o3/store_set.cc
index fc87c417e..acd4a8d0a 100644
--- a/src/cpu/o3/store_set.cc
+++ b/src/cpu/o3/store_set.cc
@@ -34,8 +34,8 @@
#include "cpu/o3/store_set.hh"
#include "debug/StoreSet.hh"
-StoreSet::StoreSet(int _SSIT_size, int _LFST_size)
- : SSITSize(_SSIT_size), LFSTSize(_LFST_size)
+StoreSet::StoreSet(uint64_t clear_period, int _SSIT_size, int _LFST_size)
+ : clearPeriod(clear_period), SSITSize(_SSIT_size), LFSTSize(_LFST_size)
{
DPRINTF(StoreSet, "StoreSet: Creating store set object.\n");
DPRINTF(StoreSet, "StoreSet: SSIT size: %i, LFST size: %i.\n",
@@ -68,6 +68,8 @@ StoreSet::StoreSet(int _SSIT_size, int _LFST_size)
indexMask = SSITSize - 1;
offsetBits = 2;
+
+ memOpsPred = 0;
}
StoreSet::~StoreSet()
@@ -75,10 +77,11 @@ StoreSet::~StoreSet()
}
void
-StoreSet::init(int _SSIT_size, int _LFST_size)
+StoreSet::init(uint64_t clear_period, int _SSIT_size, int _LFST_size)
{
SSITSize = _SSIT_size;
LFSTSize = _LFST_size;
+ clearPeriod = clear_period;
DPRINTF(StoreSet, "StoreSet: Creating store set object.\n");
DPRINTF(StoreSet, "StoreSet: SSIT size: %i, LFST size: %i.\n",
@@ -103,6 +106,8 @@ StoreSet::init(int _SSIT_size, int _LFST_size)
indexMask = SSITSize - 1;
offsetBits = 2;
+
+ memOpsPred = 0;
}
@@ -180,8 +185,21 @@ StoreSet::violation(Addr store_PC, Addr load_PC)
}
void
+StoreSet::checkClear()
+{
+ memOpsPred++;
+ if (memOpsPred > clearPeriod) {
+ DPRINTF(StoreSet, "Wiping predictor state beacuse %d ld/st executed\n",
+ clearPeriod);
+ memOpsPred = 0;
+ clear();
+ }
+}
+
+void
StoreSet::insertLoad(Addr load_PC, InstSeqNum load_seq_num)
{
+ checkClear();
// Does nothing.
return;
}
@@ -193,6 +211,7 @@ StoreSet::insertStore(Addr store_PC, InstSeqNum store_seq_num, ThreadID tid)
int store_SSID;
+ checkClear();
assert(index < SSITSize);
if (!validSSIT[index]) {