Skip to content

Commit eafdeee

Browse files
author
Cao Jiaming
committed
cpu-o3: simplify tick update logic in MBTB entry handling
Change-Id: I310df13c9d1dfeac320c51940c4de486a954ab06
1 parent def3dcd commit eafdeee

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

configs/example/kmhv3.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,6 @@ def setKmhV3Params(args, system):
108108
cpu.branchPred.mgsc.enabled = False
109109
cpu.branchPred.ras.enabled = True
110110

111-
usingMbtbBaseEiterTage = True
112-
cpu.branchPred.mbtb.usingMbtbBaseEiterTage = usingMbtbBaseEiterTage
113-
cpu.branchPred.tage.usingMbtbBaseEiterTage = usingMbtbBaseEiterTage
114-
115111
# l1 cache per core
116112
if args.caches:
117113
cpu.icache.size = '64kB'

src/cpu/pred/btb/mbtb.cc

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,7 @@ MBTB::lookupSingleBlock(Addr block_pc)
357357
for (auto &way : btb_set) {
358358
if (way.valid && way.tag == current_tag) {
359359
res.push_back(way);
360-
bool this_branch_taken = way.isIndirect||way.isDirect||way.alwaysTaken||(way.ctr >= 0);
361-
way.tick = this_branch_taken ? curTick() : way.tick; // Update timestamp for MRU
360+
way.tick = curTick(); // Update timestamp for MRU
362361
std::make_heap(target_mru[btb_idx].begin(), target_mru[btb_idx].end(), older());
363362
}
364363
}
@@ -542,10 +541,6 @@ MBTB::updateBTBEntry(const BTBEntry& entry, const FetchStream &stream)
542541

543542
auto entry_to_write = buildUpdatedEntry(entry, existing_ptr, stream, btb_tag);
544543
auto ticked_entry = TickedBTBEntry(entry_to_write, curTick());
545-
if (stream.exeBranchInfo.pc != ticked_entry.pc) {
546-
// do not update tick if this entry is not for the executed branch
547-
ticked_entry.tick = it->tick;
548-
}
549544

550545
if (found) {
551546
// Update in-place in SRAM set
@@ -556,9 +551,7 @@ MBTB::updateBTBEntry(const BTBEntry& entry, const FetchStream &stream)
556551
return;
557552
} else {
558553
// Not found anywhere, replace oldest in SRAM set
559-
if (stream.exeTaken && stream.exeBranchInfo.pc == ticked_entry.pc) {
560-
replaceOldestInSRAMSet(sram_id, btb_idx, target_mru[btb_idx], ticked_entry);
561-
}
554+
replaceOldestInSRAMSet(sram_id, btb_idx, target_mru[btb_idx], ticked_entry);
562555
}
563556
}
564557

0 commit comments

Comments
 (0)