Hi,

I am confused regarding the BTB updation (after a branch mispredict) in m5.
In the branch-predictor implementation, why does the BTB need to be updated
for not-taken paths too? I mean suppose there is a case in which a branch is
predicted as taken, but on execution, it is figured out that the branch was
a not-taken branch( a misprediction basically). Then a squash is generated
for the instructions following this branch on the taken path, which is fine.
But the BTB also gets updated with the correct target along the not-taken
path, which seems odd. So, given that the BTB contains the fall-through
address, next time this branch is encountered, both "a taken or a not-taken
prediction" would result in the fall-through instruction as the predicted
PC. Doesn't the BTB need to hold onto predicted targets along the
taken-paths, given how branch mispredictions are dealt in m5?

Sorry if I am missing out something, but I am just confused. Can somebody
clarify this?

Thanks,
Reena
_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to