-
Notifications
You must be signed in to change notification settings - Fork 33
/
.gitlab-ci.yml
102 lines (88 loc) · 2.56 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
variables:
GIT_SUBMODULE_STRATEGY: recursive
VIVADO_PATH: "/opt/Xilinx/Vivado/2018.1/bin/vivado"
PROJECT_DIR: "vivado"
PROJECT_NAME: "TrivialMIPS"
TOP_MODULE_NAME: "ThinPad"
# all files in ip dir except *.xci are ignored, so the generated result will be cleaned every build
# to avoid generating from scratch every time, the dir should be cached
cache:
key: "$CI_COMMIT_REF_SLUG"
paths:
- ${PROJECT_DIR}/${PROJECT_NAME}.srcs/ip
- ${PROJECT_DIR}/${PROJECT_NAME}.sim
- ${PROJECT_DIR}/${PROJECT_NAME}.runs
- ${PROJECT_DIR}/${PROJECT_NAME}.cache
stages:
- init_project
- run_simulation
- build_project
- build_online_test
- run_online_test
before_script:
- cd ${PROJECT_DIR}
# the cached ip configuration file might be out of date, we should always use the newest one
- git checkout ${PROJECT_NAME}.srcs/ip
build_ip:
image: vivado:2018.1
tags:
- vivado
stage: init_project
script:
- ${VIVADO_PATH} -mode tcl -source scripts/generate_all_ips.tcl ${PROJECT_NAME}.xpr
run_all_testbenches:
image: vivado:2018.1
tags:
- vivado
stage: run_simulation
script:
- export SIMULATION=sim_cpu
- ${VIVADO_PATH} -mode tcl -source scripts/run_simulation.tcl ${PROJECT_NAME}.xpr
- bash scripts/check_simulation.sh
artifacts:
paths:
- ${PROJECT_DIR}/${PROJECT_NAME}.sim/*/behav/xsim/simulate.log
when: always
generate_bitstream:
image: vivado:2018.1
tags:
- vivado
stage: build_project
script:
- ${VIVADO_PATH} -mode tcl -source scripts/build_project.tcl ${PROJECT_NAME}.xpr
artifacts:
paths:
- ${PROJECT_DIR}/${PROJECT_NAME}.runs/impl_1/${TOP_MODULE_NAME}.bit
- ${PROJECT_DIR}/${PROJECT_NAME}.runs/*/runme.log
when: always
.mips_compilation_configuration: &mips_compilation_configuration
image: harryleafchen/ubuntu-mips-compiler
tags:
- mips
stage: build_online_test
script:
- make
compile_func_test:
<<: *mips_compilation_configuration
before_script:
- cd software/func_test
artifacts:
paths:
- software/func_test/main.elf
compile_perf_test:
<<: *mips_compilation_configuration
before_script:
- cd software/perf_test
artifacts:
paths:
- software/perf_test/obj/*/main.elf
run_on_thinpad_cloud:
image: python:3.7.0-stretch
tags:
- mips
stage: run_online_test
before_script:
- cd testbench/cloud
- pip3 install --user -r thinpad_cloud_sdk/requirements.txt
script:
- python3 cloud_test.py "$THINPAD_CLOUD_USER" "$THINPAD_CLOUD_PASSWD" ../../${PROJECT_DIR}/${PROJECT_NAME}.runs/impl_1/${TOP_MODULE_NAME}.bit