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

[OCD] add option to select DM legacy mode #677

Merged
merged 9 commits into from
Aug 29, 2023
Merged

[OCD] add option to select DM legacy mode #677

merged 9 commits into from
Aug 29, 2023

Conversation

stnolting
Copy link
Owner

@stnolting stnolting commented Aug 25, 2023

Triggered by @stokdam in #463 (comment)

This PR adds a new generic to the processor's top entity that allows to "downgrade" the on-chip debugger's debug module (DM) back to version 0.13.

  • DM_LEGACY_MODE = false: DM is compatible to debug spec. version 1.0
  • DM_LEGACY_MODE = true: DM is compatible to debug spec. version 0.13 (legacy mode)

This PR also provides some clean-ups and optimizations for the on-chip debugger modules (DTM & DM).

@stnolting stnolting added enhancement New feature or request risc-v compliance Modification to comply with official RISC-V specs. HW hardware-related labels Aug 25, 2023
@stnolting stnolting self-assigned this Aug 25, 2023
@stnolting
Copy link
Owner Author

@stokdam

I think the "legacy" mode is working fine now - at least on my test setup. It would be great if you could test that with your setup, too. 😉

@stnolting stnolting marked this pull request as ready for review August 26, 2023 09:58
NikLeberg added a commit to NikLeberg/neorv32 that referenced this pull request Aug 27, 2023
[OCD] add option to select DM legacy mode [stnolting#677](stnolting#677)
@NikLeberg
Copy link
Collaborator

NikLeberg commented Aug 27, 2023

Just letting you know: this also works for me. Tested legacy v0.13 as well as v1.0 and successfully could debug the core.

$ openocd --version
> Open On-Chip Debugger 0.11.0-R22.4-gc5bf4f3-dirty (2023-04-25-10:00)
$ riscv32-unknown-elf-gdb --version
> GNU gdb (GDB) 12.1

Nice cleanups!

Once this merges I can provide an updated version of the Intel specific DTM in the neorv32-setups repo.

@stokdam
Copy link

stokdam commented Aug 28, 2023

Also works with my setup (v 0.13). However, the error "Error: unable to halt hart 0" I think was due to missing IMEM in configuration. 1.7.9 forced me to enable it (I have not connected any system bus yet), while latest version does not. Running this PR with the same configuration (no IMEM) gives the same error, which disappeared after enabling IMEM.

@stnolting
Copy link
Owner Author

Thanks for the feedback!

@NikLeberg

Once this merges I can provide an updated version of the Intel specific DTM in the neorv32-setups repo.

That would be very cool! 😉

@stokdam

Also works with my setup (v 0.13). However, the error "Error: unable to halt hart 0" I think was due to missing IMEM in configuration. 1.7.9 forced me to enable it (I have not connected any system bus yet), while latest version does not. Running this PR with the same configuration (no IMEM) gives the same error, which disappeared after enabling IMEM.

So the debugger does not work if there is absolutely no memory available (no internal memories and no external ones)? At least the bootloader ROM should be there...
Anyway, good to hear that the setup is working now.

So I think this can be merged, right?

@stnolting stnolting merged commit ea1681d into main Aug 29, 2023
8 checks passed
@stnolting stnolting deleted the ocd_dm_legacy branch August 29, 2023 17:28
NikLeberg added a commit to NikLeberg/neorv32 that referenced this pull request Sep 3, 2023
[OCD] add option to select DM legacy mode [stnolting#677](stnolting#677)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request HW hardware-related risc-v compliance Modification to comply with official RISC-V specs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants