Give these sim targets a chance of passing.
[riscv-tests.git] / debug / testlib.py
index 2aab8ab484d70349a358547121968dfbf0d6b4e1..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)
@@ -207,10 +209,10 @@ class Openocd(object):
         messaged = False
         while True:
             log = open(Openocd.logname).read()
-            m = re.search("Listening on port (\d+) for gdb connections", log)
+            m = re.search(r"Listening on port (\d+) for gdb connections", log)
             if m:
                 self.port = int(m.group(1))
-                break;
+                break
 
             if not self.process.poll() is None:
                 header("OpenOCD log")