97 lines
3.4 KiB
YAML
97 lines
3.4 KiB
YAML
# Build spike and run a couple of debug tests.
|
|
|
|
name: Test OpenOCD against 2 spike configurations
|
|
|
|
env:
|
|
SPIKE_REV: 0d1a48c0c0e97521c0081b130e97b1352f27380a
|
|
TOOLCHAIN_URL: 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
|
|
|
|
on: pull_request
|
|
|
|
# There is some commented out code below that would be useful in adding this
|
|
# workflow to other repos. Ideally we can come up with something that would
|
|
# leave this file almost identical between repos, so they can all easily run
|
|
# this test suite.
|
|
|
|
jobs:
|
|
test:
|
|
name: Test debug (Ubuntu)
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Cache dependencies
|
|
id: cache-deps
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: /opt/riscv
|
|
key: "spike-${{env.SPIKE_REV}}-toolchain-${{env.TOOLCHAIN_URL}}"
|
|
|
|
- if: ${{ steps.cache-deps.outputs.cache-hit != 'true' }}
|
|
name: Download Toolchain
|
|
run: |
|
|
mkdir /opt/riscv
|
|
wget --progress=dot:giga $TOOLCHAIN_URL -O /tmp/toolchain.tar.gz
|
|
|
|
- if: ${{ steps.cache-deps.outputs.cache-hit != 'true' }}
|
|
name: Install Toolchain
|
|
run: tar zxf /tmp/toolchain.tar.gz --strip-components=1 -C /opt/riscv
|
|
|
|
- if: ${{ steps.cache-deps.outputs.cache-hit != 'true' }}
|
|
name: Install build dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install build-essential device-tree-compiler
|
|
|
|
- if: ${{ steps.cache-deps.outputs.cache-hit != 'true' }}
|
|
name: Download Spike source
|
|
run: |
|
|
git clone https://github.com/riscv-software-src/riscv-isa-sim
|
|
cd riscv-isa-sim
|
|
git checkout $SPIKE_REV
|
|
git submodule update --init --recursive
|
|
|
|
- if: ${{ steps.cache-deps.outputs.cache-hit != 'true' }}
|
|
name: Build Spike
|
|
run: |
|
|
cd riscv-isa-sim
|
|
mkdir build install
|
|
cd build
|
|
../configure --prefix=/opt/riscv
|
|
make -j"$(nproc 2> /dev/null || sysctl -n hw.ncpu)"
|
|
make install
|
|
|
|
- name: Build OpenOCD
|
|
run: |
|
|
#cd riscv-openocd
|
|
./bootstrap
|
|
./configure --prefix=/opt/riscv
|
|
make -j"$(nproc 2> /dev/null || sysctl -n hw.ncpu)"
|
|
ls -l src/openocd
|
|
|
|
# - name: Download OpenOCD
|
|
# run: |
|
|
# git clone --recurse-submodules https://github.com/riscv/riscv-openocd.git
|
|
# cd riscv-openocd
|
|
# git checkout 43ea20dfbb6c815004a51106a3b2009d7f6c4940
|
|
|
|
- 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 /opt/riscv/bin/riscv-none-elf-gcc \
|
|
--gdb /opt/riscv/bin/riscv-none-elf-gdb \
|
|
--sim_cmd /opt/riscv/bin/spike \
|
|
--server_cmd $GITHUB_WORKSPACE/src/openocd
|
|
./gdbserver.py targets/RISC-V/spike64-2.py --print-failures \
|
|
--gcc /opt/riscv/bin/riscv-none-elf-gcc \
|
|
--gdb /opt/riscv/bin/riscv-none-elf-gdb \
|
|
--sim_cmd /opt/riscv/bin/spike \
|
|
--server_cmd $GITHUB_WORKSPACE/src/openocd
|