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: set VLENB/MTOPI/MTOPEI existence on 0.11 targets #1207

Merged
merged 1 commit into from
Jan 31, 2025

Conversation

en-sc
Copy link
Collaborator

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

commit 5f45b5b ("target/riscv: reg cache entry is initialized before access") introduced an assertion in riscv_reg_impl_gdb_regno_exist().
Link:

assert(false
&& "Existence of other registers is determined "
"depending on existence of these ones, so "
"whether these register exist or not should be "
"set explicitly.");
This assertion fails on RISC-V Debug Spec. 0.11 targets. The commit is intended to fix this.

Change-Id: I20b56df1517f4071f4b6e39c83178a29a9cf95b0

@en-sc en-sc self-assigned this Jan 16, 2025
aap-sc
aap-sc previously approved these changes Jan 17, 2025
Copy link
Collaborator

@aap-sc aap-sc left a comment

Choose a reason for hiding this comment

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

LGTM, review internally.

@MarekVCodasip
Copy link
Collaborator

Ran riscv-tests on the hifive1-reva board we have. These are the results:

:::::::::::::::::::::::::::[ ran 73 tests in 220s ]:::::::::::::::::::::::::::
19 tests returned not_applicable
42 tests returned pass
4 tests returned exception
   DebugFunctionCall > logs/20250123-175903-HiFive1-DebugFunctionCall.log
   IcountTest > logs/20250123-175928-HiFive1-IcountTest.log
   MemTestReadInvalid > logs/20250123-180059-HiFive1-MemTestReadInvalid.log
   RepeatReadTest > logs/20250123-180132-HiFive1-RepeatReadTest.log
8 tests returned fail
   EtriggerTest > logs/20250123-175917-HiFive1-EtriggerTest.log
   InstantHaltTest > logs/20250123-180013-HiFive1-InstantHaltTest.log
   InterruptTest > logs/20250123-180015-HiFive1-InterruptTest.log
   ItriggerTest > logs/20250123-180041-HiFive1-ItriggerTest.log
   MemorySampleMixed > logs/20250123-180101-HiFive1-MemorySampleMixed.log
   MemorySampleSingle > logs/20250123-180109-HiFive1-MemorySampleSingle.log
   Semihosting > logs/20250123-180134-HiFive1-Semihosting.log
   SemihostingFileio > logs/20250123-180137-HiFive1-SemihostingFileio.log

Copy link
Collaborator

@MarekVCodasip MarekVCodasip left a comment

Choose a reason for hiding this comment

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

Not a huge fan of this solution, but I don't see any other way which does not interfere in the regular 0.13 target.

Please, add the comments I suggested to ensure that future readers know.

commit 5f45b5b ("target/riscv: reg cache
entry is initialized before access") introduced an assertion in
`riscv_reg_impl_gdb_regno_exist()`.
Link: https://github.com/riscv-collab/riscv-openocd/blob/f82c5a7c048eb70fdc4dff6f53002fa1d3a1bda5/src/target/riscv/riscv_reg.c#L385-L389
This assertion fails on RISC-V Debug Spec. 0.11 targets.
The commit is intended to fix this.

Change-Id: I20b56df1517f4071f4b6e39c83178a29a9cf95b0
Signed-off-by: Evgeniy Naydanov <[email protected]>
@en-sc en-sc force-pushed the en-sc/fix-011-init-regs branch from b9fdd1c to 8513d6e Compare January 24, 2025 19:15
@en-sc en-sc requested review from MarekVCodasip and aap-sc January 24, 2025 19:16
@en-sc en-sc merged commit 9d431c3 into riscv-collab:riscv Jan 31, 2025
4 checks passed
@en-sc en-sc deleted the en-sc/fix-011-init-regs branch January 31, 2025 12:09
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