-
Notifications
You must be signed in to change notification settings - Fork 98
111 lines (97 loc) · 4.54 KB
/
nightly.yml
File metadata and controls
111 lines (97 loc) · 4.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Nightly Regression
on:
schedule:
# run at 00:00 UTC (8:00 UTC+8) so that we can debug it immediately
- cron: '00 00 * * *'
jobs:
test-fuzzing-rocket:
runs-on: ubuntu-latest
# This test runs on ubuntu-20.04 for two reasons:
# (1) riscv-arch-test can be built with riscv-linux-gnu toolchain 9.4.0,
# which is the default apt-installed version on ubuntu 20.04.
# On ubuntu 22.04, toolchain 11.4.0 won't compile riscv-arch-test.
# (2) to test whether difftest compiles correctly on ubuntu 20.04
container: ghcr.io/openxiangshan/xs-env:ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Enable -Werror for EMU Build
run: |
echo "CXX_NO_WARNING=1" >> $GITHUB_ENV
- name: Download the coverage-guided fuzzer - libfuzzer.a
run: |
cd $GITHUB_WORKSPACE/..
mkdir -p xfuzz/target/release && cd xfuzz/target/release
curl -s https://api.github.com/repos/OpenXiangShan/xfuzz/releases/latest \
| grep "browser_download_url" \
| grep "libfuzzer-ubuntu-20.04.a" \
| cut -d '"' -f 4 \
| xargs wget -O libfuzzer.a
- name: Download the customized firtool
run: |
curl -s https://api.github.com/repos/OpenXiangShan/circt/releases/latest \
| grep "browser_download_url" \
| grep "firtool-1.135.0-ubuntu-20.04" \
| cut -d '"' -f 4 \
| xargs wget -O firtool
chmod +x ./firtool
- name: Build the fuzzing corpus - riscv-arch-test
run: |
cd $GITHUB_WORKSPACE/..
git clone https://github.com/OpenXiangShan/riscv-arch-test.git
cd riscv-arch-test/riscv-test-suite
make build_I CROSS=riscv64-linux-gnu- RISCV_ARCH=rv64gc -j2
rm build/*.elf build/*.txt
- name: Build the REF - LLVM instrumented Spike
run: |
cd $GITHUB_WORKSPACE/..
git clone https://github.com/OpenXiangShan/riscv-isa-sim.git
export SPIKE_HOME=$(pwd)/riscv-isa-sim
make -C riscv-isa-sim/difftest CPU=ROCKET_CHIP SANCOV=1 -j2
- name: Build and run the rocket-chip fuzzer
run: |
cd $GITHUB_WORKSPACE/..
export SPIKE_HOME=$(pwd)/riscv-isa-sim
export XFUZZ_HOME=$(pwd)/xfuzz
export NOOP_HOME=$(pwd)/rocket-chip
export CORPUS=$(pwd)/riscv-arch-test/riscv-test-suite/build
git clone -b dev-difftest --single-branch https://github.com/OpenXiangShan/rocket-chip.git
cd rocket-chip && make init
rm -r difftest
cp -r $GITHUB_WORKSPACE .
make bootrom CROSS=riscv64-linux-gnu-
make emu XFUZZ=1 -j2 \
REF=$SPIKE_HOME/difftest/build/riscv64-spike-so LLVM_COVER=1 \
FIRRTL_COVER=branch FIRTOOL=$GITHUB_WORKSPACE/firtool
./build/fuzzer -v -- $CORPUS/I-add-01.bin
./build/fuzzer -f -c llvm.branch --max-runs 100 \
--corpus-input $CORPUS -- --max-cycles 10000 \
| grep max_runs
./build/fuzzer -f -c firrtl.branch --max-runs 100 \
--corpus-input $CORPUS -- --max-cycles 10000 \
| grep max_runs
test-libso-xiangshan:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04]
runs-on: ubuntu-latest
container: ghcr.io/openxiangshan/xs-env:${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Prepare XiangShan
run: |
cd $GITHUB_WORKSPACE/..
git clone --depth 1 https://github.com/OpenXiangShan/XiangShan.git
cd XiangShan && make init && rm -rf difftest && cp -r $GITHUB_WORKSPACE .
echo "NOOP_HOME=$(pwd)" >> $GITHUB_ENV
- name: Chisel Elaboration
run: |
make -C $NOOP_HOME sim-verilog CHISEL_TARGET=chirrtl JVM_XMX=10G
- name: Build libdifftest.so
run: |
make -C $NOOP_HOME/difftest difftest-so
mv $NOOP_HOME/build/libdifftest.so $GITHUB_WORKSPACE/libdifftest.so
- name: Release libdifftest.so to artifacts
uses: actions/upload-artifact@v4
with:
name: libdifftest-${{ matrix.os }}-xiangshan.so
path: libdifftest.so