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

frontend_c::btb_access function returns wrong value if BTB was disabled #68

Open
FanosLab opened this issue Oct 3, 2023 · 0 comments
Open

Comments

@FanosLab
Copy link

FanosLab commented Oct 3, 2023

Hello,
First of all, thank you for the efforts. I have been using Macsim since its early days (2012) as a PhD student and still use it.
I appreciate its cleanness and readability.
Recently, I came across this issue in the branch prediction.
If BTB is disabled, my understanding is that this function in the frontend frontend_c::btb_access should return true. Since the semantics of the return is in fact whether it is a BTB miss (also as a side note for the same reason, I guess the naming of the function might be counter intuitive since it in fact determines whether it is a BTB miss or not).

If this understanding is correct, this line:
if (!*KNOB(KNOB_ENABLE_BTB)) return false;
should be:
if (!*KNOB(KNOB_ENABLE_BTB)) return true;

With the original code, whether BTB is disabled or perfect in fact gives the same result.

Thanks,
Mohamed

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

No branches or pull requests

1 participant