import targets
+import testlib
class E300Sim(targets.Target):
xlen = 32
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)
-class U500Sim(Target):
+import targets
+import testlib
+
+class U500Sim(targets.Target):
xlen = 64
timeout_sec = 6000
ram = 0x80000000
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)
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)
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)