-
Notifications
You must be signed in to change notification settings - Fork 28
126 lines (116 loc) · 4.6 KB
/
build.yml
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: build tests for XiangShan
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
MAKE_FLAGS: ARCH=riscv64-xs CROSS_COMPILE=riscv64-linux-gnu-
jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Dependency
run: |
sudo apt-get update
sudo apt-get install -y gcc-riscv64-linux-gnu g++-riscv64-linux-gnu gfortran-riscv64-linux-gnu binutils-riscv64-linux-gnu
- name: Setup env
run: |
echo "AM_HOME=$GITHUB_WORKSPACE" >> $GITHUB_ENV
- name: Build normal tests
env:
tests: |
tests/cputest
tests/softprefetchtest
tests/dualcoretest
tests/cacheoptest/dcache
tests/cacheoptest/icache
tests/cacheoptest/llc
tests/aliastest
tests/countertest
run: |
for one_test in $tests; do
echo ::group::$one_test
cd $GITHUB_WORKSPACE/$one_test
make clean
make ${{ env.MAKE_FLAGS }}
mkdir -p $GITHUB_WORKSPACE/build/$one_test
cp build/*.{elf,bin,txt} $GITHUB_WORKSPACE/build/$one_test
cd $GITHUB_WORKSPACE
echo "::endgroup::"
done
- name: Build Microbench
run: |
cd $GITHUB_WORKSPACE/apps/microbench
make clean
make ${{ env.MAKE_FLAGS }} mainargs=test
mkdir -p $GITHUB_WORKSPACE/build/apps/microbench
cp build/*.{elf,bin,txt} $GITHUB_WORKSPACE/build/apps/microbench
cd $GITHUB_WORKSPACE
- name: Build coremark for 1/2/10 iterations
env:
args: |
ITERATIONS=1
ITERATIONS=2
run: |
cd $GITHUB_WORKSPACE/apps/coremark
mkdir -p $GITHUB_WORKSPACE/build/apps/coremark
echo ::group::default
make clean
make ${{ env.MAKE_FLAGS }}
cp build/*.{elf,bin,txt} $GITHUB_WORKSPACE/build/apps/coremark
echo "::endgroup::"
for one_arg in $args; do
echo ::group::$one_arg
make clean
make ${{ env.MAKE_FLAGS }} $one_arg
cp build/*.{elf,bin,txt} $GITHUB_WORKSPACE/build/apps/coremark
echo "::endgroup::"
done
cd $GITHUB_WORKSPACE
- name: Build copy_and_run_coremark
env:
MAKE_FLAGS: ARCH=riscv64-xs-flash CROSS_COMPILE=riscv64-linux-gnu-
run: |
cd $GITHUB_WORKSPACE/apps/loader
make clean
make ${{ env.MAKE_FLAGS }} ELF_PATH=$GITHUB_WORKSPACE/build/apps/coremark/coremark-1-iteration-riscv64-xs.bin
mkdir -p $GITHUB_WORKSPACE/build/apps/copy_and_run_coremark
cp build/*.{elf,bin,txt} $GITHUB_WORKSPACE/build/apps/copy_and_run_coremark
cd $GITHUB_WORKSPACE
- name: Build amtest
run: |
mkdir -p $GITHUB_WORKSPACE/build/amtest/
cd $GITHUB_WORKSPACE/tests/amtest
# Thanks to the brilliant framework of amtest, tests have to be compiled one by on.
# external_intr
echo ::group::external_intr
make ${{ env.MAKE_FLAGS }} mainargs=e
cp build/amtest-riscv64-xs.bin $GITHUB_WORKSPACE/build/amtest/external_intr-riscv64-xs.bin
cp build/amtest-riscv64-xs.elf $GITHUB_WORKSPACE/build/amtest/external_intr-riscv64-xs.elf
cp build/amtest-riscv64-xs.txt $GITHUB_WORKSPACE/build/amtest/external_intr-riscv64-xs.txt
make clean
echo "::endgroup::"
# pmp_test
echo ::group::pmp_test
make ${{ env.MAKE_FLAGS }} mainargs=c
cp build/amtest-riscv64-xs.bin $GITHUB_WORKSPACE/build/amtest/pmp_test-riscv64-xs.bin
cp build/amtest-riscv64-xs.elf $GITHUB_WORKSPACE/build/amtest/pmp_test-riscv64-xs.elf
cp build/amtest-riscv64-xs.txt $GITHUB_WORKSPACE/build/amtest/pmp_test-riscv64-xs.txt
make clean
echo "::endgroup::"
# sv39_hp_atom_test
echo ::group::sv39_hp_atom_test
make ${{ env.MAKE_FLAGS }} mainargs=f
cp build/amtest-riscv64-xs.bin $GITHUB_WORKSPACE/build/amtest/sv39_hp_atom_test-riscv64-xs.bin
cp build/amtest-riscv64-xs.elf $GITHUB_WORKSPACE/build/amtest/sv39_hp_atom_test-riscv64-xs.elf
cp build/amtest-riscv64-xs.txt $GITHUB_WORKSPACE/build/amtest/sv39_hp_atom_test-riscv64-xs.txt
make clean
echo "::endgroup::"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: nexus-am-workloads
path: build