Skip to content

Commit 39eaf2a

Browse files
committed
CI: Execute architectural tests
'make arch-test RISCV_DEVICE=Zifencei' is known to fail.
1 parent c4bbfda commit 39eaf2a

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

.ci/common.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Expect host is Linux/x86_64
2+
check_platform()
3+
{
4+
MACHINE_TYPE=`uname -m`
5+
if [ ${MACHINE_TYPE} != 'x86_64' ]; then
6+
exit
7+
fi
8+
9+
OS_TYPE=`uname -s`
10+
if [ ${OS_TYPE} != 'Linux' ]; then
11+
exit
12+
fi
13+
}

.ci/riscv-tests.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
3+
. .ci/common.sh
4+
5+
check_platform
6+
7+
mkdir -p toolchain
8+
9+
# GNU Toolchain for RISC-V
10+
GCC_VER=12.2.0-1
11+
XPACK_REPO=https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download
12+
13+
set -x
14+
15+
wget -q \
16+
${XPACK_REPO}/v${GCC_VER}/xpack-riscv-none-elf-gcc-${GCC_VER}-linux-x64.tar.gz -O- \
17+
| tar -C toolchain -xz
18+
19+
export PATH=`pwd`/toolchain/xpack-riscv-none-elf-gcc-${GCC_VER}/bin:$PATH
20+
21+
make clean
22+
make arch-test RISCV_DEVICE=I || exit 1
23+
make arch-test RISCV_DEVICE=M || exit 1
24+
make arch-test RISCV_DEVICE=C || exit 1
25+
make arch-test RISCV_DEVICE=Zifencei || exit 1
26+
make arch-test RISCV_DEVICE=privilege || exit 1

.github/workflows/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ jobs:
2424
make distclean ENABLE_COMPUTED_GOTO=0 ENABLE_EXT_C=1
2525
make distclean ENABLE_GDBSTUB=0
2626
make distclean ENABLE_SDL=0
27+
- name: architectural test
28+
run: |
29+
sh .ci/riscv-tests.sh
30+
shell: bash
2731

2832
coding_style:
2933
runs-on: ubuntu-22.04

0 commit comments

Comments
 (0)