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

Debug: Add mcontext/scontext registers for breakpoint qualification #2588

Merged
merged 2 commits into from Aug 6, 2020

Conversation

ernie-sifive
Copy link
Contributor

Related issue:

Type of change: feature request

Impact: API addition (no impact on existing code)

Development Phase: implementation

Release Notes

The Debug Spec defines mcontext and scontext as CSRs that M-mode and S-mode OSs can write to when switching tasks. The OS writes a process ID or similar identifier to uniquely identify the incoming task or process. A debugger may choose to qualify breakpoints by requiring that either mcontext or scontext (or both) match values programmed into the textra register of each breakpoint. This allows triggering on a virtual address that might be used by more than one process.

mcontext and scontext have a secondary use as additional comparison registers that an M-mode or S-mode application can write to enable and disable breakpoints. So even if a core doesn't have S-mode, scontext can still be a useful feature.

This feature is enabled with rocketCoreParams.mcontextWidth > 0 and/or rocketCoreParams.scontextWidth > 0. The default is disabled.

@ernie-sifive ernie-sifive merged commit aa744d1 into master Aug 6, 2020
@ernie-sifive ernie-sifive deleted the mcontext-scontext branch August 6, 2020 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants