aboutsummaryrefslogtreecommitdiff
path: root/debug/testlib.py
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2018-12-31 13:10:29 -0800
committerTim Newsome <tim@sifive.com>2018-12-31 13:10:29 -0800
commita5d280990e7d258b76d2154c83ecae271511426c (patch)
tree24e88349c5fdc807ffaf740a0957bccc5e8312c7 /debug/testlib.py
parentd2b8b97afbc7317cc9d67cf360819935df1efef4 (diff)
downloadriscv-tests-a5d280990e7d258b76d2154c83ecae271511426c.zip
riscv-tests-a5d280990e7d258b76d2154c83ecae271511426c.tar.gz
riscv-tests-a5d280990e7d258b76d2154c83ecae271511426c.tar.bz2
Add testing of run-test/idle cases.
Diffstat (limited to 'debug/testlib.py')
-rw-r--r--debug/testlib.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/debug/testlib.py b/debug/testlib.py
index 8fa0c43..a302cc6 100644
--- a/debug/testlib.py
+++ b/debug/testlib.py
@@ -56,13 +56,16 @@ def compile(args, xlen=32): # pylint: disable=redefined-builtin
raise Exception("Compile failed!")
class Spike(object):
+ # pylint: disable=too-many-instance-attributes
def __init__(self, target, halted=False, timeout=None, with_jtag_gdb=True,
- isa=None, progbufsize=None):
+ isa=None, progbufsize=None, dmi_rti=None, abstract_rti=None):
"""Launch spike. Return tuple of its process and the port it's running
on."""
self.process = None
self.isa = isa
self.progbufsize = progbufsize
+ self.dmi_rti = dmi_rti
+ self.abstract_rti = abstract_rti
if target.harts:
harts = target.harts
@@ -124,6 +127,12 @@ class Spike(object):
cmd += ["--progsize", str(self.progbufsize)]
cmd += ["--debug-sba", "32"]
+ if not self.dmi_rti is None:
+ cmd += ["--dmi-rti", str(self.dmi_rti)]
+
+ if not self.abstract_rti is None:
+ cmd += ["--abstract-rti", str(self.abstract_rti)]
+
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, \