aboutsummaryrefslogtreecommitdiff
path: root/debug/targets.py
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2021-05-20 11:52:21 -0700
committerGitHub <noreply@github.com>2021-05-20 11:52:21 -0700
commit09cfdaacd9322cf0ac94818d8c852e1f4dc5bc4f (patch)
treeb37e4ba16400da9d8ec616e98bb3b7fbdd5136b3 /debug/targets.py
parent069ccc6b8677889f24c259a6b8b267f2233a7dfe (diff)
downloadriscv-tests-09cfdaacd9322cf0ac94818d8c852e1f4dc5bc4f.zip
riscv-tests-09cfdaacd9322cf0ac94818d8c852e1f4dc5bc4f.tar.gz
riscv-tests-09cfdaacd9322cf0ac94818d8c852e1f4dc5bc4f.tar.bz2
Test multiple heterogeneous spike instances. (#338)
Diffstat (limited to 'debug/targets.py')
-rw-r--r--debug/targets.py25
1 files changed, 16 insertions, 9 deletions
diff --git a/debug/targets.py b/debug/targets.py
index be45c62..dd0175e 100644
--- a/debug/targets.py
+++ b/debug/targets.py
@@ -44,12 +44,19 @@ class Hart:
# jumpers.
reset_vectors = []
- def __init__(self, system=None):
- """system is set to an identifier of the system this hart belongs to.
- Harts within the same system are assumed to share memory, and to have
- unique hartids within that system. So for most cases the default
- value of None is fine."""
- self.system = system
+ # system is set to an identifier of the system this hart belongs to. Harts
+ # within the same system are assumed to share memory, and to have unique
+ # hartids within that system. So for most cases the default value of None
+ # is fine.
+ system = None
+
+ def __init__(self, misa=None, system=None, link_script_path=None):
+ if misa:
+ self.misa = misa
+ if system:
+ self.system = system
+ if link_script_path:
+ self.link_script_path = link_script_path
def extensionSupported(self, letter):
# target.misa is set by testlib.ExamineTarget
@@ -162,10 +169,10 @@ class Target:
freertos=test.freertos())
def do_compile(self, hart, *sources):
- binary_name = "%s_%s-%d" % (
+ binary_name = "%s_%s-%x" % (
self.name,
os.path.basename(os.path.splitext(sources[0])[0]),
- hart.xlen)
+ hart.misa)
if Target.isolate:
self.temporary_binary = tempfile.NamedTemporaryFile(
prefix=binary_name + "_")
@@ -203,7 +210,7 @@ class Target:
return binary_name
def compile(self, hart, *sources):
- while True:
+ for _ in range(2):
try:
return self.do_compile(hart, *sources)
except testlib.CompileError as e: