[debug] Misc debug fixes#632
Conversation
en-sc
left a comment
There was a problem hiding this comment.
Thank you for the fixes!
I have a few concerns. Please, take a look.
Set MCONTROL_S and/or MCONTROL_U bits only if the hart supports S-mode and/or U-mode. Signed-off-by: Hiroo HAYASHI <24754036+hirooih@users.noreply.github.com>
TranslateTest depends on the S extension being supported. Without this change, the test fails on targets that do not support S extension. Signed-off-by: Hiroo HAYASHI <24754036+hirooih@users.noreply.github.com>
68aee20 to
9cdb00f
Compare
|
@hirooih, let's separate |
debug/testlib.py
Outdated
| size = max(size, self.get_minimum_pmp_granularity(), 8) | ||
|
|
||
| if 2**self.ctz(address) < size: | ||
| raise TestNotApplicable( |
There was a problem hiding this comment.
size is based on the result of communication with the target -- it can change sporadically.
Therefore this test can sporadically be marked as not applicable.
Consider the following alternative:
minimum_pmp_granularityis a target property specified in the config.- There is a test that checks that
get_minimum_pmp_granularity()returns the same value as in the config. - This check is moved to
early_applicable()and is based on the value from the config.
This is for the dmode bit in tdata1. Signed-off-by: Hiroo HAYASHI <24754036+hirooih@users.noreply.github.com>
This suppresses warnings like: Warning: Command 'gdb_port' is deprecated, please use 'gdb port' instead. Warning: Command 'tcl_port' is deprecated, please use 'tcl port' instead. Warning: Command 'telnet_port' is deprecated, please use 'telnet port' instead. from debug/README.md: > openocd ..., which should be the latest from https://github.com/riscv/riscv-openocd.git. Signed-off-by: Hiroo HAYASHI <24754036+hirooih@users.noreply.github.com>
This change makes debug/testlib.py not throw an exception when an expected error occurs while creating the logs/ directory. Fixing this is useful when debugging with python debugger not to break at the exception every time. Signed-off-by: Hiroo HAYASHI <24754036+hirooih@users.noreply.github.com>
U500Sim.py is the only example of a target that uses VcsSim class. It does not work without this fix. Signed-off-by: Hiroo HAYASHI <24754036+hirooih@users.noreply.github.com>
example: for https://github.com/fjullien/jtag_vpi/blob/master/jtag_common.c#L80 def create(self): return testlib.VcsSim(..., server_stared="^Starting jtag_vpi server:.*, port (\d+)/tcp") Signed-off-by: Hiroo HAYASHI <24754036+hirooih@users.noreply.github.com>
9cdb00f to
2f4414f
Compare
I did. I've opened #636 for "debug: test implements_page_virtual_memory before executing sfence.vma instruction". |
This PR includes several minor fixes for the debug tests.
See the commit log for details of each commit.
Thank you for these great test suites!