debug: Add first cut to call "compliance" tests#157
Conversation
|
Problem with Compliance Test + Spike (writing all 1's to DMCONTROL register causes "unexpected" reset): causes: |
| def test(self): | ||
| output = self.gdb.command("monitor riscv test_compliance") | ||
| #TODO: Fix OpenOCD to remove the -rtos riscv requirement | ||
| assert(("ALL TESTS PASSED") in output or ("Please run with -rtos riscv to run compliance test.") in output) |
There was a problem hiding this comment.
It'd be nicer to do something like:
if "Please run with -rtos riscv to run compliance test." in output:
return
assertIn("ALL TESTS PASSED", output)
which results in a slightly nicer error message if the tests didn't pass.
| result = self.gdb.command("monitor riscv dmi_read 0x38") | ||
| if (int(result, base=16) == 0): | ||
| return 'not_applicable' | ||
|
|
There was a problem hiding this comment.
Can you make sure make pylint is happy before merging?
There was a problem hiding this comment.
sure, but can we add pylint check to the regression (because otherwise you assume I know how to run pylint...)
There was a problem hiding this comment.
pylint checks differ slightly between versions. I didn't put it in the regression to avoid the case where it works fine for a developer, but then fails a regression. The how-to-run pylint issue is why there's a make pylint target.
| return 'not_applicable' | ||
|
|
||
| self.gdb.command("monitor riscv set_prefer_sba on") | ||
| command = "monitor riscv test_sba_config_reg 0x%08x %d 0x%08x off" % ( |
There was a problem hiding this comment.
When I run this test I get:
(gdb) monitor riscv test_sba_config_reg 0x1212340000 100 0x121233fffc off
invalid subcommand "test_sba_config_reg 0x1212340000 100 0x121233fffc off"
There was a problem hiding this comment.
and you're using latest OpenOCD?
There was a problem hiding this comment.
No. I had the latest source, but hadn't rebuilt. Now the command starts correctly.
There are now two commands in OpenOCD that do some coarse sanity checks on the Debug Module implementation. This adds them to the riscv-tests/debug suite so they can be run on more targets.
There are a few known issues with the compliance tests that these are currently working around, but they also cause some sort of problem on 64-bit spike implementation which I have not yet root-caused. Going to run the riscv-tools regression to see the current set of failing and passing tests.