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

hw: Fix CVA6 debug module addresses #173

Merged
merged 1 commit into from
Dec 5, 2024
Merged

hw: Fix CVA6 debug module addresses #173

merged 1 commit into from
Dec 5, 2024

Conversation

niwis
Copy link
Contributor

@niwis niwis commented Dec 5, 2024

This fixes two errors in the debug module addresses passed to CVA6:

  1. HaltAddress and ExceptionAddress are assumed to be relative to DmBaseAddress, see here and
    here. In Cheshire, they are currently assigned their absolute address. Coincidentally, this currently does not cause any issues since AmDbg = '0,

  2. ExceptionAddress was changed from 0x808 to 0x810 in [fix] Realign addresses to 64-bit riscv-dbg#145, which is included in the debug module version used in Cheshire. This means that exceptions in debug mode currently cause CVA6 to jump to resume and return from debug mode instead of handling the exception, which breaks several openocd commands that rely on exceptions to discover CSR availabilities.

This fixes two errors in the debug module addresses passed to CVA6:

1. `HaltAddress` and `ExceptionAddress` are assumed to be relative to
`DmBaseAddress`, see
https://github.com/pulp-platform/cva6/blob/99ae53bde1a94b90c1d9bbbe7fe272a9336200a6/core/frontend/frontend.sv#L380
and
https://github.com/pulp-platform/cva6/blob/99ae53bde1a94b90c1d9bbbe7fe272a9336200a6/core/csr_regfile.sv#L2295.
Coincidentally, this currently does not cause any issues since `AmDbg = '0`,

2. `ExceptionAddress` was changed from `0x808` to `0x810` in
pulp-platform/riscv-dbg#145, which is included
in the debug module version used in Cheshire. This means that exceptions
in debug mode currently cause CVA6 to jump to `resume` and return from
debug mode instead of handling the exception, which breaks several
openocd commands that use exceptions to discover CSR availabilities.

Signed-off-by: Nils Wistoff <[email protected]>
@niwis niwis requested a review from paulsc96 December 5, 2024 08:46
@niwis niwis marked this pull request as ready for review December 5, 2024 08:46
@paulsc96 paulsc96 changed the title cheshire_pkg: Fix CVA6 debug module addresses hw: Fix CVA6 debug module addresses Dec 5, 2024
@paulsc96 paulsc96 merged commit 44fb98a into main Dec 5, 2024
18 checks passed
@paulsc96 paulsc96 deleted the nw/fix-dbg branch December 5, 2024 08:54
@alex96295 alex96295 added the bug Something isn't working label Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants