-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
executable file
·165 lines (143 loc) · 5.38 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
variables:
GIT_SUBMODULE_STRATEGY: recursive
VIVADO_PATH: "/home/incolore/Xilinx/Vivado/2019.2/bin/vivado"
PROJECT_DIR: "vivado/cpu"
PROJECT_NAME: "cpu"
TOP_MODULE_NAME: "openmips_min_sopc_tb"
# 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:
# 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:
# 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:
tags:
- vivado
stage: cpu_test
script:
- export SIMULATION=sim_1
- 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:
# 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:
# 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:
# 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:
# 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:
# 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