Skip to content

Commit fc34e6b

Browse files
jensen-yanYakkhini
andauthored
Resolve update mtbt and tage (#621)
* cpu-o3: only train single fetch block per cycle Change-Id: I75c3f5f704e39ac4dfd16909ce5da365a2de6a91 * cpu-o3: only enable ubtb,mbtb,tage now for tage aligning Change-Id: I41078918deeb1b6a514bcfb0bb5df2df578910d0 * cpu-o3: tage, mbtb use resolve update now Change-Id: I732d89766545b668bfce47ffe6be9f9b7161d569 --------- Co-authored-by: Yakkhini <59007159+Yakkhini@users.noreply.github.com>
1 parent 348f8f4 commit fc34e6b

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

configs/example/kmhv3.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,17 @@ def setKmhV3Params(args, system):
9494
cpu.branchPred.ftq_size = 256
9595
cpu.branchPred.fsq_size = 256
9696

97+
cpu.branchPred.mbtb.resolvedUpdate = True
98+
cpu.branchPred.tage.resolvedUpdate = True
99+
97100
cpu.branchPred.ubtb.enabled = True
98-
cpu.branchPred.abtb.enabled = True
101+
cpu.branchPred.abtb.enabled = False
99102
cpu.branchPred.microtage.enabled = False
100103
cpu.branchPred.mbtb.enabled = True
101104
cpu.branchPred.tage.enabled = True
102-
cpu.branchPred.ittage.enabled = True
103-
cpu.branchPred.mgsc.enabled = True
104-
cpu.branchPred.ras.enabled = True
105+
cpu.branchPred.ittage.enabled = False
106+
cpu.branchPred.mgsc.enabled = False
107+
cpu.branchPred.ras.enabled = False
105108

106109
# l1 cache per core
107110
if args.caches:

src/cpu/o3/iew.cc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,7 +1566,7 @@ IEW::SquashCheckAfterExe(DynInstPtr inst)
15661566
uint64_t fsqId = inst->getFsqId();
15671567
uint64_t pc = inst->getPC();
15681568
bool found = false;
1569-
for (auto &entry : toFetch->iewInfo[tid].resolveQueue) {
1569+
for (auto &entry : resolveQueue) {
15701570
if (entry.resolvedFSQId == fsqId) {
15711571
entry.resolvedInstPC.push_back(pc);
15721572
found = true;
@@ -1577,7 +1577,7 @@ IEW::SquashCheckAfterExe(DynInstPtr inst)
15771577
ResolveQueueEntry newEntry;
15781578
newEntry.resolvedFSQId = fsqId;
15791579
newEntry.resolvedInstPC.push_back(pc);
1580-
toFetch->iewInfo[tid].resolveQueue.push_back(newEntry);
1580+
resolveQueue.push_back(newEntry);
15811581
}
15821582

15831583
if (!fetchRedirect[tid] ||
@@ -1793,6 +1793,13 @@ IEW::executeInsts()
17931793
}
17941794
}
17951795

1796+
sortResolveQueue();
1797+
if (!resolveQueue.empty()) {
1798+
ResolveQueueEntry entry = resolveQueue.back();
1799+
resolveQueue.pop_back();
1800+
toFetch->iewInfo[tid].resolveQueue.push_back(entry);
1801+
}
1802+
17961803
ldstQueue.executePipeSx();
17971804

17981805
// Update and record activity if we processed any instructions.

src/cpu/o3/iew.hh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,13 @@ class IEW
494494
/** Maximum size of the skid buffer. */
495495
unsigned skidBufferMax;
496496

497+
std::vector<ResolveQueueEntry> resolveQueue;
498+
static inline bool resolveQueueEntryCompare(const ResolveQueueEntry &a, const ResolveQueueEntry &b)
499+
{
500+
return a.resolvedFSQId > b.resolvedFSQId;
501+
};
502+
inline void sortResolveQueue() { std::sort(resolveQueue.begin(), resolveQueue.end(), resolveQueueEntryCompare); };
503+
497504

498505
struct IEWStats : public statistics::Group
499506
{

0 commit comments

Comments
 (0)