irq_test: Add IRQ testing tool
Add python scripts for debuggers to test IRQ handling in TF-M.
Signed-off-by: Mate Toth-Pal <mate.toth-pal@arm.com>
Change-Id: I6c5c0b920e3a0c38b3a0c867c93dd5851c66ff8b
diff --git a/irq_test_tool/irq_test_dummy_debugger.py b/irq_test_tool/irq_test_dummy_debugger.py
new file mode 100644
index 0000000..c03077c
--- /dev/null
+++ b/irq_test_tool/irq_test_dummy_debugger.py
@@ -0,0 +1,50 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2020, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+
+""" This module contains a dummy implementation of the debugger control interface
+"""
+
+import logging
+from irq_test_abstract_debugger import AbstractDebugger
+
+class DummyDebugger(AbstractDebugger):
+ """A dummy implementation of the debugger control interface
+
+ This class can be used for rapidly testing the testcase execution algorithm.
+
+ Breakpoint names are put in a list to keep track of them. Interrupts are not
+ emulated in any way, the 'trigger_interrupt' function returns without doing
+ anything. 'continue_execution' returns immediately as well, and
+ 'get_triggered_breakpoint' returns the breakpoint added the earliest.
+ """
+ def __init__(self, use_sw_breakpoints):
+ super(DummyDebugger, self).__init__()
+ self.breakpoints = []
+ self.use_sw_breakpoints = use_sw_breakpoints
+
+ def set_breakpoint(self, name, location):
+ if (self.use_sw_breakpoints):
+ breakpoint_type = "sw"
+ else:
+ breakpoint_type = "hw"
+ logging.info("debugger: set %s breakpoint %s", breakpoint_type, name)
+ self.breakpoints.append(name)
+
+ def trigger_interrupt(self, interrupt_line):
+ logging.info("debugger: triggering interrupt line for %s", str(interrupt_line))
+
+ def continue_execution(self):
+ logging.info("debugger: continue")
+
+ def clear_breakpoints(self):
+ logging.info("debugger: clearing breakpoints")
+ self.breakpoints = []
+
+ def get_triggered_breakpoint(self):
+ if self.breakpoints:
+ return self.breakpoints[0]
+ return None