diff options
author | liangzhen <zhen.liang@spacemit.com> | 2023-10-24 09:29:53 +0800 |
---|---|---|
committer | liangzhen <zhen.liang@spacemit.com> | 2023-10-24 09:29:53 +0800 |
commit | aa15f70c071a03b428621990142f6c049a656526 (patch) | |
tree | 57b4de30f25448454476fd93cd5dcc5d43336b55 /debug/gdbserver.py | |
parent | d020e2069a9f6a9c0e875f23f0f4aababea9fbf0 (diff) | |
download | riscv-tests-aa15f70c071a03b428621990142f6c049a656526.zip riscv-tests-aa15f70c071a03b428621990142f6c049a656526.tar.gz riscv-tests-aa15f70c071a03b428621990142f6c049a656526.tar.bz2 |
Support instruction count limit in IcountTest
This is taking into account that the hardware limits count to 1.
Signed-off-by: liangzhen <zhen.liang@spacemit.com>
Diffstat (limited to 'debug/gdbserver.py')
-rwxr-xr-x | debug/gdbserver.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/debug/gdbserver.py b/debug/gdbserver.py index 86359c8..5450adb 100755 --- a/debug/gdbserver.py +++ b/debug/gdbserver.py @@ -2129,9 +2129,13 @@ class IcountTest(DebugTest): def test(self): # Execute 2 instructions. output = self.gdb.command("monitor riscv icount set m 2") - assertNotIn("Failed", output) + if self.target.icount_limit > 1: + assertNotIn("Failed", output) + else: + assertIn("Failed", output) + self.gdb.b("main_post_csrr") output = self.gdb.c() - assertIn("breakpoint", output) + assertIn("main_post_csrr", output) main_post_csrr = self.gdb.p("&main_post_csrr") assertEqual(self.gdb.p("$pc"), main_post_csrr) |