forked from chipsalliance/VeeR-ISS
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.gitlab-ci.yml
163 lines (143 loc) · 5.51 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
# Documentation for the format of this file can be found at https://docs.gitlab.com/ce/ci/yaml/README.html
image:
name: $CI_REGISTRY/$CI_PROJECT_NAMESPACE/risc-p-cores/risc-p-cores/dev:4b2e2f9e0f6f3afcb368b6d587e1ca5068e017e11bbe4885618640fd6f6c1bc6
entrypoint: [""]
# Global variables
variables:
GIT_DEPTH: 1 # Shallow clone to only one depth for speed up
GIT_SUBMODULE_STRATEGY: recursive # See https://docs.gitlab.com/ce/ci/git_submodules.html
SILENT: 0 # Causes make to print all commands it executes
# Commonly used YAML (anchors)
.define-anchors:
# refs:
- &BRANCH_IS_MASTER /^master$/
- &BRANCH_IS_BLACKHOLE /^black-hole.*$/
.notify-template: ¬ify-template
stage: notify
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
variables:
UPDATE_REPO_POINTER: "True"
SHA_UPDATE_REPO: "whisper"
SHA_UPDATE_POINTER: $CI_COMMIT_SHA
GIT_STRATEGY: none
SKIP_BUILD: "True"
ANCESTRY: $ANCESTRY
ANCESTOR_COMMITS: $CI_COMMIT_TITLE # this is the previous HEAD, not the current branch? # why doesn't this need quotes
stages:
- build
- test
- upload
- notify
build-job:
stage: build
script:
- CC=clang CXX=clang++ make SOFT_FLOAT=1 STATIC_LINK=0 LZ4_COMPRESS=1 -j32
artifacts:
paths:
- build-Linux/whisper
expire_in: 8 hours
riscof-job:
stage: test
dependencies:
- "build-job"
script:
- mkdir testing/riscof
- cd testing/riscof
# Install riscof
- python3 -m venv virtualenv
- source virtualenv/bin/activate
- pip3 install riscof
- riscof arch-test --clone
- riscof setup --dutname whisper --refname spike
- rm -rf ./whisper
# Update riscof's config.ini file to point to the arch_test_target folder
- sed -i 's/testing\/riscof\/whisper/arch_test_target/g' config.ini
# Configure 8 parallel jobs when running whisper and spike
- sed -i '/target_run=1/a jobs=8' config.ini
- sed -i '/pluginpath=.*spike/a jobs=8' config.ini
# Disable runing objdump before when running spike
- sed -i -E 's/(\s+)(.*ref.disass.*)/\1# \2/g' spike/riscof_spike.py
# Add --misaligned flag, enable generating signature file, and set target file name when running spike
- sed -i -E "s/(execute \+= self.ref_exe \+).*/\1 ' --isa={2} --misaligned +signature={0} +signature-granularity=4 {1}'.format(sig_file, elf, self.isa)/g" spike/riscof_spike.py
# Get the isa population code from whisper's plugin and use it in spike's plugin
- sed -n -Ee '/self.isa =/,/self.compile_cmd =/ { s/( {4,})/ \1/g ; p }' ../../arch_test_target/riscof_whisper.py > isa_py.txt
- sed -i -e '/self.isa =/,/^$/ {' -e '/self.isa =/r isa_py.txt' -e 'd }' spike/riscof_spike.py
# Up the timeout time
- sed -i 's/make.execute_all(self.work_dir)/make.execute_all(self.work_dir, timeout=900)/' spike/riscof_spike.py
# Clone and build spike
- git clone https://github.com/riscv-software-src/riscv-isa-sim
- mkdir riscv-isa-sim/build
- cd riscv-isa-sim/build
- ../configure
- make -s -j32
- cd ../..
# Run riscof
- PATH=$PATH:$PWD/riscv-isa-sim/build:$PWD/../../build-Linux riscof --verbose debug run --suite riscv-arch-test/riscv-test-suite --env riscv-arch-test/riscv-test-suite/env --no-browser
timeout: 6 hours
linux-boot-job:
stage: test
dependencies:
- "build-job"
script:
# - DEBIAN_FRONTEND=noninteractive apt --yes install zip curl xz-utils
- curl --location --output opensbi.zip --location "https://yyz-gitlab.local.tenstorrent.com/api/v4/projects/415/jobs/artifacts/tt-master/download?job=build_payload_zebu_linux_hello_world:%20\[8\]"
- unzip opensbi.zip
- build-Linux/whisper --tohost 0x70000008 --fromhost 0x70000000 --configfile whisper.json --memorysize 0xc0000000 fw_payload-8c.elf --hart 8 --quitany 2>&1 | tee output.log
- grep -q "Halt and catch fire!" output.log
timeout: 2 hours
kvm-boot-job:
stage: test
dependencies:
- "build-job"
script:
- curl --location --output opensbi.zip --location "https://yyz-gitlab.local.tenstorrent.com/api/v4/projects/415/jobs/artifacts/tt-master/download?job=build_payload_zebu_kvm_linux_hello_world:%20\[2\]"
- unzip opensbi.zip
- build-Linux/whisper --tohost 0x70000008 --fromhost 0x70000000 --configfile whisper.json --memorysize 0xc0000000 fw_payload-2c.elf --hart 2 --quitany 2>&1 | tee output.log
- grep -q "Halt and catch fire!" output.log
timeout: 2 hours
notify_riscv_cluster:
stage: notify
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
variables:
UPDATE_REPO_POINTER: "True"
SHA_UPDATE_REPO: "whisper"
SHA_UPDATE_POINTER: $CI_COMMIT_SHA
GIT_STRATEGY: none
SKIP_BUILD: "True"
ANCESTRY: $ANCESTRY
ANCESTOR_COMMITS: $CI_COMMIT_TITLE # this is the previous HEAD, not the current branch? # why doesn't this need quotes
UPDATE_DIRECTORY: risc-p-cores
trigger:
project: riscv/riscv_cluster
notify-riescue:
<<: *notify-template
trigger:
project: riscv/riescue
# notify-archcov:
# <<: *notify-template
# trigger:
# project: riscv/dv/corearchcoverage
# notify-rv-tester:
# <<: *notify-template
# trigger:
# project: riscv/dv/rv_tester
upload-release:
stage: upload
dependencies:
- "build-job"
script:
- bash upload/upload.sh
only:
- tags
.post-commit-test: # Maybe re-enable this at some point in the future
stage: test
allow_failure: false
script:
- cd testing && source init_venv.sh && ralph trace -t configs.py --clean
artifacts: &TEST_ARTIFACTS
when: always
expire_in: 8 hours
paths:
- "test_output/*/*"