-
Notifications
You must be signed in to change notification settings - Fork 4
324 lines (281 loc) · 9.96 KB
/
ci.yml
File metadata and controls
324 lines (281 loc) · 9.96 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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
# Copyright 2026 Two Sigma Open Source, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
# Tool versions - single source of truth (also in Dockerfile)
VERILATOR_VERSION: "5.044"
YOSYS_VERSION: "0.60"
jobs:
# Build the Docker image (shared by all jobs)
build-docker:
name: Build Docker Image
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and export Docker image
uses: docker/build-push-action@v6
with:
context: .
tags: frost-dev:latest
outputs: type=docker,dest=/tmp/frost-dev.tar
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Upload Docker image artifact
uses: actions/upload-artifact@v4
with:
name: frost-docker-image
path: /tmp/frost-dev.tar
retention-days: 1
# Run Cocotb tests with Verilator (excludes arch compliance, which has its own matrix job)
test-verilator:
name: Cocotb Tests (Verilator)
runs-on: ubuntu-24.04
needs: build-docker
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Download Docker image
uses: actions/download-artifact@v4
with:
name: frost-docker-image
path: /tmp
- name: Load Docker image
run: docker load --input /tmp/frost-dev.tar
- name: Run Cocotb tests with Verilator
run: |
docker run --rm -v ${{ github.workspace }}:/workspace frost-dev:latest \
pytest tests/ -m cocotb --sim verilator -v \
--ignore=tests/test_arch_compliance.py \
--ignore=tests/test_riscv_tests.py \
--ignore=tests/test_riscv_torture.py
# RISC-V Architecture Compliance Tests - parallelized by extension
test-arch-compliance:
name: Arch Tests (${{ matrix.extension }})
runs-on: ubuntu-24.04
needs: build-docker
strategy:
fail-fast: false
matrix:
extension: [I, M, A, F, D, C, B, K, Zicond, Zifencei, privilege, F_Zcf, D_Zcd, hints]
# Individual jobs for slow tests (>5000 test cases) that are excluded
# from the F/D extension jobs by the SIM_MAX_TEST_CASES filter.
include:
- extension: "F fadd_b11"
test_path: rv32i_m/F/src/fadd_b11-01.S
- extension: "F fmadd_b1"
test_path: rv32i_m/F/src/fmadd_b1-01.S
- extension: "F fmsub_b1"
test_path: rv32i_m/F/src/fmsub_b1-01.S
- extension: "F fnmadd_b1"
test_path: rv32i_m/F/src/fnmadd_b1-01.S
- extension: "F fnmsub_b1"
test_path: rv32i_m/F/src/fnmsub_b1-01.S
- extension: "F fsub_b11"
test_path: rv32i_m/F/src/fsub_b11-01.S
- extension: "D fadd.d_b11"
test_path: rv32i_m/D/src/fadd.d_b11-01.S
- extension: "D fmadd.d_b1"
test_path: rv32i_m/D/src/fmadd.d_b1-01.S
- extension: "D fmsub.d_b1"
test_path: rv32i_m/D/src/fmsub.d_b1-01.S
- extension: "D fnmadd.d_b1"
test_path: rv32i_m/D/src/fnmadd.d_b1-01.S
- extension: "D fnmsub.d_b1"
test_path: rv32i_m/D/src/fnmsub.d_b1-01.S
- extension: "D fssub.d_b11"
test_path: rv32i_m/D/src/fssub.d_b11-01.S
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Download Docker image
uses: actions/download-artifact@v4
with:
name: frost-docker-image
path: /tmp
- name: Load Docker image
run: docker load --input /tmp/frost-dev.tar
- name: Run arch compliance tests (${{ matrix.extension }})
run: |
if [ -n "${{ matrix.test_path }}" ]; then
docker run --rm -v ${{ github.workspace }}:/workspace frost-dev:latest \
python3 tests/test_arch_compliance.py --sim verilator --test ${{ matrix.test_path }}
else
docker run --rm -v ${{ github.workspace }}:/workspace frost-dev:latest \
python3 tests/test_arch_compliance.py --sim verilator --extensions ${{ matrix.extension }}
fi
# riscv-tests ISA Tests - parallelized by suite
test-riscv-tests:
name: riscv-tests (${{ matrix.suite }})
runs-on: ubuntu-24.04
needs: build-docker
strategy:
fail-fast: false
matrix:
suite: [rv32ui, rv32um, rv32ua, rv32uf, rv32ud, rv32uc, rv32mi, rv32uzba, rv32uzbb, rv32uzbs, rv32uzbkb]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Download Docker image
uses: actions/download-artifact@v4
with:
name: frost-docker-image
path: /tmp
- name: Load Docker image
run: docker load --input /tmp/frost-dev.tar
- name: Run riscv-tests ISA suite (${{ matrix.suite }})
run: |
docker run --rm -v ${{ github.workspace }}:/workspace frost-dev:latest \
python3 tests/test_riscv_tests.py --sim verilator --suites ${{ matrix.suite }}
# riscv-tests Benchmarks
test-riscv-benchmarks:
name: riscv-tests Benchmarks (${{ matrix.benchmark }})
runs-on: ubuntu-24.04
needs: build-docker
strategy:
fail-fast: false
matrix:
benchmark: [median, multiply, qsort, rsort, towers, vvadd, dhrystone, mm, spmv]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Download Docker image
uses: actions/download-artifact@v4
with:
name: frost-docker-image
path: /tmp
- name: Load Docker image
run: docker load --input /tmp/frost-dev.tar
- name: Run riscv-tests benchmark (${{ matrix.benchmark }})
run: |
docker run --rm -v ${{ github.workspace }}:/workspace frost-dev:latest \
python3 tests/test_riscv_tests.py --sim verilator --benchmarks ${{ matrix.benchmark }}
# riscv-torture Random Instruction Tests
test-riscv-torture:
name: riscv-torture Tests
runs-on: ubuntu-24.04
needs: build-docker
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Download Docker image
uses: actions/download-artifact@v4
with:
name: frost-docker-image
path: /tmp
- name: Load Docker image
run: docker load --input /tmp/frost-dev.tar
- name: Run riscv-torture tests
run: |
docker run --rm -v ${{ github.workspace }}:/workspace frost-dev:latest \
python3 tests/test_riscv_torture.py --sim verilator --all
# Run Cocotb tests with Icarus Verilog
test-icarus:
name: Cocotb Tests (Icarus)
runs-on: ubuntu-24.04
needs: build-docker
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Download Docker image
uses: actions/download-artifact@v4
with:
name: frost-docker-image
path: /tmp
- name: Load Docker image
run: docker load --input /tmp/frost-dev.tar
- name: Run Cocotb tests with Icarus
run: |
docker run --rm -v ${{ github.workspace }}:/workspace frost-dev:latest \
pytest tests/ -m cocotb --sim icarus -v
# Run Yosys synthesis check
test-synthesis:
name: Yosys Synthesis Check
runs-on: ubuntu-24.04
needs: build-docker
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Download Docker image
uses: actions/download-artifact@v4
with:
name: frost-docker-image
path: /tmp
- name: Load Docker image
run: docker load --input /tmp/frost-dev.tar
- name: Run synthesis tests
run: |
docker run --rm -v ${{ github.workspace }}:/workspace frost-dev:latest \
pytest tests/ -m synthesis -v
# Run SymbiYosys formal verification
test-formal:
name: Formal Verification
runs-on: ubuntu-24.04
needs: build-docker
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Download Docker image
uses: actions/download-artifact@v4
with:
name: frost-docker-image
path: /tmp
- name: Load Docker image
run: docker load --input /tmp/frost-dev.tar
- name: Run formal verification
run: |
docker run --rm -v ${{ github.workspace }}:/workspace frost-dev:latest \
pytest tests/ -m formal -v
# Run linting inside Docker to ensure version consistency with pre-commit
lint:
name: Lint
runs-on: ubuntu-24.04
needs: build-docker
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download Docker image
uses: actions/download-artifact@v4
with:
name: frost-docker-image
path: /tmp
- name: Load Docker image
run: docker load --input /tmp/frost-dev.tar
- name: Run pre-commit hooks
run: |
docker run --rm -v ${{ github.workspace }}:/workspace frost-dev:latest \
pre-commit run --all-files