-
Notifications
You must be signed in to change notification settings - Fork 97
/
.gitlab-ci.yml
173 lines (151 loc) · 5.33 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
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
variables:
GIT_SUBMODULE_STRATEGY: recursive
VIVADO_PATH: "/opt/Xilinx/Vivado/2018.3/bin/vivado"
PROJECT_DIR: "vivado"
PROJECT_NAME: "NonTrivialMIPS"
TOP_MODULE_NAME: "nscscc_soc_top"
# 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/sources_1/bd/bd_soc/ip
- ${PROJECT_DIR}/${PROJECT_NAME}.sim
- ${PROJECT_DIR}/${PROJECT_NAME}.runs
- ${PROJECT_DIR}/${PROJECT_NAME}.cache
- loongson/**/rtl/xilinx_ip
- loongson/**/run_vivado/mycpu_prj1/mycpu.sim
- loongson/**/run_vivado/mycpu_prj1/mycpu.runs
- loongson/**/run_vivado/mycpu_prj1/mycpu.cache
stages:
- cpu_test
- init_loongson_projects
- loongson_tests
- bitstreams
before_script:
- git checkout ${PROJECT_DIR}/${PROJECT_NAME}.srcs/sources_1/bd/bd_soc/ip
- git checkout loongson/soc_axi_func/rtl/xilinx_ip
- git checkout loongson/soc_axi_perf/rtl/xilinx_ip
build_ip_loongson_func:
image: vivado:2018.3
tags:
- vivado
stage: init_loongson_projects
only:
variables:
- $CI_COMMIT_MESSAGE =~ /\[func/i
script:
- ${VIVADO_PATH} -mode tcl -source scripts/generate_all_ips.tcl loongson/soc_axi_func/run_vivado/mycpu_prj1/mycpu.xpr
build_ip_loongson_perf:
image: vivado:2018.3
tags:
- vivado
stage: init_loongson_projects
only:
variables:
- $CI_COMMIT_MESSAGE =~ /\[perf/i
script:
- ${VIVADO_PATH} -mode tcl -source scripts/generate_all_ips.tcl loongson/soc_axi_perf/run_vivado/mycpu_prj1/mycpu.xpr
cpu_simulation:
image: vivado:2018.3
tags:
- vivado
stage: cpu_test
script:
- export SIMULATION=cpu_test
- export LOG_PATH=${PROJECT_DIR}/${PROJECT_NAME}.sim/${SIMULATION}/behav/xsim/simulate.log
- export FLAG='Done'
- ${VIVADO_PATH} -mode tcl -source scripts/run_simulation.tcl ${PROJECT_DIR}/${PROJECT_NAME}.xpr
- bash scripts/check_simulation.sh
artifacts:
paths:
- ${PROJECT_DIR}/${PROJECT_NAME}.sim/*/behav/xsim/simulate.log
when: always
func_test_simulation:
image: vivado:2018.3
tags:
- vivado
stage: loongson_tests
# run functional test only when specified, for it is too slow
only:
variables:
- $CI_COMMIT_MESSAGE =~ /\[func test\]/i
script:
- sed -i "s/\`define COMPILE_FULL_M/\\/\\/ \`define COMPILE_FULL_M/" src/compile_options.svh
- export SIMULATION=sim_1
- export LOG_PATH=loongson/soc_axi_func/run_vivado/mycpu_prj1/mycpu.sim/${SIMULATION}/behav/xsim/simulate.log
- export FLAG='\-\-\-\-PASS!!!'
- ${VIVADO_PATH} -mode tcl -source scripts/run_simulation.tcl loongson/soc_axi_func/run_vivado/mycpu_prj1/mycpu.xpr
- bash scripts/check_simulation.sh
artifacts:
paths:
- loongson/soc_axi_func/run_vivado/mycpu_prj1/mycpu.sim/*/behav/xsim/simulate.log
when: always
perf_test_simulation:
image: vivado:2018.3
tags:
- vivado
stage: loongson_tests
# run performance test only when specified, for it is also slow
# the result of performance test will not be checked
only:
variables:
- $CI_COMMIT_MESSAGE =~ /\[perf test\]/i
script:
- sed -i "s/\`define COMPILE_FULL_M/\\/\\/ \`define COMPILE_FULL_M/" src/compile_options.svh
- export SIMULATION=sim_1
- export LOG_PATH=loongson/soc_axi_perf/run_vivado/mycpu_prj1/mycpu.sim/${SIMULATION}/behav/xsim/simulate.log
- export FLAG='All tests done!'
- ${VIVADO_PATH} -mode tcl -source scripts/run_perf_simulations.tcl loongson/soc_axi_perf/run_vivado/mycpu_prj1/mycpu.xpr
artifacts:
paths:
- loongson/soc_axi_perf/run_vivado/mycpu_prj1/mycpu.sim/*/behav/xsim/simulate.log
when: always
func_test_bitstream:
image: vivado:2018.3
tags:
- vivado
stage: bitstreams
only:
variables:
- $CI_COMMIT_MESSAGE =~ /\[func bitstream\]/i
script:
- sed -i "s/\`define COMPILE_FULL_M/\\/\\/ \`define COMPILE_FULL_M/" src/compile_options.svh
- ${VIVADO_PATH} -mode tcl -source scripts/generate_bitstream.tcl loongson/soc_axi_func/run_vivado/mycpu_prj1/mycpu.xpr
artifacts:
paths:
- loongson/soc_axi_func/run_vivado/mycpu_prj1/mycpu.runs/impl_1/soc_axi_lite_top.bit
- loongson/soc_axi_func/run_vivado/mycpu_prj1/mycpu.runs/*/runme.log
when: always
perf_test_bitstream:
image: vivado:2018.3
tags:
- vivado
stage: bitstreams
only:
variables:
- $CI_COMMIT_MESSAGE =~ /\[perf bitstream\]/i
script:
- sed -i "s/\`define COMPILE_FULL_M/\\/\\/ \`define COMPILE_FULL_M/" src/compile_options.svh
- ${VIVADO_PATH} -mode tcl -source scripts/generate_bitstream.tcl loongson/soc_axi_perf/run_vivado/mycpu_prj1/mycpu.xpr
artifacts:
paths:
- loongson/soc_axi_perf/run_vivado/mycpu_prj1/mycpu.runs/impl_1/soc_axi_lite_top.bit
- loongson/soc_axi_perf/run_vivado/mycpu_prj1/mycpu.runs/*/runme.log
when: always
soc_bitstream:
image: vivado:2018.3
tags:
- vivado
stage: bitstreams
only:
variables:
- $CI_COMMIT_MESSAGE =~ /\[soc bitstream\]/i
script:
- ${VIVADO_PATH} -mode tcl -source scripts/build_soc.tcl ${PROJECT_DIR}/${PROJECT_NAME}.xpr
artifacts:
paths:
- ${PROJECT_DIR}/${PROJECT_NAME}.runs/impl_1/*.bit
- ${PROJECT_DIR}/${PROJECT_NAME}.runs/impl_1/*.ltx
- ${PROJECT_DIR}/${PROJECT_NAME}.runs/*/runme.log
when: always