temporary_binary = None
openocd_config = []
use_fpu = False
+ misa = None
def __init__(self, cmd, run, isolate):
self.cmd = cmd
march = "rv%dima" % self.xlen
if self.use_fpu:
march += "fd"
+ if self.extensionSupported("c"):
+ march += "c"
testlib.compile(sources +
("programs/entry.S", "programs/init.c",
"-I", "../env",
xlen=self.xlen)
return binary_name
+ def extensionSupported(self, letter):
+ # target.misa is set by testlib.ExamineTarget
+ return self.misa & (1 << (ord(letter.upper()) - ord('A')))
+
class SpikeTarget(Target):
# pylint: disable=abstract-method
directory = "spike"
instruction_hardware_breakpoint_count = 2
openocd_config = "targets/%s/openocd.cfg" % name
+class HiFive1Target(FreedomE300Target):
+ name = "HiFive1"
+ openocd_config = "targets/%s/openocd.cfg" % name
+
class FreedomE300SimTarget(Target):
name = "freedom-e300-sim"
xlen = 32
FreedomE300Target,
FreedomU500Target,
FreedomE300SimTarget,
- FreedomU500SimTarget]
+ FreedomU500SimTarget,
+ HiFive1Target]
def add_target_options(parser):
group = parser.add_mutually_exclusive_group(required=True)