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

OpenOCD should detect if DMI address exceeds the DMI bus width (dtmcs.abits) #1203

Open
JanMatCodasip opened this issue Jan 10, 2025 · 0 comments

Comments

@JanMatCodasip
Copy link
Collaborator

Discovered during the implementation of #1202:

When DMI access is requested by the RISC-V target, the JTAG DTM implementation in OpenOCD (batch.c) shall check that the address of the access is not wider than dtmcs.abits, otherwise an error should be printed. Currently such a check is missing, and the address gets silently truncated.

Possible implementation:

  • Rework the contents of struct riscv_batch to store the DMI items (address, data, operation), not the raw JTAG scans.
  • In riscv_batch_run_from(), perform the validation of the DMI addresses.
  • Only if successful, create the actual raw JTAG scans and send them for execution to the adapter driver.
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