diff options
author | Tim Newsome <tim@sifive.com> | 2019-09-24 10:39:55 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-24 10:39:55 -0700 |
commit | e459cb616a832227f885e6e34e1d5f260002b501 (patch) | |
tree | f10849ee627da386313b79d388369fdb6447a88e | |
parent | 38150659656069bf5069073d515bb4699a38e2e2 (diff) | |
download | riscv-tests-e459cb616a832227f885e6e34e1d5f260002b501.zip riscv-tests-e459cb616a832227f885e6e34e1d5f260002b501.tar.gz riscv-tests-e459cb616a832227f885e6e34e1d5f260002b501.tar.bz2 |
Look for binaries in $PATH. (#208)
Instead of relying on $RISCV. Using $RISCV was common in the early
days, but nowadays many tools are simply installed alongside the rest of
the system.
-rw-r--r-- | debug/testlib.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/debug/testlib.py b/debug/testlib.py index e80dd32..92e6ab6 100644 --- a/debug/testlib.py +++ b/debug/testlib.py @@ -30,8 +30,7 @@ def find_file(path): return None def compile(args): # pylint: disable=redefined-builtin - cc = os.path.expandvars("$RISCV/bin/riscv64-unknown-elf-gcc") - cmd = [cc, "-g"] + cmd = ["riscv64-unknown-elf-gcc", "-g"] for arg in args: found = find_file(arg) if found: @@ -108,8 +107,7 @@ class Spike(object): if target.sim_cmd: cmd = shlex.split(target.sim_cmd) else: - spike = os.path.expandvars("$RISCV/bin/spike") - cmd = [spike] + cmd = ["spike"] cmd += ["-p%d" % len(harts)] @@ -235,8 +233,7 @@ class Openocd(object): if server_cmd: cmd = shlex.split(server_cmd) else: - openocd = os.path.expandvars("$RISCV/bin/openocd") - cmd = [openocd] + cmd = ["openocd"] if debug: cmd.append("-d") @@ -407,7 +404,7 @@ class Gdb(object): # pylint: disable=too-many-instance-attributes def __init__(self, ports, - cmd=os.path.expandvars("$RISCV/bin/riscv64-unknown-elf-gdb"), + cmd="riscv64-unknown-elf-gdb", timeout=60, binary=None): assert ports |