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

target/riscv: drop mtopi_readable/mtopei_readable riscv_info fields #1209

Merged
merged 1 commit into from
Feb 17, 2025

Conversation

en-sc
Copy link
Collaborator

@en-sc en-sc commented Jan 17, 2025

These fields duplicate the info in the corresponding register cache entries.

@en-sc en-sc self-assigned this Jan 17, 2025
@en-sc
Copy link
Collaborator Author

en-sc commented Jan 17, 2025

Depends on #1207

JanMatCodasip
JanMatCodasip previously approved these changes Jan 28, 2025
Copy link
Collaborator

@JanMatCodasip JanMatCodasip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked visually, LGTM. Thank you.

return riscv_reg_impl_init_cache_entry(target, regno,
riscv_reg_impl_gdb_regno_exist(target, regno),
riscv011_gdb_regno_reg_type(regno));
}

int riscv011_reg_init_all(struct target *target)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@en-sc @aap-sc

Some general thoughts/questions about the RISC-V 0.11 support:

  • I wonder how many users actually use the legacy 0.11 RISC-V debug hardware nowadays. The only generally available board that I am aware of is HiFive1 (the long-discontinued original revision of that board, not the Rev B).
  • The ability to test the 0.11 support is limited and we do not even have a clean testsuite at the moment (see here).
  • Should we perhaps make an inquiry about how many users of 0.11 is there these days? (Ask on openocd.org mailing list and here on Github.)
  • Depending on the outcome, we may start thinking about deprecation and later removal of the 0.11 code.
  • Alternatively, a snapshot of the 0.11 could be taken, separated from the 0.13 code and further maintained as a separate target, likely with minimum changes. This would allow the 0.13 code to develop independently and without interfering with the legacy 0.11 support (but at the cost of some code duplication).

What is your opinion on this matter? Thank you.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO it's not that big of a deal.

AFAIK, you and @TommyMurphyTM1234 have 0.11 HW. We have been able to build SiFive Freedom E300 for Arty FPGA, so we are also able to test 0.11 support. We have not set up the internal CI on it yet though, but this activity is planned and we will do it eventually.

Moreover, I believe supporting two non-compatible versions of debug interface makes RISC-V OpenOCD better prepared for future backward-incompatible changes.

As for the testsuite, I believe it won't be too much effort to debug the "expected" failures and I hope to do this before the merge back into mainline OpenOCD is started.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @en-sc & @JanMatCodasip

Yes, I still have a HiFive1 Rev A board so can assist with any testing/investigations as needed. I had mentioned that I'd look further into some odd behaviour (e.g. possibly unexpected failure/exception cases) with the tests but unfortunately never got around to that. Apologies, but if it's still considered useful I will try to have a look again?

Another thing to consider here may be soft IP/FPGA implementations of the 0.11 debug block which do exist although I'm not sure how actively used they are at this stage? And I'm not sure how the responsive the providers of such IP would be if polled for information on same?

I may have the wherewithal to implement and exercise some of these if it proves necessary/useful but, by default, the primary 0.11 target for OpenOCD/test suite testing purposes has always been the HiFive1 and that probably won't change fundamentally?

Regards
Tommy

Copy link
Collaborator

@JanMatCodasip JanMatCodasip Feb 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your replies.

en-sc: I believe supporting two non-compatible versions of debug interface makes RISC-V OpenOCD better prepared for future backward-incompatible changes.

Still, my preference would be to separate the 0.11 and 0.13 implementations as much as possible/practical. Ideally, the version would be determined early in the examination phase and from that point onwards, the rest would be handled by two (mostly) separate implementations - sharing as little code as possible.

In another words, where there is a possibility to separate 0.11 and 0.13 code even more, I would recommend to take advantage of it.

Copy link
Collaborator

@JanMatCodasip JanMatCodasip Feb 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also would you know if the 0.11 version of the debug specification can be obtained from somewhere? (I have not yet searched for that document.) Thanks.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've used this link https://static.dev.sifive.com/riscv-debug-spec-0.11nov12.pdf
Not sure whether it's the right one.

These fields duplicate the info in the corresponding register cache
entries.

Change-Id: Ic0d264e78c527e92bb069258ce39b614d8f5bcde
Signed-off-by: Evgeniy Naydanov <[email protected]>
@en-sc en-sc force-pushed the en-sc/riscv-info-mtopx branch from dd6b1a9 to 06e673e Compare February 7, 2025 09:43
@en-sc en-sc requested a review from JanMatCodasip February 12, 2025 19:16
@en-sc en-sc merged commit e1fe15f into riscv-collab:riscv Feb 17, 2025
4 checks passed
@en-sc en-sc deleted the en-sc/riscv-info-mtopx branch February 17, 2025 12:11
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

Successfully merging this pull request may close these issues.

3 participants