-
Notifications
You must be signed in to change notification settings - Fork 331
86 lines (73 loc) · 2.78 KB
/
run-tests.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
name: run-tests
on:
push:
pull_request:
jobs:
build-spike:
uses: ./.github/workflows/build-spike.yml
test-pyflow:
strategy:
fail-fast: false
matrix:
test:
- riscv_arithmetic_basic_test
runs-on: ubuntu-latest
needs: [build-spike]
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get -qqy update && sudo apt-get -qqy install gcc-riscv64-linux-gnu device-tree-compiler
- name: Setup python
# python dependencies cannot be properly downloaded with new versions of python
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1
with:
python-version: '3.9'
- name: Install python dependencies
run: python3 -m pip install -r requirements.txt
- name: Setup Cache Metadata
id: cache_metadata
run: |
date=$(date +"%Y_%m_%d")
time=$(date +"%Y%m%d_%H%M%S_%N")
cache_spike_restore_key=cache_spike_
cache_spike_key=${cache_spike_restore_key}d70ea67d_${date}
echo "cache_spike_restore_key=$cache_spike_restore_key" | tee -a "$GITHUB_ENV"
echo "cache_spike_key=$cache_spike_key" | tee -a "$GITHUB_ENV"
- name: Restore Spike cache
id: cache-spike-restore
uses: actions/cache/restore@v3
with:
path: |
/opt/spike
/opt/spike/.cache
key: ${{ env.cache_spike_key }}
restore-keys: ${{ env.cache_spike_restore_key }}
- name: Set variables
run: |
echo "RISCV_GCC=riscv64-linux-gnu-gcc" >> $GITHUB_ENV
echo "RISCV_OBJCOPY=riscv64-linux-gnu-objcopy" >> $GITHUB_ENV
echo "SPIKE_PATH=/opt/spike/bin" >> $GITHUB_ENV
echo "PYTHONPATH=pygen" >> $GITHUB_ENV
- name: Generate Tests
run: |
set -eo pipefail
python3 run.py --simulator pyflow \
--test ${{ matrix.test }} --iss spike \
--start_seed 999 --iterations 1 --batch_size 1 \
--isa rv32imc --mabi ilp32 --steps gen -v -o test 2>&1 | tee test/generate.log
- name: Patch Tests
run: find test/asm_test -name "*.S" -exec python3 .github/scripts/code_fixup.py -i {} -o {} \;
- name: Run tests
run: |
set -eo pipefail
python3 run.py --simulator pyflow \
--test ${{ matrix.test }} --iss spike --iss_timeout 60 \
--start_seed 999 --iterations 1 --batch_size 1 \
--isa rv32imc --mabi ilp32 --steps gcc_compile,iss_sim -v -o test 2>&1 | tee -a test/generate.log
- name: Upload logs
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
if: always()
with:
path: |
test/asm_test/*.log
test/*.log