@@ -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