Give these sim targets a chance of passing.
authorTim Newsome <tim@sifive.com>
Thu, 10 Aug 2017 18:43:49 +0000 (11:43 -0700)
committerTim Newsome <tim@sifive.com>
Thu, 10 Aug 2017 18:43:49 +0000 (11:43 -0700)
Also make sure vsim.log makes it into the generated log file.

debug/targets/SiFive/Freedom/E300Sim.py
debug/targets/SiFive/Freedom/U500Sim.py
debug/testlib.py

index e98c5b947448e24aaedf1f2fe2bcd233d78c96d4..91be2e8901778cb3c6ea65d0b7fd3623d67a8391 100644 (file)
@@ -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)
index 76489602bc96cedc99c1e9ce67152125736dda01..62bc8278ab6efd20f30e9ce8c324883aab89d5a1 100644 (file)
@@ -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)
index debe3685af30182c68b7cda555917103e09e9b4a..597c69bd19cf93931349d43e5b1973323f624043 100644 (file)
@@ -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)