-
Notifications
You must be signed in to change notification settings - Fork 19
181 lines (149 loc) · 6.06 KB
/
ci.yml
File metadata and controls
181 lines (149 loc) · 6.06 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
name: CI
on:
workflow_dispatch:
push:
paths:
- '**.hpp'
- '**.cpp'
- '**.h'
- '**.c'
- '**.S'
- '**CMakeLists.txt'
- '.github/workflows/**'
- 'conanfile.py'
pull_request:
paths:
- '**.hpp'
- '**.cpp'
- '**.h'
- '**.c'
- '**.S'
- '**CMakeLists.txt'
- '.github/workflows/**'
- 'conanfile.py'
jobs:
cpp-compliance:
name: C++ Std Compliance (C++${{ matrix.cpp_std }})
runs-on: ubuntu-24.04
strategy:
matrix:
cpp_std: [17, 20]
steps:
- uses: actions/checkout@v4
- name: Update submodules
run: git submodule update --init --recursive
- name: Cache Conan
uses: actions/cache@v4
with:
path: ~/.conan2
key: conan-${{ runner.os }}-unit-cpp${{ matrix.cpp_std }}-${{ hashFiles('conanfile.py') }}
- name: Install dependencies
run: |
sudo apt-get install -y g++ python3-pip cmake llvm-19-dev
pip3 install conan
cmake --version
- name: Configure
run: cmake --preset Release -B build -DCMAKE_CXX_STANDARD=${{ matrix.cpp_std }} -DWITH_LLVM=ON -DWITH_SYSTEM_LLVM=ON
- name: Build
run: cmake --build build -j
- name: Smoke test
run: ./build/riscv-sim -h
# NOTE: .so filename is tied to VERSION in top-level CMakeLists.txt - update both together
- name: Upload binary
if: matrix.cpp_std == 20
uses: actions/upload-artifact@v4
with:
name: riscv-sim
path: |
build/riscv-sim
build/libdbt-rise-riscv.so.2.1.0
pmp-tests:
name: PMP Functional Tests
runs-on: ubuntu-24.04
needs: cpp-compliance
steps:
- uses: actions/checkout@v4
- name: Install RISC-V toolchain
run: sudo apt-get install -y gcc-riscv64-unknown-elf
- name: Download riscv-sim binary
uses: actions/download-artifact@v4
with:
name: riscv-sim
- name: Make binary executable
run: chmod +x riscv-sim
- name: Build PMP CSR test firmware
run: |
riscv64-unknown-elf-gcc -nostdlib -march=rv64gc -mabi=lp64 \
-Wl,-Ttext=0x10000,--no-dynamic-linker \
-o pmp_csr_test \
contrib/fw/pmp-csr-test/pmp_csr_test.S
- name: rv64gc_m CSR test - interp (no PMP, expect exit 2)
run: |
LD_LIBRARY_PATH=. ./riscv-sim -f pmp_csr_test --isa rv64gc_m --backend interp || rc=$?
[ "${rc:-0}" -eq 2 ]
- name: rv64gc_mp CSR test - interp (with PMP)
run: LD_LIBRARY_PATH=. ./riscv-sim -f pmp_csr_test --isa rv64gc_mp --backend interp
- name: Build PMP enforcement test firmware
run: |
riscv64-unknown-elf-gcc -nostdlib -march=rv64gc -mabi=lp64 \
-Wl,-Ttext=0x10000,--no-dynamic-linker \
-o pmp_enforce_test \
contrib/fw/pmp-enforce-test/pmp_enforce_test.S
- name: rv64gc_mp enforcement test - interp
run: LD_LIBRARY_PATH=. ./riscv-sim -f pmp_enforce_test --isa rv64gc_mp --backend interp
- name: Build PMP shift test firmware
run: |
riscv64-unknown-elf-gcc -nostdlib -march=rv64gc -mabi=lp64 \
-Wl,-Ttext=0x10000,--no-dynamic-linker \
-o pmp_shift_test \
contrib/fw/pmp-shift-test/pmp_shift_test.S
- name: rv64gc_mp shift test - interp
run: LD_LIBRARY_PATH=. ./riscv-sim -f pmp_shift_test --isa rv64gc_mp --backend interp
- name: Build PMP upper-cfg test firmware
run: |
riscv64-unknown-elf-gcc -nostdlib -march=rv64gc -mabi=lp64 \
-Wl,-Ttext=0x10000,--no-dynamic-linker \
-o pmp_upper_cfg_test \
contrib/fw/pmp-upper-cfg-test/pmp_upper_cfg_test.S
- name: rv64gc_mp upper-cfg test - interp
run: LD_LIBRARY_PATH=. ./riscv-sim -f pmp_upper_cfg_test --isa rv64gc_mp --backend interp
- name: Build PMP cfg2 test firmware
run: |
riscv64-unknown-elf-gcc -nostdlib -march=rv64gc -mabi=lp64 \
-Wl,-Ttext=0x10000,--no-dynamic-linker \
-o pmp_cfg2_test \
contrib/fw/pmp-cfg2-test/pmp_cfg2_test.S
- name: rv64gc_mp cfg2 test - interp
run: LD_LIBRARY_PATH=. ./riscv-sim -f pmp_cfg2_test --isa rv64gc_mp --backend interp
- name: Build PMP TOR test firmware
run: |
riscv64-unknown-elf-gcc -nostdlib -march=rv64gc -mabi=lp64 \
-Wl,-Ttext=0x10000,--no-dynamic-linker \
-o pmp_tor_test \
contrib/fw/pmp-tor-test/pmp_tor_test.S
- name: rv64gc_mp TOR test - interp
run: LD_LIBRARY_PATH=. ./riscv-sim -f pmp_tor_test --isa rv64gc_mp --backend interp
- name: Build PMP 64-entry pmpaddr test firmware
run: |
riscv64-unknown-elf-gcc -nostdlib -march=rv64gc -mabi=lp64 \
-Wl,-Ttext=0x10000,--no-dynamic-linker \
-o pmp_64entry_addr_test \
contrib/fw/pmp-64entry-addr-test/pmp_64entry_addr_test.S
- name: rv64gc_mp 64-entry pmpaddr test - interp
run: LD_LIBRARY_PATH=. ./riscv-sim -f pmp_64entry_addr_test --isa rv64gc_mp --backend interp
- name: Build PMP 64-entry pmpcfg test firmware
run: |
riscv64-unknown-elf-gcc -nostdlib -march=rv64gc -mabi=lp64 \
-Wl,-Ttext=0x10000,--no-dynamic-linker \
-o pmp_64entry_cfg_test \
contrib/fw/pmp-64entry-cfg-test/pmp_64entry_cfg_test.S
- name: rv64gc_mp 64-entry pmpcfg test - interp
run: LD_LIBRARY_PATH=. ./riscv-sim -f pmp_64entry_cfg_test --isa rv64gc_mp --backend interp
- name: Build PMP 8-entry guard test firmware (VP/S5 model)
run: |
riscv64-unknown-elf-gcc -nostdlib -march=rv64gc -mabi=lp64 \
-Wl,-Ttext=0x10000,--no-dynamic-linker \
-o pmp_8entry_guard_test \
contrib/fw/pmp-8entry-guard-test/pmp_8entry_guard_test.S
- name: rv64gc_mp_8 8-entry enforcement test - interp (VP/S5 model)
run: LD_LIBRARY_PATH=. ./riscv-sim -f pmp_8entry_guard_test --isa rv64gc_mp_8 --backend interp