cmd.append(binary)
logfile = open("spike.log", "w")
logfile.write("+ %s\n" % " ".join(cmd))
+ logfile.flush()
self.process = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=logfile,
stderr=logfile)
return self.process.wait(*args, **kwargs)
class Openocd(object):
- def __init__(self, cmd=None, config=None, debug=True):
+ def __init__(self, cmd=None, config=None, debug=False):
if cmd:
cmd = shlex.split(cmd)
else:
if debug:
cmd.append("-d")
logfile = open("openocd.log", "w")
+ logfile.write("+ %s\n" % " ".join(cmd))
self.process = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=logfile,
stderr=logfile)
# TODO: Pick a random port
pass
class Gdb(object):
- def __init__(self):
- path = os.path.expandvars("$RISCV/bin/riscv64-unknown-elf-gdb")
+ def __init__(self,
+ path=os.path.expandvars("$RISCV/bin/riscv64-unknown-elf-gdb")):
self.child = pexpect.spawn(path)
self.child.logfile = file("gdb.log", "w")
+ self.child.logfile.write("+ %s\n" % path)
self.wait()
self.command("set confirm off")
self.command("set width 0")
return output
def load(self):
- output = self.command("load")
+ output = self.command("load", timeout=60)
assert "failed" not in output
assert "Transfer rate" in output