-
Notifications
You must be signed in to change notification settings - Fork 67
327 lines (324 loc) · 10 KB
/
chipdb.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
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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
name: Chipdb builder
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- master
tags:
- '*'
pull_request:
jobs:
gw1n1:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build gw1n-1 chipdb
run: |
docker pull pepijndevos/apicula:1.9.8
docker run -v $(pwd):/usr/src/apicula pepijndevos/apicula:1.9.8 make apycula/GW1N-1.pickle
- name: Archive artifact
uses: actions/upload-artifact@v3
with:
name: gw1n-1-chipdb
path: apycula/GW1N-1.pickle
- name: Archive stage artifact
uses: actions/upload-artifact@v3
with:
name: gw1n-1-stage
path: GW1N-1*
gw1nz1:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build gw1nz-1 chipdb
run: |
docker pull pepijndevos/apicula:1.9.8
docker run -v $(pwd):/usr/src/apicula pepijndevos/apicula:1.9.8 make apycula/GW1NZ-1.pickle
- name: Archive artifact
uses: actions/upload-artifact@v3
with:
name: gw1nz-1-chipdb
path: apycula/GW1NZ-1.pickle
- name: Archive stage artifact
uses: actions/upload-artifact@v3
with:
name: gw1nz-1-stage
path: GW1NZ-1*
gw1n9:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build gw1n-9 chipdb
run: |
docker pull pepijndevos/apicula:1.9.8
docker run -v $(pwd):/usr/src/apicula pepijndevos/apicula:1.9.8 make apycula/GW1N-9.pickle
- name: Archive artifact
uses: actions/upload-artifact@v3
with:
name: gw1n-9-chipdb
path: apycula/GW1N-9.pickle
- name: Archive stage artifact
uses: actions/upload-artifact@v3
with:
name: gw1n-9-stage
path: GW1N-9*
gw1n9c:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build gw1n-9c chipdb
run: |
docker pull pepijndevos/apicula:1.9.8
docker run -v $(pwd):/usr/src/apicula pepijndevos/apicula:1.9.8 make apycula/GW1N-9C.pickle
- name: Archive artifact
uses: actions/upload-artifact@v3
with:
name: gw1n-9c-chipdb
path: apycula/GW1N-9C.pickle
- name: Archive stage artifact
uses: actions/upload-artifact@v3
with:
name: gw1n-9c-stage
path: GW1N-9C*
gw1n4:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build gw1n-4 chipdb
run: |
docker pull pepijndevos/apicula:1.9.8
docker run -v $(pwd):/usr/src/apicula pepijndevos/apicula:1.9.8 make apycula/GW1N-4.pickle
- name: Archive artifact
uses: actions/upload-artifact@v3
with:
name: gw1n-4-chipdb
path: apycula/GW1N-4.pickle
- name: Archive stage artifact
uses: actions/upload-artifact@v3
with:
name: gw1n-4-stage
path: GW1N-4*
gw1ns2:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build gw1ns-2 chipdb
run: |
docker pull pepijndevos/apicula:1.9.8
docker run -v $(pwd):/usr/src/apicula pepijndevos/apicula:1.9.8 make apycula/GW1NS-2.pickle
- name: Archive artifact
uses: actions/upload-artifact@v3
with:
name: gw1ns-2-chipdb
path: apycula/GW1NS-2.pickle
- name: Archive stage artifact
uses: actions/upload-artifact@v3
with:
name: gw1ns-2-stage
path: GW1NS-2*
gw1ns4:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build gw1ns-4 chipdb
run: |
docker pull pepijndevos/apicula:1.9.8
docker run -v $(pwd):/usr/src/apicula pepijndevos/apicula:1.9.8 make apycula/GW1NS-4.pickle
- name: Archive artifact
uses: actions/upload-artifact@v3
with:
name: gw1ns-4-chipdb
path: apycula/GW1NS-4.pickle
- name: Archive stage artifact
uses: actions/upload-artifact@v3
with:
name: gw1ns-4-stage
path: GW1NS-4*
gw2a18:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build gw2a-18 chipdb
run: |
docker pull pepijndevos/apicula:1.9.8
docker run -v $(pwd):/usr/src/apicula pepijndevos/apicula:1.9.8 make apycula/GW2A-18.pickle
- name: Archive artifact
uses: actions/upload-artifact@v3
with:
name: gw2a-18-chipdb
path: apycula/GW2A-18.pickle
- name: Archive stage artifact
uses: actions/upload-artifact@v3
with:
name: gw2a-18-stage
path: GW2A-18*
gw2a18c:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build gw2a-18c chipdb
run: |
docker pull pepijndevos/apicula:1.9.8
docker run -v $(pwd):/usr/src/apicula pepijndevos/apicula:1.9.8 make apycula/GW2A-18C.pickle
- name: Archive artifact
uses: actions/upload-artifact@v3
with:
name: gw2a-18c-chipdb
path: apycula/GW2A-18C.pickle
- name: Archive stage artifact
uses: actions/upload-artifact@v3
with:
name: gw2a-18C-stage
path: GW2A-18C*
pypi:
runs-on: ubuntu-latest
needs: [gw1n1, gw1nz1, gw1n9, gw1n9c, gw1n4, gw1ns2, gw1ns4, gw2a18, gw2a18c]
steps:
- uses: actions/checkout@v3
- name: Download gw1n-1 chipdb
uses: actions/download-artifact@v3
with:
name: gw1n-1-chipdb
path: apycula
- name: Download gw1nz-1 chipdb
uses: actions/download-artifact@v3
with:
name: gw1nz-1-chipdb
path: apycula
- name: Download gw1n-4 chipdb
uses: actions/download-artifact@v3
with:
name: gw1n-4-chipdb
path: apycula
- name: Download gw1n-9 chipdb
uses: actions/download-artifact@v3
with:
name: gw1n-9-chipdb
path: apycula
- name: Download gw1n-9c chipdb
uses: actions/download-artifact@v3
with:
name: gw1n-9c-chipdb
path: apycula
- name: Download gw1ns-2 chipdb
uses: actions/download-artifact@v3
with:
name: gw1ns-2-chipdb
path: apycula
- name: Download gw1ns-4 chipdb
uses: actions/download-artifact@v3
with:
name: gw1ns-4-chipdb
path: apycula
- name: Download gw2a-18 chipdb
uses: actions/download-artifact@v3
with:
name: gw2a-18-chipdb
path: apycula
- name: Download gw2a-18c chipdb
uses: actions/download-artifact@v3
with:
name: gw2a-18c-chipdb
path: apycula
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install and build
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
python setup.py --version
python setup.py sdist bdist_wheel
- name: Archive artifact
uses: actions/upload-artifact@v3
with:
name: python-dist
path: dist
- name: Publish to Pypi
if: startsWith(github.ref, 'refs/tags')
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
twine upload --verbose dist/*
- name: Pack release data
if: startsWith(github.ref, 'refs/heads/master')
run: |
tar cvfz linux-x64-gowin-data.tgz apycula/*.pickle
- name: Upload to oss-cad-suite
uses: ncipollo/release-action@v1
if: hashFiles('linux-x64-gowin-data.tgz') != ''
with:
allowUpdates: True
prerelease: True
omitBody: True
omitBodyDuringUpdate: True
omitNameDuringUpdate: True
tag: 0.0.0.dev
artifacts: "linux-x64-gowin-data.tgz"
token: ${{ secrets.GITHUB_TOKEN }}
example:
runs-on: ubuntu-latest
needs: [pypi]
strategy:
fail-fast: false
matrix:
yosys: [master, yosys-0.31]
nextpnr: [master, nextpnr-0.6]
steps:
- uses: actions/checkout@v3
- name: Download python package
uses: actions/download-artifact@v3
with:
name: python-dist
path: dist
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install and build
run: |
pip install dist/*.whl
# pip install apycula
git clone https://github.com/YosysHQ/yosys.git
git clone https://github.com/YosysHQ/nextpnr.git
sudo apt-get update
sudo apt-get install build-essential clang 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 \
libboost-thread-dev libboost-program-options-dev libboost-iostreams-dev libboost-dev \
libeigen3-dev
cd yosys
git checkout ${{ matrix.yosys }}
make config-gcc
make -j$(nproc)
sudo make install
cd ../nextpnr
git checkout ${{ matrix.nextpnr }}
cmake . -DBUILD_PYTHON=OFF -DARCH="gowin;himbaechel" -DHIMBAECHEL_GOWIN_DEVICES="GW1N-1;GW1NZ-1;GW1N-4;GW1N-9;GW1N-9C;GW1NS-4;GW2A-18;GW2A-18C" -DPython3_EXECUTABLE=/opt/hostedtoolcache/Python/3.9.17/x64/bin/python
make -j$(nproc)
sudo make install
cd ../examples
make -j$(nproc) all
cd himbaechel
make -j$(nproc) -f Makefile.himbaechel all
- name: Archive artifact
uses: actions/upload-artifact@v3
with:
name: examples-${{ matrix.yosys }}-${{ matrix.nextpnr }}
path: examples
- name: Do sanity check
run: |
cd examples
make -j$(nproc) unpacked
for f in *-unpacked.v; do
yosys -p "read_verilog $f; read_verilog -lib +/gowin/cells_sim.v; clean -purge; select -assert-any t:DFF*; select -assert-any t:*BUF;";
done
cd himbaechel
make -j$(nproc) -f Makefile.himbaechel unpacked
for f in *-unpacked.v; do
yosys -p "read_verilog $f; read_verilog -lib +/gowin/cells_sim.v; clean -purge; select -assert-any t:DFF*; select -assert-any t:*BUF;";
done