aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2023-10-25 09:02:25 -0700
committerGitHub <noreply@github.com>2023-10-25 09:02:25 -0700
commit96403c8facf128564e7828d37daee948147bfad0 (patch)
tree57b4de30f25448454476fd93cd5dcc5d43336b55
parentd020e2069a9f6a9c0e875f23f0f4aababea9fbf0 (diff)
parentaa15f70c071a03b428621990142f6c049a656526 (diff)
downloadriscv-tests-96403c8facf128564e7828d37daee948147bfad0.zip
riscv-tests-96403c8facf128564e7828d37daee948147bfad0.tar.gz
riscv-tests-96403c8facf128564e7828d37daee948147bfad0.tar.bz2
Merge pull request #519 from lz-bro/fix_icount
Support limits_icount_to_one in IcountTest
-rwxr-xr-xdebug/gdbserver.py8
-rw-r--r--debug/targets.py3
2 files changed, 9 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)
diff --git a/debug/targets.py b/debug/targets.py
index 189d79b..bb7a5cf 100644
--- a/debug/targets.py
+++ b/debug/targets.py
@@ -138,6 +138,9 @@ class Target:
# Supports controlling hart availability through DMCUSTOM.
support_unavailable_control = False
+ # Instruction count limit
+ icount_limit = 4
+
# Internal variables:
directory = None
temporary_files = []