From 09cfdaacd9322cf0ac94818d8c852e1f4dc5bc4f Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Thu, 20 May 2021 11:52:21 -0700 Subject: Test multiple heterogeneous spike instances. (#338) --- debug/targets.py | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'debug/targets.py') 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: -- cgit v1.1