From: Tim Newsome Date: Mon, 25 Jul 2016 18:19:06 +0000 (-0700) Subject: Display log file during build if testing fails. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bd1caacb3d912c51dfe428b99719f9454c744941;p=riscv-tests.git Display log file during build if testing fails. That way somebody doesn't need to spend forever trying to reproduce a travis failure when all they really need is the logfile. --- diff --git a/debug/Makefile b/debug/Makefile index 1d90e12..086cfb9 100644 --- a/debug/Makefile +++ b/debug/Makefile @@ -8,11 +8,9 @@ default: spike$(XLEN).log all: spike32.log spike64.log -spike32.log: - $(GDBSERVER_PY) --isolate --spike32 --cmd $(RISCV_SIM) -- -v > $@ 2>&1 - -spike64.log: - $(GDBSERVER_PY) --isolate --spike --cmd $(RISCV_SIM) -- -v > $@ 2>&1 +%.log: + $(GDBSERVER_PY) --isolate --$(subst .log,,$@) --cmd $(RISCV_SIM) -- -v \ + > $@ 2>&1 || sed s/^/$@:\ / $@ clean: rm -f *.log diff --git a/debug/README.md b/debug/README.md index 829a285..09662ba 100644 --- a/debug/README.md +++ b/debug/README.md @@ -12,7 +12,7 @@ Targets 64-bit Spike ------------ -`./gdbserver.py --spike --cmd $RISCV/bin/spike` +`./gdbserver.py --spike64 --cmd $RISCV/bin/spike` 32-bit Spike ------------ @@ -28,7 +28,7 @@ Debug Tips ========== You can run just a single test by specifying . on the command -line, eg: `./gdbserver.py --spike --cmd $RISCV/bin/spike +line, eg: `./gdbserver.py --spike64 --cmd $RISCV/bin/spike SimpleRegisterTest.test_s0`. Once that test has failed, you can look at gdb.log and (in this case) spike.log to get an idea of what might have gone wrong. diff --git a/debug/gdbserver.py b/debug/gdbserver.py index 0ae75a7..1d5c60e 100755 --- a/debug/gdbserver.py +++ b/debug/gdbserver.py @@ -484,25 +484,23 @@ class Target(object): xlen=self.xlen) return binary_name -class Spike64Target(Target): - name = "spike" - xlen = 64 +class SpikeTarget(Target): + directory = "spike" ram = 0x80010000 ram_size = 5 * 1024 * 1024 instruction_hardware_breakpoint_count = 0 reset_vector = 0x1000 +class Spike64Target(SpikeTarget): + name = "spike64" + xlen = 64 + def server(self): return testlib.Spike(parsed.cmd, halted=True) -class Spike32Target(Target): +class Spike32Target(SpikeTarget): name = "spike32" - directory = "spike" xlen = 32 - ram = 0x80010000 - ram_size = 5 * 1024 * 1024 - instruction_hardware_breakpoint_count = 0 - reset_vector = 0x1000 def server(self): return testlib.Spike(parsed.cmd, halted=True, xlen=32)