-
Notifications
You must be signed in to change notification settings - Fork 98
461 lines (392 loc) · 17.5 KB
/
main.yml
File metadata and controls
461 lines (392 loc) · 17.5 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
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
test-difftest-main:
runs-on: ubuntu-latest
container: ghcr.io/openxiangshan/xs-env:ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Compile
run: |
mill -i design.compile
- name: Generate Verilog
run: |
make
- name: Copy the Profile File
run: |
mv build/generated-src/difftest_profile.json .
make clean
- name: Generate Verilog using Profile
run: |
make PROFILE=./difftest_profile.json NUM_CORES=4
- name: Generate EMU using Profile-Generated RTL
run: |
make emu WITH_CHISELDB=0 WITH_CONSTANTIN=0 -j2
make clean
- name: Generate EMU with Squash
run: |
make PROFILE=./difftest_profile.json NUM_CORES=4 CONFIG=S
make emu WITH_CHISELDB=0 WITH_CONSTANTIN=0 -j2
make clean
- name: Generate EMU with SoftArchUpdate
run: |
make PROFILE=./difftest_profile.json NUM_CORES=4 CONFIG=U
make emu WITH_CHISELDB=0 WITH_CONSTANTIN=0 -j2
make clean
- name: Clean the Profile File
run: |
rm -f ./difftest_profile.json
test-verilator-nutshell:
runs-on: ubuntu-latest
container: ghcr.io/openxiangshan/xs-env:ubuntu-24.04
needs: test-difftest-main
steps:
- uses: actions/checkout@v4
- name: Enable -Werror for EMU Build
run: |
echo "CXX_NO_WARNING=1" >> $GITHUB_ENV
- name: Prepare NutShell
run: |
cd $GITHUB_WORKSPACE/..
git clone -b dev-difftest --single-branch https://github.com/OSCPU/NutShell.git
cd NutShell && rm -rf difftest && cp -r $GITHUB_WORKSPACE .
echo "NOOP_HOME=$(pwd)" >> $GITHUB_ENV
echo "WORKLOAD=$(pwd)/ready-to-run/microbench.bin" >> $GITHUB_ENV
echo "REF_SO=$(pwd)/ready-to-run/riscv64-nemu-interpreter-so" >> $GITHUB_ENV
- name: Simulation without DiffTest
run: |
cd $NOOP_HOME
make emu NO_DIFF=1 EMU_TRACE=1 -j2
./build/emu -i $WORKLOAD --dump-wave -C 10000
./build/emu -i $WORKLOAD --dump-wave-full -C 10000
make clean
- name: Simulation with No Diff
run: |
cd $NOOP_HOME
make emu -j2
./build/emu -i $WORKLOAD --no-diff
- name: Basic Difftest
run: |
cd $NOOP_HOME
./build/emu -i $WORKLOAD --diff $REF_SO
- name: Basic Difftest without Image
run: |
cd $NOOP_HOME
./build/emu --no-diff -C 10000
make clean
- name: Basic Difftest with PGO build using compiler instrumentation
run: |
cd $NOOP_HOME
make emu PGO_WORKLOAD=$WORKLOAD LLVM_PROFDATA=llvm-profdata PGO_EMU_ARGS="--diff $REF_SO 2>/dev/null" PGO_BOLT=0 -j2
./build/emu -i $WORKLOAD --diff $REF_SO
make clean
- name: Basic Difftest with PGO build using BOLT
run: |
cd $NOOP_HOME
make emu PGO_WORKLOAD=$WORKLOAD PGO_EMU_ARGS="--diff $REF_SO 2>/dev/null" PGO_BOLT=1 -j2
./build/emu -i $WORKLOAD --diff $REF_SO
make clean
- name: Difftest with Snapshot
run: |
cd $NOOP_HOME
make emu EMU_SNAPSHOT=1 -j2
./build/emu -i $WORKLOAD --diff $REF_SO
make clean
- name: Difftest with Trace
run: |
cd $NOOP_HOME
make emu EMU_TRACE=1 -j2
./build/emu -b 10 -e 12 -i $WORKLOAD --dump-wave --diff $REF_SO
./build/emu -e 12 -i $WORKLOAD --dump-wave-full --diff $REF_SO
make clean
- name: Difftest with two threads
run: |
cd $NOOP_HOME
make emu EMU_THREADS=2 -j2
./build/emu -i $WORKLOAD --diff $REF_SO
make clean
- name: Difftest with Verilator Coverage
run: |
cd $NOOP_HOME
rm -rf *.coverage
make emu EMU_COVERAGE=1 -j2
./build/emu -i $WORKLOAD --diff $REF_SO -C 10000 --dump-coverage
make -C difftest coverage
ls -lh *.coverage
make clean
- name: Difftest with DiffTrace
run: |
cd $NOOP_HOME
make emu -j2
./build/emu -i $WORKLOAD --diff $REF_SO --dump-difftrace microbench
./build/emu -i $WORKLOAD --diff $REF_SO --load-difftrace microbench
make clean
- name: Difftest with Footprints
run: |
cd $NOOP_HOME
make emu -j2
./build/emu -i $WORKLOAD --diff $REF_SO --dump-footprints microbench.bin
./build/emu -i microbench.bin --diff $REF_SO --as-footprints
make clean
- name: Difftest with Batch
run: |
cd $NOOP_HOME
make emu MILL_ARGS="--difftest-config B" -j2
./build/emu -i $WORKLOAD --diff $REF_SO
make clean
- name: Difftest with Global DPI-C Enable
run: |
cd $NOOP_HOME
make emu MILL_ARGS="--difftest-config E" -j2
./build/emu -i $WORKLOAD --diff $REF_SO
make clean
- name: Difftest with Squash and Global Enable
run: |
cd $NOOP_HOME
make emu MILL_ARGS="--difftest-config ES" -j2
./build/emu -i $WORKLOAD --diff $REF_SO
make clean
- name: Difftest with Squash Batch and Global Enable
run: |
cd $NOOP_HOME
make emu MILL_ARGS="--difftest-config ESB" -j2
./build/emu -i $WORKLOAD --diff $REF_SO
make clean
- name: Difftest with Squash Batch GlobalEnable and Query
run: |
cd $NOOP_HOME
make emu MILL_ARGS="--difftest-config ESB" DIFFTEST_QUERY=1 -j2
./build/emu -i $WORKLOAD --diff $REF_SO
make clean
- name: Difftest with JsonProfile and DiffTestIOTrace
run: |
cd $NOOP_HOME
make emu MILL_ARGS="--difftest-config ET" -j2
./build/emu -i $WORKLOAD --diff $REF_SO --iotrace-name iotrace
cd difftest && export NOOP_HOME=$(pwd)
make difftest_verilog PROFILE=../build/generated-src/difftest_profile.json CONFIG=EL
make emu WITH_CHISELDB=0 WITH_CONSTANTIN=0 -j2
./build/emu -i $WORKLOAD --diff $REF_SO --iotrace-name ../iotrace
make clean && make -C .. clean
- name: Difftest with JsonProfile and DiffTestIOTrace-ZSTD
run: |
cd $NOOP_HOME
make emu MILL_ARGS="--difftest-config ET" IOTRACE_ZSTD=1 -j2
./build/emu -i $WORKLOAD --diff $REF_SO --iotrace-name iotrace
cd difftest && export NOOP_HOME=$(pwd)
make difftest_verilog PROFILE=../build/generated-src/difftest_profile.json CONFIG=EL
make emu WITH_CHISELDB=0 WITH_CONSTANTIN=0 IOTRACE_ZSTD=1 -j2
./build/emu -i $WORKLOAD --diff $REF_SO --iotrace-name ../iotrace
make clean && make -C .. clean
test-vcs-top-nutshell:
runs-on: ubuntu-latest
container: ghcr.io/openxiangshan/xs-env:ubuntu-24.04
needs: test-difftest-main
steps:
- uses: actions/checkout@v4
- name: Enable -Werror for EMU Build
run: |
echo "CXX_NO_WARNING=1" >> $GITHUB_ENV
- name: Prepare NutShell
run: |
cd $GITHUB_WORKSPACE/..
git clone -b dev-difftest --single-branch https://github.com/OSCPU/NutShell.git
cd NutShell && rm -rf difftest && cp -r $GITHUB_WORKSPACE .
echo "NOOP_HOME=$(pwd)" >> $GITHUB_ENV
echo "WORKLOAD=$(pwd)/ready-to-run/microbench.bin" >> $GITHUB_ENV
echo "REF_SO=$(pwd)/ready-to-run/riscv64-nemu-interpreter-so" >> $GITHUB_ENV
- name: Verilator Build with VCS Top (NO_DIFF)
run: |
cd $NOOP_HOME
make simv NO_DIFF=1 VCS=verilator -j2
./build/simv +workload=$WORKLOAD +max-cycles=100000
make clean
- name: Verilator Build with VCS Top (PGO using compiler instrumentation)
run: |
cd $NOOP_HOME
make simv VCS=verilator PGO_WORKLOAD=$WORKLOAD LLVM_PROFDATA=llvm-profdata VCS_PGO_ARGS="+diff=$REF_SO 2>/dev/null" PGO_BOLT=0 -j2
./build/simv +workload=$WORKLOAD +diff=$REF_SO
make clean
- name: Verilator Build with VCS Top (PGO using BOLT)
run: |
cd $NOOP_HOME
make simv VCS=verilator PGO_WORKLOAD=$WORKLOAD VCS_PGO_ARGS="+diff=$REF_SO 2>/dev/null" PGO_BOLT=1 -j2
./build/simv +workload=$WORKLOAD +diff=$REF_SO
make clean
- name: Verilator Build with VCS Top (TraceFst)
run: |
cd $NOOP_HOME
make simv VCS=verilator EMU_TRACE=fst -j2
./build/simv +workload=$WORKLOAD +diff=$REF_SO +dump-wave
make clean
- name: Verilator Build with VCS Top (2 THREADS)
run: |
cd $NOOP_HOME
make simv VCS=verilator EMU_THREADS=2 -j2
./build/simv +workload=$WORKLOAD +diff=$REF_SO
make clean
- name: Verilator Build with VCS Top (SYNTHESIS)(with DutZone)
run: |
cd $NOOP_HOME
make simv MILL_ARGS="--difftest-config Z" SYNTHESIS=1 VCS=verilator -j2
./build/simv +workload=$WORKLOAD +no-diff +max-cycles=100000
make clean
- name: Verilator Build with VCS Top (disable DPIC RAM/FLASH)(with DutZone)
run: |
cd $NOOP_HOME
make simv MILL_ARGS="--difftest-config Z" DISABLE_DIFFTEST_RAM_DPIC=1 DISABLE_DIFFTEST_FLASH_DPIC=1 VCS=verilator -j2
./build/simv +workload=$WORKLOAD +no-diff +max-cycles=100000
./build/simv +workload=$WORKLOAD +diff=$REF_SO
make clean
- name: Verilator Build with VCS Top (with DutZone PerfCnt Query)
run: |
cd $NOOP_HOME
make simv MILL_ARGS="--difftest-config ZP" DIFFTEST_PERFCNT=1 DIFFTEST_QUERY=1 VCS=verilator -j2
./build/simv +workload=$WORKLOAD +no-diff +max-cycles=100000
./build/simv +workload=$WORKLOAD +diff=$REF_SO
make clean
- name: Verilator Build with VCS Top (with Batch InternalStep PerfCnt)
run: |
cd $NOOP_HOME
make simv MILL_ARGS="--difftest-config BIP" DIFFTEST_PERFCNT=1 VCS=verilator -j2
./build/simv +workload=$WORKLOAD +no-diff +max-cycles=100000
./build/simv +workload=$WORKLOAD +diff=$REF_SO
make clean
- name: Verilator Build with VCS Top (with Batch InternalStep Squash Delta PerfCnt)
run: |
cd $NOOP_HOME
make simv MILL_ARGS="--difftest-config BISDP" DIFFTEST_PERFCNT=1 VCS=verilator -j2
./build/simv +workload=$WORKLOAD +no-diff +max-cycles=100000
./build/simv +workload=$WORKLOAD +diff=$REF_SO
make clean
- name: Verilator Build with VCS Top (with GlobalEnable Squash Replay Batch PerfCnt)
run: |
cd $NOOP_HOME
make simv MILL_ARGS="--difftest-config ESRBP" DIFFTEST_PERFCNT=1 VCS=verilator -j2
./build/simv +workload=$WORKLOAD +no-diff +max-cycles=100000
./build/simv +workload=$WORKLOAD +diff=$REF_SO
make clean
- name: Verilator Build with VCS Top (with GlobalEnable Squash Replay Batch InternalStep NonBlock PerfCnt Query)
run: |
cd $NOOP_HOME
make simv MILL_ARGS="--difftest-config ESRBINP" DIFFTEST_PERFCNT=1 DIFFTEST_QUERY=1 VCS=verilator -j2
./build/simv +workload=$WORKLOAD +no-diff +max-cycles=100000
./build/simv +workload=$WORKLOAD +diff=$REF_SO
make clean
- name: Verilator Build with VCS Top (with SoftArchUpdate GlobalEnable Squash Replay Batch InternalStep Delta NonBlock PerfCnt Query)
run: |
cd $NOOP_HOME
make simv MILL_ARGS="--difftest-config UESRBIDNP" DIFFTEST_PERFCNT=1 DIFFTEST_QUERY=1 VCS=verilator -j2
./build/simv +workload=$WORKLOAD +no-diff +max-cycles=100000
./build/simv +workload=$WORKLOAD +diff=$REF_SO
make clean
- name: Verilator Build with VCS Top (with workload-list)
run : |
cd $NOOP_HOME
echo "./ready-to-run/microbench.bin 10000" > list.txt
echo "./ready-to-run/linux.bin 20000" >> list.txt
make simv VCS=verilator WORKLOAD_SWITCH=1 -j2
./build/simv +diff=$REF_SO +workload-list=./list.txt
make clean
- name: Verilator Build with VCS Top (with JsonProfile and DiffTestIOTrace)
run : |
cd $NOOP_HOME
make simv MILL_ARGS="--difftest-config ZET" VCS=verilator -j2
./build/simv +workload=$WORKLOAD +diff=$REF_SO +iotrace-name=iotrace
cd difftest && export NOOP_HOME=$(pwd)
make difftest_verilog PROFILE=../build/generated-src/difftest_profile.json CONFIG=ZEL
make simv VCS=verilator WITH_CHISELDB=0 WITH_CONSTANTIN=0
./build/simv +workload=$WORKLOAD +diff=$REF_SO +iotrace-name=../iotrace
make clean && make -C .. clean
- name: Verilator Build with VCS Top (with JsonProfile and DiffTestIOTrace-ZSTD)
run : |
cd $NOOP_HOME
make simv MILL_ARGS="--difftest-config ZET" VCS=verilator IOTRACE_ZSTD=1 -j2
./build/simv +workload=$WORKLOAD +diff=$REF_SO +iotrace-name=iotrace
cd difftest && export NOOP_HOME=$(pwd)
make difftest_verilog PROFILE=../build/generated-src/difftest_profile.json CONFIG=ZEL
make simv VCS=verilator WITH_CHISELDB=0 WITH_CONSTANTIN=0 IOTRACE_ZSTD=1
./build/simv +workload=$WORKLOAD +diff=$REF_SO +iotrace-name=../iotrace
make clean && make -C .. clean
- name: Verilator Build with VCS Top (with LogPerf and WarmUp)
run : |
cd $NOOP_HOME
make simv VCS=verilator -j2
./build/simv +workload=$WORKLOAD +b=0 +e=-1 +diff=$REF_SO +max-instrs=5000 +warmup_instr=1000
make clean
test-fpga-nutshell:
runs-on: ubuntu-latest
container: ghcr.io/openxiangshan/xs-env:ubuntu-24.04
needs: test-difftest-main
steps:
- uses: actions/checkout@v4
- name: Prepare NutShell
run: |
cd $GITHUB_WORKSPACE/..
git clone -b dev-difftest --single-branch https://github.com/OSCPU/NutShell.git
cd NutShell && rm -rf difftest && cp -r $GITHUB_WORKSPACE .
echo "NOOP_HOME=$(pwd)" >> $GITHUB_ENV
- name: FPGA-difftest Build (no THREAD, no ASYNC_CLK)
run: |
cd $NOOP_HOME
make sim-verilog MILL_ARGS="--difftest-config ESBIDUF" -j2
make -C difftest fpga-build FPGA=1 FPGA_SIM=1 DIFFTEST_PERFCNT=1
make simv VCS=verilator WITH_CHISELDB=0 WITH_CONSTANTIN=0 FPGA_SIM=1
bash difftest/scripts/fpga_sim/cosim.sh WORKLOAD=./ready-to-run/microbench.bin DIFF=./ready-to-run/riscv64-nemu-interpreter-so
make -C difftest fpga-clean vcs-clean
- name: FPGA-difftest Build (with THREAD and ASYNC_CLK)
run: |
cd $NOOP_HOME
make sim-verilog MILL_ARGS="--difftest-config ESBIDUF" -j2
make -C difftest fpga-build FPGA=1 FPGA_SIM=1 USE_THREAD_MEMPOOL=1 DIFFTEST_PERFCNT=1
make simv VCS=verilator WITH_CHISELDB=0 WITH_CONSTANTIN=0 FPGA_SIM=1 ASYNC_CLK_2N=1
bash difftest/scripts/fpga_sim/cosim.sh WORKLOAD=./ready-to-run/microbench.bin DIFF=./ready-to-run/riscv64-nemu-interpreter-so
make -C difftest fpga-clean vcs-clean
- name: FPGA-difftest Release
run: |
cd $NOOP_HOME
make verilog BOARD=fpgadiff MILL_ARGS="--difftest-config ESBIDUF" -j2
make -C difftest fpga-release
test-gsim-rocketchip:
runs-on: ubuntu-latest
container: ghcr.io/openxiangshan/xs-env:ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Download latest released GSIM
run: |
# GSIM depends on GMP and clang >= 19
sudo apt update
sudo apt install -y libgmp-dev clang-19
cd $GITHUB_WORKSPACE/..
mkdir -p gsim-bin && cd gsim-bin
curl -s https://api.github.com/repos/OpenXiangShan/gsim/releases/latest \
| grep "browser_download_url" \
| grep "gsim" \
| cut -d '"' -f 4 \
| xargs wget -O gsim
chmod +x gsim
echo "GSIM_BIN=$(pwd)/gsim" >> $GITHUB_ENV
- name: Build the REF - Spike
run: |
cd $GITHUB_WORKSPACE/..
git clone https://github.com/OpenXiangShan/riscv-isa-sim.git
echo "SPIKE_HOME=$(pwd)/riscv-isa-sim" >> $GITHUB_ENV
make -C riscv-isa-sim/difftest CPU=ROCKET_CHIP -j2
- name: Prepare Rocket Chip
run: |
cd $GITHUB_WORKSPACE/..
git clone -b dev-difftest --single-branch https://github.com/OpenXiangShan/rocket-chip.git
cd rocket-chip && make init && rm -r difftest
cp -r $GITHUB_WORKSPACE .
make bootrom CROSS=riscv64-linux-gnu-
echo "NOOP_HOME=$(pwd)" >> $GITHUB_ENV
- name: Build and run EMU with GSIM
run: |
cd $NOOP_HOME
make emu REF=Spike GSIM=1 GSIM_CXX=clang++-19 -j2
./build/emu -i ./bootrom/bootrom.img -C 1000000