aboutsummaryrefslogtreecommitdiff
path: root/debug/testlib.py
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2017-12-27 15:41:45 -0800
committerTim Newsome <tim@sifive.com>2017-12-27 15:43:02 -0800
commitd359b6252eceb5e28f1048591750954d09efd12b (patch)
tree129881b104a3dc296aba35a29502b966c9feffdf /debug/testlib.py
parentffa920340430f62e767fb2397f4ee41ffaf441ce (diff)
downloadriscv-tests-d359b6252eceb5e28f1048591750954d09efd12b.zip
riscv-tests-d359b6252eceb5e28f1048591750954d09efd12b.tar.gz
riscv-tests-d359b6252eceb5e28f1048591750954d09efd12b.tar.bz2
Test FPRs that aren't XLEN in size.
Cover all combinations of 32,64 bit XLEN with F and FD extensions. Finishes Issue https://github.com/riscv/riscv-openocd/issues/110
Diffstat (limited to 'debug/testlib.py')
-rw-r--r--debug/testlib.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/debug/testlib.py b/debug/testlib.py
index ce8aeca..94ee83e 100644
--- a/debug/testlib.py
+++ b/debug/testlib.py
@@ -56,10 +56,12 @@ def compile(args, xlen=32): # pylint: disable=redefined-builtin
raise Exception("Compile failed!")
class Spike(object):
- def __init__(self, target, halted=False, timeout=None, with_jtag_gdb=True):
+ def __init__(self, target, halted=False, timeout=None, with_jtag_gdb=True,
+ isa=None):
"""Launch spike. Return tuple of its process and the port it's running
on."""
self.process = None
+ self.isa = isa
if target.harts:
harts = target.harts
@@ -109,10 +111,12 @@ class Spike(object):
assert len(set(t.xlen for t in harts)) == 1, \
"All spike harts must have the same XLEN"
- if harts[0].xlen == 32:
- cmd += ["--isa", "RV32G"]
+ if self.isa:
+ isa = self.isa
else:
- cmd += ["--isa", "RV64G"]
+ isa = "RV%dG" % harts[0].xlen
+
+ cmd += ["--isa", isa]
assert len(set(t.ram for t in harts)) == 1, \
"All spike harts must have the same RAM layout"