aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2021-06-08 10:54:11 -0700
committerGitHub <noreply@github.com>2021-06-08 10:54:11 -0700
commit30e15bf5e7bab7af7153aa9234613b12135304f2 (patch)
tree3b0291b0d61ce8d4143e605ac8095444d7ebde5a
parent1b2c3ea84a7f8d8a833fca4d2b9aebb7d1ba4269 (diff)
downloadriscv-tests-30e15bf5e7bab7af7153aa9234613b12135304f2.zip
riscv-tests-30e15bf5e7bab7af7153aa9234613b12135304f2.tar.gz
riscv-tests-30e15bf5e7bab7af7153aa9234613b12135304f2.tar.bz2
Tweaks for multispike. (#339)
1. Don't run all tests in multi-spike. Extra coverage is negligible, and it just takes too long. 2. Increase a few timeouts.
-rw-r--r--debug/Makefile12
-rwxr-xr-xdebug/gdbserver.py2
-rw-r--r--debug/testlib.py14
3 files changed, 19 insertions, 9 deletions
diff --git a/debug/Makefile b/debug/Makefile
index f6e8efb..06f7d9d 100644
--- a/debug/Makefile
+++ b/debug/Makefile
@@ -4,16 +4,19 @@ XLEN ?= 64
src_dir ?= .
GDBSERVER_PY = $(src_dir)/gdbserver.py
TESTS = $(shell $(GDBSERVER_PY) --list-tests $(src_dir)/targets/RISC-V/spike32.py)
+MULTI_TESTS = $(shell $(GDBSERVER_PY) --list-tests $(src_dir)/targets/RISC-V/spike32.py | \
+ grep -i multi)
default: spike$(XLEN) spike$(XLEN)-2
-all-tests: spike32 spike32-2 spike32-2-hwthread \
- spike64 spike64-2 spike64-2-hwthread spike-multi
+all-tests: spike32 spike-multi-limited spike32-2 spike32-2-hwthread \
+ spike64 spike64-2 spike64-2-hwthread
+
+slow-tests: spike-multi all-tests
all: pylint all-tests
run.%:
- echo $@
$(GDBSERVER_PY) \
$(src_dir)/targets/RISC-V/$(word 2, $(subst ., ,$@)).py \
$(word 3, $(subst ., ,$@)) \
@@ -28,6 +31,9 @@ multi-tests: spike32-2 spike32-2-hwthread
pylint:
pylint --rcfile=pylint.rc `git ls-files '*.py'`
+spike-multi-limited: $(foreach test, $(MULTI_TESTS), run.spike-multi.$(test))
+ echo Finished $@
+
spike%: $(foreach test, $(TESTS), run.spike%.$(test))
echo Finished $@
diff --git a/debug/gdbserver.py b/debug/gdbserver.py
index d4b7078..3484906 100755
--- a/debug/gdbserver.py
+++ b/debug/gdbserver.py
@@ -940,7 +940,7 @@ class Semihosting(GdbSingleHartTest):
self.gdb.b("main:begin")
self.gdb.c()
- self.gdb.p('filename="%s"' % temp.name, ops=2)
+ self.gdb.p('filename="%s"' % temp.name, ops=3)
self.exit()
contents = open(temp.name, "r").readlines()
diff --git a/debug/testlib.py b/debug/testlib.py
index 107c2dc..3717db7 100644
--- a/debug/testlib.py
+++ b/debug/testlib.py
@@ -457,6 +457,9 @@ class NoSymbol(Exception):
Exception.__init__(self)
self.symbol = symbol
+ def __repr__(self):
+ return "NoSymbol(%r)" % self.symbol
+
Thread = collections.namedtuple('Thread', ('id', 'description', 'target_id',
'name', 'frame'))
@@ -665,11 +668,11 @@ class Gdb:
len(self.reset_delays)
self.command("monitor riscv reset_delays %d" % reset_delays,
reset_delays=None)
- timeout = ops * self.timeout
+ timeout = max(1, ops) * self.timeout
self.active_child.sendline(command)
self.active_child.expect("\n", timeout=timeout)
self.active_child.expect(r"\(gdb\)", timeout=timeout)
- return self.active_child.before.strip().decode("utf-8")
+ return self.active_child.before.strip().decode("utf-8", errors="ignore")
def global_command(self, command):
"""Execute this command on every gdb that we control."""
@@ -746,7 +749,8 @@ class Gdb:
self.interrupt()
def x(self, address, size='w', count=1):
- output = self.command("x/%d%s %s" % (count, size, address))
+ output = self.command("x/%d%s %s" % (count, size, address),
+ ops=count / 16)
values = []
for line in output.splitlines():
for value in line.split(':')[1].strip().split():
@@ -997,7 +1001,7 @@ def print_log_handle(name, handle):
print()
def print_log(path):
- print_log_handle(path, open(path, "r"))
+ print_log_handle(path, open(path, "r", errors='ignore'))
class BaseTest:
# pylint: disable=too-many-instance-attributes
@@ -1109,7 +1113,7 @@ class BaseTest:
# Get handles to logs before the files are deleted.
logs = []
for log in self.logs:
- logs.append((log, open(log, "r")))
+ logs.append((log, open(log, "r", errors='ignore')))
self.classTeardown()
for name, handle in logs: