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

Invalided cache for breakpoints #1113

Open
oferShinaar opened this issue Aug 14, 2024 · 5 comments
Open

Invalided cache for breakpoints #1113

oferShinaar opened this issue Aug 14, 2024 · 5 comments

Comments

@oferShinaar
Copy link

Hi Tim,
Do we have, or are we planning to have, CBO operation for cache lines within openocd?
When putting BP's in the memory on a system with multi-level cache we need to invalidate the cache lines so BP will land in cache (i$ in this example)

Thanks,
Ofer

@oferShinaar oferShinaar changed the title invalided cache for breakpoints Invalided cache for breakpoints Aug 14, 2024
@TommyMurphyTM1234
Copy link
Collaborator

Perhaps this is relevant in the context of this question?

@oferShinaar
Copy link
Author

Yes, Tim's points are correct (on the link you shared). But is there a plan on doing it on the openocd code?

A long time ago we did that here: chipsalliance/Cores-VeeR-EH1#28 (comment)
That was a nice solution when you have only one level of cache and one core. fence.i was good enough.

It becomes tricky when you have multi core/multi level cache levels. Those system have to use cbo on the driver side.
The options (as I see it, please correct me otherwise): 1) Change the openocd that when BP is writing do cbo.flush + reg 2)do it via event on the cfg file, check the PC that GDB is going to put BP into, allocate register for the PC address ( for cbo.flush usage), do the cbo.flush and restore the allocated reg.

@TommyMurphyTM1234
Copy link
Collaborator

Just to clarify, does this issue apply specifically to software breakpoints (where the breakpoint instruction is temporarily overwritten with an ebreak instruction) but not trigger based hardware breakpoints? In which case another option might be to not change anything in OpenOCD but to use trigger based hardware breakpoints when (multi-level) instruction caches are present?

Those system have to use cbo on the driver side.

What do you mean by "on the driver side" here? I presume you mean in the OpenOCD RISC-V target specific code?

@oferShinaar
Copy link
Author

oferShinaar commented Aug 14, 2024 via email

@en-sc
Copy link
Collaborator

en-sc commented Aug 14, 2024

Do we have, or are we planning to have, CBO operation for cache lines within openocd?

IMHO, this would be great. However, I'm not aware of anybody working on this right now.

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

3 participants