Skip to content

Commit 24dee3d

Browse files
author
Cao Jiaming
committed
cpu-o3: replace oldest BTB entry based on branch execution
Change-Id: I49a0b5eda44fe0f5355f7177250ae83dc5b61e03
1 parent ff99568 commit 24dee3d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/cpu/pred/btb/mbtb.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,9 @@ MBTB::updateBTBEntry(const BTBEntry& entry, const FetchStream &stream)
555555
return;
556556
} else {
557557
// Not found anywhere, replace oldest in SRAM set
558-
replaceOldestInSRAMSet(sram_id, btb_idx, target_mru[btb_idx], ticked_entry);
558+
if (stream.exeTaken && stream.exeBranchInfo.pc == ticked_entry.pc) {
559+
replaceOldestInSRAMSet(sram_id, btb_idx, target_mru[btb_idx], ticked_entry);
560+
}
559561
}
560562
}
561563

0 commit comments

Comments
 (0)