-
Notifications
You must be signed in to change notification settings - Fork 5
338 lines (314 loc) · 12 KB
/
Copy pathci.yml
File metadata and controls
338 lines (314 loc) · 12 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
325
326
327
328
329
330
331
332
333
334
335
336
337
338
name: ci
on:
push:
pull_request:
defaults:
run:
# for conda
shell: bash -leo pipefail {0}
env:
CHIPYARD_RELPATH: chipyard-work
CHIPYARD_RUN_ROOT: "/scratch/buildbot/radiance-ci-runs/${{ github.run_id }}-${{ github.run_attempt }}"
CHIPYARD_DIR: "/scratch/buildbot/radiance-ci-runs/${{ github.run_id }}-${{ github.run_attempt }}/chipyard"
CHIPYARD_LOG_ROOT: "/scratch/buildbot/radiance-ci-logs"
CHIPYARD_RUN_LOG_DIR: "/scratch/buildbot/radiance-ci-logs/${{ github.run_id }}-${{ github.run_attempt }}"
# flip to force-reset cache
CACHE_NUMBER: 0
JAVA_HEAP_SIZE: "64G"
jobs:
build:
name: Build
runs-on: as4
env:
# fix broken IPv6
RUSTUP_USE_CURL: "1"
CURL_IPRESOLVE: "4"
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: "sparse"
CARGO_NET_RETRY: "10"
CARGO_HTTP_TIMEOUT: "60"
steps:
- name: Setup system
run: |
set -x
cat /proc/cpuinfo | tail -n20
vmstat -SM
df -h
mkdir -p "${CHIPYARD_RUN_LOG_DIR}"
[ -d "${{ github.workspace }}" ] && rm -rf "${{ github.workspace }}"/*
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Checkout Chipyard
id: checkout-chipyard
run: |
mkdir -p "${CHIPYARD_RUN_ROOT}"
git clone --depth 1 --branch graphics "https://github.com/ucb-bar/chipyard.git" "${CHIPYARD_DIR}"
cd "${CHIPYARD_DIR}"
CHIPYARD_HASH="$(git rev-parse HEAD)"
echo "CHIPYARD_HASH=${CHIPYARD_HASH}" >> "${GITHUB_ENV}"
echo "chipyard_hash=${CHIPYARD_HASH}" >> "${GITHUB_OUTPUT}"
# for caching
ln -sf "${CHIPYARD_DIR}" "${GITHUB_WORKSPACE}/${CHIPYARD_RELPATH}"
- name: Install conda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
auto-activate-base: true
activate-environment: ""
- name: Configure conda env
id: conda-env
run: |
CONDA_BASE="$(conda info --base)"
CONDA_ENV_NAME="chipyard-${CHIPYARD_HASH}"
CONDA_ENV_DIR="${CONDA_BASE}/envs/${CONDA_ENV_NAME}"
echo "CONDA_ENV_NAME=${CONDA_ENV_NAME}" >> "${GITHUB_ENV}"
echo "CONDA_ENV_DIR=${CONDA_ENV_DIR}" >> "${GITHUB_ENV}"
echo "conda_env_name=${CONDA_ENV_NAME}" >> "${GITHUB_OUTPUT}"
echo "conda_env_dir=${CONDA_ENV_DIR}" >> "${GITHUB_OUTPUT}"
- name: Setup rust
run: |
echo "CARGO_HOME=$HOME/.cargo" >> "$GITHUB_ENV"
echo "RUSTUP_HOME=$HOME/.rustup" >> "$GITHUB_ENV"
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: Check rust
run: |
command -v rustc
command -v cargo
rustup --version
rustc --version
cargo --version
- name: Cache conda-env
id: cache-conda-env
uses: actions/cache@v5
with:
path: |
${{ steps.conda-env.outputs.conda_env_dir }}
key: chipyard-${{ steps.checkout-chipyard.outputs.chipyard_hash }}-${{ runner.os }}-${{ runner.arch }}-${{ env.CACHE_NUMBER }}
- name: Setup Chipyard
run: |
.github/scripts/setup-chipyard.sh "${{ steps.cache-conda-env.outputs.cache-hit }}"
- name: Setup Radiance
# move radiance to under chipyard/generators
run: |
set -eux
rm -rf "${CHIPYARD_DIR}/generators/radiance"
rsync -a --exclude "/${CHIPYARD_RELPATH}/" \
"${GITHUB_WORKSPACE}/" "${CHIPYARD_DIR}/generators/radiance/"
ls -al "${CHIPYARD_DIR}/generators/radiance"
# warm up cargo as fetching index.crates.io likes to fail intermittently
- name: Cargo fetch
run: |
cd "${CHIPYARD_DIR}/generators/radiance/cyclotron"
cargo fetch
- name: Cache Scala build files
uses: actions/cache@v5
with:
path: |
${{ env.CHIPYARD_RELPATH }}/generators/**/target/**
${{ env.CHIPYARD_RELPATH }}/.ivy2/cache
${{ env.CHIPYARD_RELPATH }}/.sbt
~/.cache/coursier
key: scala-${{ runner.os }}-${{ runner.arch }}-${{ github.sha }}-${{ env.CACHE_NUMBER }}
restore-keys: |
scala-${{ runner.os }}-${{ runner.arch }}-
- name: Build Radiance sim binary
run: |
cd "${CHIPYARD_DIR}"
source env.sh
source /ecad/tools/vlsi.bashrc
cd sims/vcs
make default CONFIG=RadianceTapeoutSimTraceConfig
# make default CONFIG=RadianceTapeoutNDAFreeConfig
# make default CONFIG=TetheredRadianceTapeoutConfig
make default SUB_PROJECT=muon CONFIG=MuonCoreTestConfig
make default SUB_PROJECT=muon CONFIG=MuonBackendTestConfig
run-unit-tests:
name: Run Unit-tests
runs-on: as4
needs: build
steps:
- name: Run ChiselTest unit-tests
run: |
cd "${CHIPYARD_DIR}"
source env.sh
source /ecad/tools/vlsi.bashrc
sbt "project radiance; \
testOnly radiance.muon.ALUPipeTest; \
testOnly radiance.muon.FPPipeTest; \
testOnly radiance.muon.MulDivPipeTest; \
testOnly radiance.muon.SequencerTest; \
testOnly radiance.muon.ScoreboardTest"
# run-tapeout-binary-tests:
# name: Run Tapeout binary tests
# runs-on: as4
# needs: build
# steps:
# - name: Run binary tests on tapeout config
# run: |
# cd "${CHIPYARD_DIR}"
# source env.sh
# source /ecad/tools/vlsi.bashrc
# cd generators/radiance
# python3 test/run_binary_tests.py -j "$(nproc)" -c tapeout \
# --timeout 7200 \
# --log-dir "${CHIPYARD_RUN_LOG_DIR}" \
# --elf-dir cyclotron/test/host-launch \
# --json-out "${CHIPYARD_RUN_LOG_DIR}/tapeout/results.json"
# - name: Run bindiff tests on tapeout config
# if: always()
# run: |
# cd "${CHIPYARD_DIR}/generators/radiance"
# python3 test/run_bindiff_tests.py "${CHIPYARD_RUN_LOG_DIR}/tapeout/results.json"
# - name: Render binary test report
# if: always()
# run: |
# cd "${CHIPYARD_DIR}/generators/radiance"
# python3 test/render_binary_test_report.py \
# "${CHIPYARD_RUN_LOG_DIR}/tapeout/results.json" \
# --github-step-summary
# run-tethered-binary-tests:
# name: Run Tethered binary tests
# runs-on: as4
# needs: build
# steps:
# - name: Run binary tests on host-launch config
# run: |
# cd "${CHIPYARD_DIR}"
# source env.sh
# source /ecad/tools/vlsi.bashrc
# cd generators/radiance
# python3 test/run_binary_tests.py -j "$(nproc)" -c tethered \
# --timeout 7200 \
# --log-dir "${CHIPYARD_RUN_LOG_DIR}" \
# --elf-dir cyclotron/test/host-launch \
# --json-out "${CHIPYARD_RUN_LOG_DIR}/hostlaunch/results.json"
# - name: Run bindiff tests on host-launch config
# if: always()
# run: |
# cd "${CHIPYARD_DIR}/generators/radiance"
# python3 test/run_bindiff_tests.py "${CHIPYARD_RUN_LOG_DIR}/hostlaunch/results.json"
# - name: Render binary test report
# if: always()
# run: |
# cd "${CHIPYARD_DIR}/generators/radiance"
# python3 test/render_binary_test_report.py \
# "${CHIPYARD_RUN_LOG_DIR}/hostlaunch/results.json" \
# --github-step-summary
run-soc-binary-tests:
name: Run SoC binary tests
runs-on: as4
needs: build
steps:
- name: Run binary tests on SoC config
run: |
cd "${CHIPYARD_DIR}"
source env.sh
source /ecad/tools/vlsi.bashrc
cd generators/radiance
python3 test/run_binary_tests.py -j "$(nproc)" \
--timeout 7200 \
--log-dir "${CHIPYARD_RUN_LOG_DIR}" \
--elf-dir cyclotron/test/fused \
--json-out "${CHIPYARD_RUN_LOG_DIR}/soc/results.json"
- name: Run bindiff tests on SoC config
if: always()
run: |
cd "${CHIPYARD_DIR}/generators/radiance"
python3 test/run_bindiff_tests.py "${CHIPYARD_RUN_LOG_DIR}/soc/results.json"
- name: Render binary test report
if: always()
run: |
cd "${CHIPYARD_DIR}/generators/radiance"
python3 test/render_binary_test_report.py \
"${CHIPYARD_RUN_LOG_DIR}/soc/results.json" \
--github-step-summary
# run-core-binary-tests:
# name: Run Core-standalone binary tests
# runs-on: as4
# needs: build
# continue-on-error: true
# steps:
# - name: Run binary tests on core-as-top config
# # waive non-essential core/cosim tests tapeout
# run: |
# cd "${CHIPYARD_DIR}"
# source env.sh
# source /ecad/tools/vlsi.bashrc
# cd generators/radiance
# python3 test/run_binary_tests.py -j "$(nproc)" -c core \
# --log-dir "${CHIPYARD_RUN_LOG_DIR}" \
# --elf-dir cyclotron/test/isa-tests \
# --json-out "${CHIPYARD_RUN_LOG_DIR}/core/results.json"
# - name: Run bindiff tests on core-as-top config
# if: always()
# run: |
# cd "${CHIPYARD_DIR}/generators/radiance"
# python3 test/run_bindiff_tests.py "${CHIPYARD_RUN_LOG_DIR}/core/results.json"
# - name: Render binary test report
# if: always()
# run: |
# cd "${CHIPYARD_DIR}/generators/radiance"
# python3 test/render_binary_test_report.py \
# "${CHIPYARD_RUN_LOG_DIR}/core/results.json" \
# --github-step-summary
# run-cosim-binary-tests:
# name: Run Cyclotron-as-a-Tile Co-sim binary tests
# runs-on: as4
# needs: build
# continue-on-error: true
# steps:
# - name: Run binary tests on backend co-sim config
# # waive non-essential core/cosim tests tapeout
# run: |
# cd "${CHIPYARD_DIR}"
# source env.sh
# source /ecad/tools/vlsi.bashrc
# cd generators/radiance
# python3 test/run_binary_tests.py -j "$(nproc)" -c cosim \
# --log-dir "${CHIPYARD_RUN_LOG_DIR}" \
# --elf-dir cyclotron/test/fused \
# --json-out "${CHIPYARD_RUN_LOG_DIR}/cosim/results.json"
# - name: Run bindiff tests on backend co-sim config
# if: always()
# run: |
# cd "${CHIPYARD_DIR}/generators/radiance"
# python3 test/run_bindiff_tests.py "${CHIPYARD_RUN_LOG_DIR}/cosim/results.json"
# - name: Render binary test report
# if: always()
# run: |
# cd "${CHIPYARD_DIR}/generators/radiance"
# python3 test/render_binary_test_report.py \
# "${CHIPYARD_RUN_LOG_DIR}/cosim/results.json" \
# --github-step-summary
# run-backend-cosim-binary-tests:
# name: Run Backend Co-sim binary tests
# runs-on: as4
# needs: build
# steps:
# - name: Run binary tests on backend co-sim config
# run: |
# cd "${CHIPYARD_DIR}"
# source env.sh
# source /ecad/tools/vlsi.bashrc
# cd generators/radiance
# python3 test/run_binary_tests.py -j "$(nproc)" -c backend \
# --elf-dir cyclotron/test/isa-tests \
# --json-out test/binary-test-logs/backend/results.json
# - name: Render binary test report
# if: always()
# run: |
# cd "${CHIPYARD_DIR}/generators/radiance"
# python3 test/render_binary_test_report.py \
# test/binary-test-logs/backend/results.json \
# --github-step-summary
clean:
name: Clean
runs-on: as4
needs: [build, run-unit-tests, run-soc-binary-tests]
if: always()
steps:
- name: Cleanup workspace, chipyard and conda
run: |
[ -d "${{ github.workspace }}" ] && rm -rf "${{ github.workspace }}"
[ -d "${CHIPYARD_RUN_ROOT}" ] && rm -rf "${CHIPYARD_RUN_ROOT}"