summaryrefslogtreecommitdiff
path: root/src/cpu/pred/btb.hh
diff options
context:
space:
mode:
authorMitch Hayenga <mitch.hayenga@arm.com>2016-04-05 11:44:27 -0500
committerMitch Hayenga <mitch.hayenga@arm.com>2016-04-05 11:44:27 -0500
commit7bc52af7716168baa5deb28bb88475ddbba5d62a (patch)
tree23cf6a6c94e8386b2c64c210a4a9e6962234faf8 /src/cpu/pred/btb.hh
parentf902c0218ae3a8df558f1427302fbf0931b8f7d7 (diff)
downloadgem5-7bc52af7716168baa5deb28bb88475ddbba5d62a.tar.xz
cpu: Fix BTB threading oversight
The extant BTB code doesn't hash on the thread id but does check the thread id for 'btb hits'. This results in 1-thread of a multi-threaded workload taking a BTB entry, and all other threads missing for the same branch missing.
Diffstat (limited to 'src/cpu/pred/btb.hh')
-rw-r--r--src/cpu/pred/btb.hh7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cpu/pred/btb.hh b/src/cpu/pred/btb.hh
index 3a773e40d..209bbdb49 100644
--- a/src/cpu/pred/btb.hh
+++ b/src/cpu/pred/btb.hh
@@ -66,7 +66,7 @@ class DefaultBTB
* @param instShiftAmt Offset amount for instructions to ignore alignment.
*/
DefaultBTB(unsigned numEntries, unsigned tagBits,
- unsigned instShiftAmt);
+ unsigned instShiftAmt, unsigned numThreads);
void reset();
@@ -97,7 +97,7 @@ class DefaultBTB
* @param inst_PC The branch to look up.
* @return Returns the index into the BTB.
*/
- inline unsigned getIndex(Addr instPC);
+ inline unsigned getIndex(Addr instPC, ThreadID tid);
/** Returns the tag bits of a given address.
* @param inst_PC The branch's address.
@@ -125,6 +125,9 @@ class DefaultBTB
/** Number of bits to shift PC when calculating tag. */
unsigned tagShiftAmt;
+
+ /** Log2 NumThreads used for hashing threadid */
+ unsigned log2NumThreads;
};
#endif // __CPU_PRED_BTB_HH__