Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion configs/example/kmhv3.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,14 @@ def setKmhV3Params(args, system):

cpu.branchPred.mbtb.resolvedUpdate = True
cpu.branchPred.tage.resolvedUpdate = True
cpu.branchPred.ittage.resolvedUpdate = True

cpu.branchPred.ubtb.enabled = True
cpu.branchPred.abtb.enabled = False
cpu.branchPred.microtage.enabled = False
cpu.branchPred.mbtb.enabled = True
cpu.branchPred.tage.enabled = True
cpu.branchPred.ittage.enabled = False
cpu.branchPred.ittage.enabled = True
cpu.branchPred.mgsc.enabled = False
cpu.branchPred.ras.enabled = False

Expand Down
15 changes: 11 additions & 4 deletions src/cpu/pred/btb/btb_ittage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,17 @@ BTBITTAGE::update(const FetchStream &stream)
all_entries_to_update.push_back(stream.updateNewBTBEntry);
}

// only update indirect branches that are not returns
auto remove_it = std::remove_if(all_entries_to_update.begin(), all_entries_to_update.end(),
[](const BTBEntry &e) { return !(e.isIndirect && !e.isReturn); });
all_entries_to_update.erase(remove_it, all_entries_to_update.end());
// // only update indirect branches that are not returns
if (getResolvedUpdate()) {
auto remove_it =
std::remove_if(all_entries_to_update.begin(), all_entries_to_update.end(),
[](const BTBEntry &e) { return !(e.isIndirect && !e.isReturn && e.resolved); });
all_entries_to_update.erase(remove_it, all_entries_to_update.end());
} else {
auto remove_it = std::remove_if(all_entries_to_update.begin(), all_entries_to_update.end(),
[](const BTBEntry &e) { return !(e.isIndirect && !e.isReturn); });
all_entries_to_update.erase(remove_it, all_entries_to_update.end());
}

// get tage predictions from meta
// TODO: use component idx
Expand Down
11 changes: 6 additions & 5 deletions src/cpu/pred/btb/decoupled_bpred.cc
Original file line number Diff line number Diff line change
Expand Up @@ -251,15 +251,16 @@ DecoupledBPUWithBTB::generateFinalPredAndCreateBubbles()

// update ubtb/abtb using final S3 prediction
if (predsOfEachStage[numStages - 1].btbEntries.size() > 0) {
ubtb->updateUsingS3Pred(predsOfEachStage[numStages - 1]);
auto it = fetchStreamQueue.find(fsqId-1);
if (it != fetchStreamQueue.end()) {
if (ubtb->isEnabled()) {
ubtb->updateUsingS3Pred(predsOfEachStage[numStages - 1]);
}
auto it = fetchStreamQueue.find(fsqId - 1);
if (it != fetchStreamQueue.end() && abtb->isEnabled()) {
auto previous_block_startpc = it->second.startPC;
abtb->updateUsingS3Pred(predsOfEachStage[numStages - 1], previous_block_startpc);
} else {
} else if (abtb->isEnabled()) {
abtb->updateUsingS3Pred(predsOfEachStage[numStages - 1], 0);
}

}

// 4. Record override bubbles and update statistics
Expand Down