-
Notifications
You must be signed in to change notification settings - Fork 462
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
debug: Add first cut to call "compliance" tests #157
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make sure make pylint
is happy before merging?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and you're using latest OpenOCD?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.