-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
114 lines (88 loc) · 2.82 KB
/
.gitlab-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
stages:
- build
- test
- upload
default:
image: mcejp/poly94-buildenv:latest
# Backup, to be used with ubuntu:20.04
# before_script:
# - apt update
# - apt install -y bsdmainutils curl make # bsdmainutils for 'hexdump'
# - curl -sL https://github.com/YosysHQ/oss-cad-suite-build/releases/download/2022-05-20/oss-cad-suite-linux-x64-20220520.tgz | tar xz
# - curl -sL https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases/download/v10.2.0-1.2/xpack-riscv-none-embed-gcc-10.2.0-1.2-linux-x64.tar.gz | tar xz
# - export PATH=`pwd`/oss-cad-suite/bin:`pwd`/xpack-riscv-none-embed-gcc-10.2.0-1.2/bin:$PATH
# - echo $PATH
variables:
GIT_SUBMODULE_STRATEGY: recursive
build_ulx3s:
stage: build
needs: []
script:
- cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain.cmake -DCMAKE_BUILD_TYPE=MinSizeRel -S firmware -B firmware/build
- cmake --build firmware/build --target boot
- make ulx3s.bit
artifacts:
paths:
- build/nextpnr-report.json
- ulx3s.bit
- "*.log"
when: always
test_cocotb:
stage: test
needs: []
script:
- cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain.cmake -DCMAKE_BUILD_TYPE=MinSizeRel -S firmware -B firmware/build
- cmake --build firmware/build --target boot
- make -f Makefile.coco
- "! grep -q '<failure' results.xml"
artifacts:
paths:
- "*.vcd"
- "results.xml"
when: always
reports:
junit: results.xml
test_verilator:
stage: test
needs: []
script:
- cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain.cmake -DCMAKE_BUILD_TYPE=MinSizeRel -S firmware -B firmware/build
- cmake --build firmware/build --target boot_sdram test_framebuffer
- BOOTROM=firmware/build/test_framebuffer.bin DUMP_FRAMEBUF=framebuffer.ppm NUM_CYCLES=4000000 make sim
- if ! cmp -s framebuffer.ppm test_expected/test_framebuffer.ppm; then echo "Output not equal to expectation"; touch verilator.fail; exit 1; fi
- BOOTROM=firmware/build/boot_sdram.bin NUM_CYCLES=3000000 SDRAM_PRELOAD=firmware/prebuilt/test_dhrystone.bin make sim | tee sim.log
- sed -Ez 's/.*Dhrystones per Second:\s*([0-9]+).*/\1/g' sim.log > dhrystones_per_second
- touch verilator.pass
artifacts:
paths:
- dhrystones_per_second
- framebuffer.ppm
- verilator.fail
- verilator.pass
when: always
reports:
stage: upload
needs:
- job: build_ulx3s
artifacts: true
- job: test_cocotb
artifacts: true
- job: test_verilator
artifacts: true
when: always
image: python:3.10
script:
- pip install junitparser "psycopg>=3"
- ./tools/ci/save_build_stats.py
pages:
stage: upload
needs: [reports]
image: python:3.10
script:
- mkdir public
- cd public
- pip install Jinja2 "psycopg>=3"
- ../tools/ci/present_build_stats.py
artifacts:
paths:
- public