Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add naive branch predictor unit #29

Merged
merged 2 commits into from
Nov 16, 2024
Merged

Add naive branch predictor unit #29

merged 2 commits into from
Nov 16, 2024

Conversation

andrej
Copy link
Collaborator

@andrej andrej commented Nov 16, 2024

  • Create new MDInstrAddr type to capture addresses of instructions as metadata.
  • Add abstract branch predictor interface
  • Add first naive branch predictor; this will always predict that a branch will go where it most recently went. For simple loops this is already good since we will only break out of the loop once at the end of it

Works with the vivisect Broker only as other brokers don't add instruction address metadata currently. Look for messages like this in the debug output to see it in action:

[MCAD FetchDelayStage] Previous branch at bfca0 predicted correctly.
[MCAD FetchDelayStage] Previous branch at bfca0 mispredicted, delaying next instruction by 20 cycle(s).

@andrej andrej merged commit 710b929 into main Nov 16, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant