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

Stop assuming dmi.address is not changed in riscv_decode_dmi_scan() #1043

Open
en-sc opened this issue Apr 17, 2024 · 0 comments
Open

Stop assuming dmi.address is not changed in riscv_decode_dmi_scan() #1043

en-sc opened this issue Apr 17, 2024 · 0 comments

Comments

@en-sc
Copy link
Collaborator

en-sc commented Apr 17, 2024

Related to #1025.

When a DMI read result is decoded, the current code assumes that the hardware provides the read address in the dmi.address field when returning the dmi.data.

That is however not required by the spec, and therefore not guaranteed.

Spike ISA simulator behaves like that but other RISC-V debug implementations may not.

e.g.

Debug: 409 19 riscv-013.c:420 dump_field(): 50b r 00000000 @10 -> + 00000000 @10; 3i
Debug: 419 20 riscv-013.c:420 dump_field(): 50b - 00000000 @10 -> + 04010001 @10; 3i
Debug: 420 20 riscv-013.c:434 dump_field(): read: dmcontrol=0x4010001 {...}

Here the decoding on the 3-rd line is based on the dmi.address field OpenOCD got in the result of the nop opreation on the 2-nd line.

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