From: Tim Newsome Date: Thu, 10 Aug 2017 18:43:49 +0000 (-0700) Subject: Give these sim targets a chance of passing. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d44ebb21c0131c661575539771a1d97fc9afa4c1;p=riscv-tests.git Give these sim targets a chance of passing. Also make sure vsim.log makes it into the generated log file. --- diff --git a/debug/targets/SiFive/Freedom/E300Sim.py b/debug/targets/SiFive/Freedom/E300Sim.py index e98c5b9..91be2e8 100644 --- a/debug/targets/SiFive/Freedom/E300Sim.py +++ b/debug/targets/SiFive/Freedom/E300Sim.py @@ -1,4 +1,5 @@ import targets +import testlib class E300Sim(targets.Target): xlen = 32 @@ -9,5 +10,5 @@ class E300Sim(targets.Target): openocd_config_path = "Freedom.cfg" link_script_path = "Freedom.lds" - def target(self): + def create(self): return testlib.VcsSim(sim_cmd=self.sim_cmd, debug=False) diff --git a/debug/targets/SiFive/Freedom/U500Sim.py b/debug/targets/SiFive/Freedom/U500Sim.py index 7648960..62bc827 100644 --- a/debug/targets/SiFive/Freedom/U500Sim.py +++ b/debug/targets/SiFive/Freedom/U500Sim.py @@ -1,4 +1,7 @@ -class U500Sim(Target): +import targets +import testlib + +class U500Sim(targets.Target): xlen = 64 timeout_sec = 6000 ram = 0x80000000 @@ -7,5 +10,5 @@ class U500Sim(Target): openocd_config_path = "Freedom.cfg" link_script_path = "Freedom.lds" - def target(self): + def create(self): return testlib.VcsSim(sim_cmd=self.sim_cmd, debug=False) diff --git a/debug/testlib.py b/debug/testlib.py index debe368..597c69b 100644 --- a/debug/testlib.py +++ b/debug/testlib.py @@ -116,6 +116,8 @@ class Spike(object): return self.process.wait(*args, **kwargs) class VcsSim(object): + logname = "simv.log" + def __init__(self, sim_cmd=None, debug=False): if sim_cmd: cmd = shlex.split(sim_cmd) @@ -125,10 +127,10 @@ class VcsSim(object): if debug: cmd[0] = cmd[0] + "-debug" cmd += ["+vcdplusfile=output/gdbserver.vpd"] - logfile = open("simv.log", "w") + logfile = open(self.logname, "w") logfile.write("+ %s\n" % " ".join(cmd)) logfile.flush() - listenfile = open("simv.log", "r") + listenfile = open(self.logname, "r") listenfile.seek(0, 2) self.process = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=logfile, stderr=logfile)