-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
151 lines (132 loc) · 3.3 KB
/
.gitlab-ci.yml
File metadata and controls
151 lines (132 loc) · 3.3 KB
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
# Copyright 2025 ETH Zurich and University of Bologna.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
include:
- local: .gitlab/common.yml
- local: .gitlab/sw-tests.yml
default:
interruptible: true
stages:
- init
- build
- run
# Sources the environment variables for the IIS environment
.init-env:
before_script:
# Hard link cached python packages since the UV cache directory
# is configured to be on the same filesystem as the build directory in the CI.
- export UV_CACHE_DIR=$CI_BUILDS_DIR/../cache/uv
- export UV_LINK_MODE=hardlink
- source iis-env.sh
##################
# Initialization #
##################
init-deps:
stage: init
extends:
- .init-env
- .init-deps-tpl
artifacts:
paths:
- pd/ci.yml
########################################
# Generate RTL Sources and Addressmaps #
########################################
generate-rtl:
stage: build
extends:
- .generate-rtl-tpl
########################
# Build Software Tests #
########################
sn-sw:
stage: build
extends:
- .sn-sw-tpl
chs-sw:
stage: build
extends:
- .chs-sw-tpl
#####################
# Build Simulations #
#####################
vsim-compile:
stage: build
extends:
- .cache-deps
- .init-env
needs:
- generate-rtl
extends:
- .init-env
script:
- make vsim-compile | tee compile.log 2>&1
- '! grep "\*\* Error" compile.log'
artifacts:
paths:
- target/sim/vsim/work
expire_in: 1 day
###################
# Run simulations #
###################
sim-vsim:
stage: run
extends:
- .cache-deps
- .init-env
- .sw-tests
variables:
LOG_FILE: target/sim/vsim/transcript
needs:
- chs-sw
- sn-sw
- vsim-compile
script:
# Run the simulation
- make vsim-run-batch-verify
# Check either success or failure for non-zero exit codes
- 'if [ -z "${NZ_EXIT_CODE}" ]; then grep "] SUCCESS" transcript || (exit 1); else grep "] FAILED: return code ${NZ_EXIT_CODE}" transcript || (exit 1); fi'
# Check for UART output
- 'if [ ! -z "${USTR}" ]; then (grep " \[UART\] ${USTR}" transcript); fi'
# Check for any fatal errors
- 'if grep "Fatal:" transcript; then exit 1; fi'
# Check for any non-fatal errors. One and only one error is expected with a non-zero exit code.
# Ignore all errors when using a separate verification script.
- 'if [ -z "${VERIFY_PY}" ]; then if [ ! -z "${NZ_EXIT_CODE}" ]; then count=$(grep -c "Error:" transcript); if [ "$count" -ne 1 ]; then exit 1; fi; else if grep -q "Error:" transcript; then exit 1; fi; fi; fi'
artifacts:
paths:
- transcript
#####################
# Run Experiments #
#####################
sim-exps:
stage: run
extends:
- .cache-deps
- .init-env
needs:
- chs-sw
- sn-sw
- vsim-compile
parallel:
matrix:
- EXPERIMENT: multicast
- EXPERIMENT: reduction
- EXPERIMENT: barrier
script:
- cd experiments/$EXPERIMENT && ./experiments.py --ci --actions sw run -j
artifacts:
expire_in: 7 days
###################
# Physical Design #
###################
subpipe:
stage: build
interruptible: true
needs:
- init-deps
trigger:
include:
- artifact: pd/ci.yml
job: init-deps
strategy: depend