Skip to content

Commit ff99568

Browse files
author
Cao Jiaming
committed
cpu-o3: update tick handling in MBTB entry
Change-Id: If352e96f0a50c922a32f6ad41dc871cbc92a14f3
1 parent c1d94c1 commit ff99568

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/cpu/pred/btb/mbtb.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -540,9 +540,10 @@ MBTB::updateBTBEntry(const BTBEntry& entry, const FetchStream &stream)
540540
}
541541

542542
auto entry_to_write = buildUpdatedEntry(entry, existing_ptr, stream, btb_tag);
543-
auto ticked_entry = TickedBTBEntry(entry_to_write, it->tick);
544-
if (stream.exeBranchInfo.pc == ticked_entry.pc && stream.exeTaken) {
545-
ticked_entry.tick = curTick();
543+
auto ticked_entry = TickedBTBEntry(entry_to_write, curTick());
544+
if (stream.exeBranchInfo.pc != ticked_entry.pc) {
545+
// do not update tick if this entry is not for the executed branch
546+
ticked_entry.tick = it->tick;
546547
}
547548

548549
if (found) {

0 commit comments

Comments
 (0)