aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Waterman <andrew@sifive.com>2023-01-11 15:51:37 -0800
committerGitHub <noreply@github.com>2023-01-11 15:51:37 -0800
commitd97ad271eeb8d435c7f53c05cf39d6ff9ee0be41 (patch)
treecdf563d05b5b3328db4ba200d4ba8e78f1d69428
parent9874c1767179250e25094ccc6757a5faad9d99d1 (diff)
parent1dc27cfa782d925cd595898dfe8e136313e1a391 (diff)
downloadriscv-isa-sim-d97ad271eeb8d435c7f53c05cf39d6ff9ee0be41.zip
riscv-isa-sim-d97ad271eeb8d435c7f53c05cf39d6ff9ee0be41.tar.gz
riscv-isa-sim-d97ad271eeb8d435c7f53c05cf39d6ff9ee0be41.tar.bz2
Merge pull request #1212 from riscv-software-src/debug_smoke
Automatically test that external debug still works.
-rw-r--r--.github/workflows/continuous-integration.yml8
-rw-r--r--.github/workflows/debug-smoke.yml64
-rwxr-xr-xci-tests/build-spike14
-rwxr-xr-xci-tests/test-spike9
4 files changed, 84 insertions, 11 deletions
diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml
index 77cc26a..51b65a1 100644
--- a/.github/workflows/continuous-integration.yml
+++ b/.github/workflows/continuous-integration.yml
@@ -25,7 +25,9 @@ jobs:
- name: Install Dependencies
run: sudo xargs apt-get install -y < .github/workflows/apt-packages.txt
- - run: ci-tests/test-spike
+ - run: |
+ ci-tests/build-spike
+ ci-tests/test-spike
test-macos:
name: Test Spike build (MacOS)
@@ -36,4 +38,6 @@ jobs:
- name: Install Dependencies
run: xargs brew install < .github/workflows/brew-packages.txt
- - run: ci-tests/test-spike
+ - run: |
+ ci-tests/build-spike
+ ci-tests/test-spike
diff --git a/.github/workflows/debug-smoke.yml b/.github/workflows/debug-smoke.yml
new file mode 100644
index 0000000..d320b19
--- /dev/null
+++ b/.github/workflows/debug-smoke.yml
@@ -0,0 +1,64 @@
+# Build spike and run a couple of debug tests.
+
+name: Debug Quick Test
+
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ branches:
+ - master
+
+jobs:
+ test:
+ name: Test debug (Ubuntu)
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Install Dependencies
+ run: |
+ sudo xargs apt-get install -y < .github/workflows/apt-packages.txt
+
+ - name: Download OpenOCD
+ run: |
+ git clone --recurse-submodules https://github.com/riscv/riscv-openocd.git
+ cd riscv-openocd
+ git checkout 43ea20dfbb6c815004a51106a3b2009d7f6c4940
+
+ - name: Build OpenOCD
+ run: |
+ cd riscv-openocd
+ ./bootstrap
+ ./configure
+ make -j"$(nproc 2> /dev/null || sysctl -n hw.ncpu)"
+
+ - name: Download Toolchain
+ run: wget --progress=dot:giga https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v12.2.0-1/xpack-riscv-none-elf-gcc-12.2.0-1-linux-x64.tar.gz
+
+ - name: Install Toolchain
+ run: tar zxf xpack-riscv-none-elf-gcc-12.2.0-1-linux-x64.tar.gz
+
+ - name: Build Spike
+ run: ci-tests/build-spike
+
+ - name: Download Tests
+ run: |
+ git clone --recurse-submodules https://github.com/riscv-software-src/riscv-tests.git
+ cd riscv-tests
+ git checkout c84daca8824635b7d896003c78f9c6245997cf7a
+
+ - name: Run Tests
+ run: |
+ cd riscv-tests/debug
+ ./gdbserver.py targets/RISC-V/spike32.py --print-failures \
+ --gcc $GITHUB_WORKSPACE/xpack-riscv-none-elf-gcc-12.2.0-1/bin/riscv-none-elf-gcc \
+ --gdb $GITHUB_WORKSPACE/xpack-riscv-none-elf-gcc-12.2.0-1/bin/riscv-none-elf-gdb \
+ --sim_cmd $GITHUB_WORKSPACE/build/install/bin/spike \
+ --server_cmd $GITHUB_WORKSPACE/riscv-openocd/src/openocd
+ ./gdbserver.py targets/RISC-V/spike64-2.py --print-failures \
+ --gcc $GITHUB_WORKSPACE/xpack-riscv-none-elf-gcc-12.2.0-1/bin/riscv-none-elf-gcc \
+ --gdb $GITHUB_WORKSPACE/xpack-riscv-none-elf-gcc-12.2.0-1/bin/riscv-none-elf-gdb \
+ --sim_cmd $GITHUB_WORKSPACE/build/install/bin/spike \
+ --server_cmd $GITHUB_WORKSPACE/riscv-openocd/src/openocd
diff --git a/ci-tests/build-spike b/ci-tests/build-spike
new file mode 100755
index 0000000..5eb7b58
--- /dev/null
+++ b/ci-tests/build-spike
@@ -0,0 +1,14 @@
+#!/bin/bash
+set -e
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+
+mkdir build
+cd build
+mkdir install
+CXXFLAGS="-Wnon-virtual-dtor" CFLAGS="-Werror -Wignored-qualifiers -Wunused-function -Wunused-parameter -Wunused-variable" $DIR/../configure --prefix=`pwd`/install
+make -j"$(nproc 2> /dev/null || sysctl -n hw.ncpu)"
+make install
+
+# check that help message prints without error
+install/bin/spike -h
diff --git a/ci-tests/test-spike b/ci-tests/test-spike
index bafedc8..725ac64 100755
--- a/ci-tests/test-spike
+++ b/ci-tests/test-spike
@@ -3,16 +3,7 @@ set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
-mkdir build
cd build
-mkdir install
-CXXFLAGS="-Wnon-virtual-dtor" CFLAGS="-Werror -Wignored-qualifiers -Wunused-function -Wunused-parameter -Wunused-variable" $DIR/../configure --prefix=`pwd`/install
-make -j4
-make install
-
-# check that help message prints without error
-install/bin/spike -h
-
# run a program and check for correct output
mkdir run