forked from openhwgroup/cva6
-
Notifications
You must be signed in to change notification settings - Fork 33
192 lines (169 loc) · 5.63 KB
/
ci.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
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
# Copyright 2021 OpenHW Group
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
# Run functional regression checks
name: ci
on: [push, pull_request]
jobs:
build-riscv-tests:
name: build-riscv-tests
runs-on: ubuntu-latest
env:
NUM_JOBS: 8
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Get specific submodule hash
id: core-v-submodule-hash
run: |
cd verif/core-v-verif
echo "hash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Cache toolchain
id: cache-toolchain
uses: actions/cache@v3
env:
cache-name: cache-toolchain
with:
path: tools/riscv-toolchain/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('ci/install-toolchain.sh') }}
- name: Cache verilator
id: cache-verilator
uses: actions/cache@v3
env:
cache-name: cache-verilator
with:
path: tools/verilator/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('verif/regress/install-verilator.sh') }}
- name: Cache Spike
id: cache-spike
uses: actions/cache@v3
env:
cache-name: cache-spike
with:
path: tools/spike/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('verif/regress/install-spike.sh')}}-${{ steps.core-v-submodule-hash.outputs.hash }}
- name: Prepare
run: |
ci/setup.sh
execute-riscv64-tests:
name: execute-riscv64-tests
runs-on: ubuntu-latest
env:
SPIKE_TANDEM: 1
strategy:
matrix:
testcase: [ cv64a6_imafdc_tests ]
config: [ cv64a6_imafdc_sv39_hpdcache, cv64a6_imafdc_sv39_wb, cv64a6_imafdc_sv39 ]
simulator: [ veri-testharness ]
include:
- testcase: dv-riscv-arch-test
config: cv64a6_imafdc_sv39_hpdcache
simulator: veri-testharness
needs:
build-riscv-tests
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Get specific submodule hash
id: core-v-submodule-hash
run: |
cd verif/core-v-verif
echo "hash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Cache toolchain
id: cache-toolchain
uses: actions/cache@v3
env:
cache-name: cache-toolchain
with:
path: tools/riscv-toolchain/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('ci/install-toolchain.sh') }}
- name: Cache verilator
id: cache-verilator
uses: actions/cache@v3
env:
cache-name: cache-verilator
with:
path: tools/verilator/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('verif/regress/install-verilator.sh') }}
- name: Cache Spike
id: cache-spike
uses: actions/cache@v3
env:
cache-name: cache-spike
with:
path: tools/spike/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('verif/regress/install-spike.sh')}}-${{ steps.core-v-submodule-hash.outputs.hash }}
- name: Run Tests
run: |
set -x
export RISCV=$(pwd)/tools/riscv-toolchain/
source ci/install-prereq.sh
source verif/sim/setup-env.sh
DV_SIMULATORS=${{matrix.simulator}},spike DV_TARGET=${{matrix.config}} bash verif/regress/${{matrix.testcase}}.sh
- name: Upload Lint Report to Github
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{matrix.simulator}}.${{matrix.testcase}}.${{matrix.config}}
path: 'verif/sim/out*'
retention-days: 10
execute-riscv32-tests:
name: execute-riscv32-tests
runs-on: ubuntu-latest
env:
SPIKE_TANDEM: 1
strategy:
matrix:
testcase: [ dv-riscv-arch-test, cv32a6_tests ]
config: [ cv32a65x ]
simulator: [ veri-testharness ]
needs:
build-riscv-tests
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Get specific submodule hash
id: core-v-submodule-hash
run: |
cd verif/core-v-verif
echo "hash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Cache toolchain
id: cache-toolchain
uses: actions/cache@v3
env:
cache-name: cache-toolchain
with:
path: tools/riscv-toolchain/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('ci/install-toolchain.sh') }}
- name: Cache verilator
id: cache-verilator
uses: actions/cache@v3
env:
cache-name: cache-verilator
with:
path: tools/verilator/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('verif/regress/install-verilator.sh') }}
- name: Cache Spike
id: cache-spike
uses: actions/cache@v3
env:
cache-name: cache-spike
with:
path: tools/spike/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('verif/regress/install-spike.sh')}}-${{ steps.core-v-submodule-hash.outputs.hash }}
- name: Run Tests
run: |
set -x
export RISCV=$(pwd)/tools/riscv-toolchain/
source ci/install-prereq.sh
source verif/sim/setup-env.sh
DV_SIMULATORS=${{matrix.simulator}},spike DV_TARGET=${{matrix.config}} bash verif/regress/${{matrix.testcase}}.sh
- name: Upload Lint Report to Github
uses: actions/upload-artifact@v4
with:
name: ${{matrix.simulator}}.${{matrix.testcase}}.${{matrix.config}}
path: 'verif/sim/out*'
retention-days: 10