Test debugging with/without a program buffer
[riscv-tests.git] / debug / testlib.py
index 7727f10d5af2947b8b2ec3de39fd74d5f3185a45..5c40a5dd135a116c639bd6ea3098c9aa904c3348 100644 (file)
@@ -57,11 +57,12 @@ def compile(args, xlen=32): # pylint: disable=redefined-builtin
 
 class Spike(object):
     def __init__(self, target, halted=False, timeout=None, with_jtag_gdb=True,
-            isa=None):
+            isa=None, progbufsize=None):
         """Launch spike. Return tuple of its process and the port it's running
         on."""
         self.process = None
         self.isa = isa
+        self.progbufsize = progbufsize
 
         if target.harts:
             harts = target.harts
@@ -118,6 +119,10 @@ class Spike(object):
 
         cmd += ["--isa", isa]
 
+        if not self.progbufsize is None:
+            cmd += ["--progsize", str(self.progbufsize)]
+            cmd += ["--debug-sba", "32"]
+
         assert len(set(t.ram for t in harts)) == 1, \
                 "All spike harts must have the same RAM layout"
         assert len(set(t.ram_size for t in harts)) == 1, \
@@ -835,6 +840,7 @@ class GdbTest(BaseTest):
         if not self.gdb:
             return
         self.gdb.interrupt()
+        self.gdb.command("disassemble")
         self.gdb.command("info registers all", timeout=10)
 
     def classTeardown(self):