-
Notifications
You must be signed in to change notification settings - Fork 455
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1015,6 +1015,32 @@ def test(self): | |
if privilege in self.supported: | ||
assertEqual(actual, privilege) | ||
|
||
class ComplianceTest(GdbTest): | ||
|
||
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) | ||
|
||
def compile(self): | ||
pass | ||
|
||
class SystemBusAccessConfigRegTest(GdbTest): | ||
|
||
def test(self): | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. Can you make sure There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 |
||
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 commentThe reason will be displayed to describe this comment to others. Learn more. When I run this test I get:
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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. |
||
self.target.harts[0].ram, # base address to target | ||
min(self.target.harts[0].ram_size, 100), # size to target | ||
self.target.harts[0].ram - 4) # Illegal region to target | ||
print command | ||
output = self.gdb.command(command) | ||
assert("ALL TESTS PASSED") in output | ||
|
||
# XXX temporarily disabling this test | ||
#class PrivChange(PrivTest): | ||
# def test(self): | ||
|
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:
which results in a slightly nicer error message if the tests didn't pass.