aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZane <zhen.liang@spacemit.com>2025-12-03 13:20:39 +0800
committerGitHub <noreply@github.com>2025-12-02 21:20:39 -0800
commit988c2ce4563e7122f1abc39298676336031d7209 (patch)
treeac804544f6d2864942b3833f50bb919d98c74d12
parent6ca449c9ca190b689be17ee881cd4d7cedec0a8f (diff)
downloadriscv-tests-master.zip
riscv-tests-master.tar.gz
riscv-tests-master.tar.bz2
[debug] check triggers exist in icount/itrigger/etrigger test (#617)HEADmaster
-rwxr-xr-xdebug/gdbserver.py14
-rw-r--r--debug/targets.py9
2 files changed, 22 insertions, 1 deletions
diff --git a/debug/gdbserver.py b/debug/gdbserver.py
index f73300a..6e5b6ee 100755
--- a/debug/gdbserver.py
+++ b/debug/gdbserver.py
@@ -2197,6 +2197,11 @@ class StepThread2Test(GdbTest):
assertEqual(before, after)
class EtriggerTest(DebugTest):
+ # TODO: There should be a check that a exception trigger is really not
+ # supported if it is marked as unsupported.
+ def early_applicable(self):
+ return self.target.support_etrigger
+
def setup(self):
DebugTest.setup(self)
self.gdb.b("main:start")
@@ -2228,6 +2233,11 @@ class EtriggerTest(DebugTest):
class IcountTest(DebugTest):
compile_args = ("programs/infinite_loop.S", )
+ # TODO: There should be a check that an instruction count trigger is
+ # really not supported if it is marked as unsupported.
+ def early_applicable(self):
+ return self.target.support_icount
+
def setup(self):
DebugTest.setup(self)
self.gdb.b("main")
@@ -2259,8 +2269,10 @@ class IcountTest(DebugTest):
class ItriggerTest(GdbSingleHartTest):
compile_args = ("programs/interrupt.c",)
+ # TODO: There should be a check that a interrupt trigger is really not
+ # supported if it is marked as unsupported.
def early_applicable(self):
- return self.target.supports_clint_mtime
+ return self.target.supports_clint_mtime and self.target.support_itrigger
def setup(self):
self.gdb.load()
diff --git a/debug/targets.py b/debug/targets.py
index ebdbf6e..8128036 100644
--- a/debug/targets.py
+++ b/debug/targets.py
@@ -154,6 +154,15 @@ class Target:
# Supports an address/data match trigger of type 6
support_mcontrol6 = True
+ # Supports Instruction count trigger
+ support_icount = True
+
+ # Supports interrupt trigger
+ support_itrigger = True
+
+ # Supports exception trigger
+ support_etrigger = True
+
# Internal variables:
directory = None
temporary_files = []