-
Notifications
You must be signed in to change notification settings - Fork 8
227 lines (227 loc) · 7.77 KB
/
build-and-test.yaml
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
name: Build and test
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
yosys_version: ["yosys-0.43", "yosys-0.44", "0.45", "0.46", "0.47", "v0.48"]
steps:
- name: Install Dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential libfmt-dev
sudo apt-get install -y gperf build-essential bison flex libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Initialize submodules
run: |
git submodule init
- name: Cache Yosys build
id: cache-yosys
uses: actions/cache@v4
env:
cache-name: cache-yosys
with:
path: tests/third_party/yosys
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.yosys_version }}
- if: ${{ steps.cache-yosys.outputs.cache-hit != 'true' }}
name: Pull Yosys
run: |
cd tests/third_party/yosys
git clone --depth 0 \
--branch ${{ matrix.yosys_version }} \
-- https://github.com/YosysHQ/yosys.git tests/third_party/yosys
- if: ${{ steps.cache-yosys.outputs.cache-hit != 'true' }}
name: Build Yosys
shell: bash
run: |
cd tests/third_party/yosys
make config-gcc
echo "ENABLE_ABC := 0" >> Makefile.conf
make -j6
- name: Install Yosys
shell: bash
run: |
cd tests/third_party/yosys
sudo make install
- name: Find out Slang revision
run: |
{
echo -n "SLANG_HASH="
git submodule status --cached third_party/slang | awk '{print $1}'
} >> $GITHUB_ENV
- name: Find out Makefile revision
run: |
{
echo -n "MAKEFILE_HASH="
git log -n 1 --pretty=format:%H -- Makefile
} >> $GITHUB_ENV
- name: Cache Slang build
id: cache-slang
uses: actions/cache@v4
env:
cache-name: cache-slang
with:
path: build/slang_install
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.SLANG_HASH }}-${{ env.MAKEFILE_HASH }}
- if: ${{ steps.cache-slang.outputs.cache-hit != 'true' }}
name: Pull Slang
run: |
git submodule update --depth 0 -- third_party/slang
- name: Build yosys-slang
run: |
make -j$(nproc)
- name: Pack build
shell: bash
run: |
tar -cvf build.tar build/slang.so tests/third_party/yosys/
- name: Store build artifact
uses: actions/upload-artifact@v4
with:
name: build.tar
path: build.tar
retention-days: 1
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
needs: [build]
steps:
- name: Install Dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential libfmt-dev
sudo apt-get install -y gperf build-essential bison flex libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Initialize submodules
run: |
git submodule init
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: build.tar
- name: Unpack build
shell: bash
run:
tar -xvf build.tar
- name: Install Yosys
shell: bash
run: |
cd tests/third_party/yosys
sudo make install
- name: Run tests
run: |
tests/run.sh
test-croc-boot:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
needs: [build]
env:
# bender -d . script flist-plus --relative-path > croc.f
# /patch absolute paths in croc.f/
# tar --exclude='.git' --exclude='*/libs.doc/*' -cvf ../croc-checkout-250109-846ce38.tar .
CROC_CHECKOUT: 'croc-checkout-250120-846ce380.tar.gz'
CROC_CHECKOUT_HASH: '6e7b193fe51c3fe3dad00a675c729b9e12d1fc3c72e8d06c580d92fdeba64403 croc-checkout-250120-846ce380.tar.gz'
steps:
- name: Install Dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential libfmt-dev
sudo apt-get install -y gperf build-essential bison flex libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Initialize submodules
run: |
git submodule init
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: build.tar
- name: Unpack build
shell: bash
run:
tar -xvf build.tar
- name: Install Yosys
shell: bash
run: |
cd tests/third_party/yosys
sudo make install
- name: Cache Croc checkout
id: cache-croc
uses: actions/cache@v4
env:
cache-name: cache-croc
with:
path: tests/third_party/croc
key: ${{ env.CROC_CHECKOUT }}
- if: ${{ steps.cache-yosys.outputs.cache-hit != 'true' }}
name: Unpack Croc
run: |
wget https://cutebit.org/$CROC_CHECKOUT
echo "$CROC_CHECKOUT_HASH" | sha256sum --check
tar -xvf $CROC_CHECKOUT -C tests/third_party/croc/
- name: Install OpenOCD
run: |
wget https://github.com/xpack-dev-tools/openocd-xpack/releases/download/v0.12.0-4/xpack-openocd-0.12.0-4-linux-x64.tar.gz
sudo tar xvf xpack-openocd-0.12.0-4-linux-x64.tar.gz -C /opt
echo "/opt/xpack-openocd-0.12.0-4/bin" >> $GITHUB_PATH
- name: Run OpenOCD once
run: |
openocd -v
- name: Run tests
run: |
tests/croc_boot/run.sh
test-compat:
runs-on: ubuntu-24.04
strategy:
matrix:
ip: [black-parrot, bsc-core_tile, cv32e40p, ibex, opentitan, rsd]
fail-fast: false
needs: [build]
steps:
- name: Install Dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential libfmt-dev
sudo apt-get install -y gperf build-essential bison flex libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: build.tar
- name: Unpack build
shell: bash
run:
tar -xvf build.tar
- name: Install Yosys
shell: bash
run: |
cd tests/third_party/yosys
sudo make install
- name: Pull IP sources
run: |
git clone https://github.com/povik/yosys-slang-compat-suite/ compat-suite --depth 1
cd compat-suite
git submodule init ${{ matrix.ip }}
git submodule update --init --recursive --depth 1 ${{ matrix.ip }}
- if: ${{ matrix.ip == 'opentitan' }}
run: |
sudo apt-get install libxml2-dev libxslt-dev
pip3 install --user -r compat-suite/opentitan/python-requirements.txt --require-hashes
- name: Run script
run: |
cd compat-suite
yosys -m ../build/slang.so ${{ matrix.ip }}.tcl