-
Notifications
You must be signed in to change notification settings - Fork 94
251 lines (244 loc) · 10.1 KB
/
artistic.yml
File metadata and controls
251 lines (244 loc) · 10.1 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
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
# Copyright (c) 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
# Author: Philippe Sauter <phsauter@iis.ee.ethz.ch>
# Author: Thomas Benz <tbenz@iis.ee.ethz.ch>
name: ArtistIC Render
on:
workflow_dispatch:
workflow_run:
workflows: ["Full Flow"]
types: [completed]
branches: [main]
jobs:
artistic:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
timeout-minutes: 60
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout repository (with submodules)
uses: actions/checkout@v4
with:
submodules: true
- name: Free disk space
uses: ./.github/actions/free-space
- name: Get run ID of "Full Flow" workflow
id: get-run-id
run: |
OTHER_REPO="${{ github.repository }}"
WF_NAME="Full Flow"
RUN_ID=$(gh run --repo "${OTHER_REPO}" list --workflow "${WF_NAME}" --json databaseId --jq '.[0].databaseId')
echo "Detected latest run id ${RUN_ID} for workflow ${WF_NAME}"
echo "run-id=${RUN_ID}" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ github.token }}
- name: Download GDS artifact from "Full Flow" workflow
uses: actions/download-artifact@v4
with:
name: croc-gds
github-token: ${{ github.token }}
repository: ${{ github.repository }}
run-id: ${{ steps.get-run-id.outputs.run-id }}
path: klayout
- name: Download DEF artifact from "Full Flow" workflow
uses: actions/download-artifact@v4
with:
name: croc-openroad-out
github-token: ${{ github.token }}
repository: ${{ github.repository }}
run-id: ${{ steps.get-run-id.outputs.run-id }}
path: openroad
- name: Checkout ArtistIC repository
uses: actions/checkout@v4
with:
repository: pulp-platform/artistic
ref: 31277dfbcb5f15d219c9834bc9e6f1c9b4705bf3
path: artistic
- name: Update package lists and install Inkscape, img2pdf
run: |
sudo apt-get update
sudo apt-get install -y inkscape img2pdf
- name: Customize input logo
run : |
sed "s/#DATE#/$(date '+%Y-%m-%d')/g" doc/artwork/logo_chip.svg > doc/artwork/logo.svg
sed -i "s/#HASH#/$(git rev-parse --short HEAD)/g" doc/artwork/logo.svg
sed -i "s|#REPO#|gh.io/$GITHUB_REPOSITORY|g" doc/artwork/logo.svg
inkscape doc/artwork/logo.svg -w 660 -h 660 -o doc/artwork/logo.png
- name: Upload logo
uses: actions/upload-artifact@v4
with:
name: png-logo
path: doc/artwork/logo.png
continue-on-error: true
- name: Install ImageMagick, Potrace, Pillow, svgpathtools
run: |
sudo apt-get install -y imagemagick potrace
pip install --break-system-packages svgpathtools Pillow
- name: Install packages in OSEDA
uses: ./.github/actions/oseda-cmd
with:
cmd: "pip install --break-system-packages gdspy"
- name: Meercat setup, export top-level GDS
uses: ./.github/actions/oseda-cmd
with:
cmd: "ls -lah klayout; cd artistic; mkdir -p meerkat_work; python3 scripts/meerkat_interface.py -i ../../klayout/croc_chip.gds -m croc_tm.gds.gz -g croc_logo.gds -o croc_chip.gds.gz -w meerkat_work -l 134; cd meerkat_work; klayout -zz -rm ../scripts/export_top_metal.py; gzip -d croc_tm.gds.gz"
- name: Upload top-level GDS
uses: actions/upload-artifact@v4
with:
name: top-level-gds
path: artistic/meerkat_work/croc_tm.gds
continue-on-error: true
- name: Translate the logo to mono
run: |
convert doc/artwork/logo.png -remap pattern:gray50 artistic/meerkat_work/logo_mono.png
- name: Upload mono logo
uses: actions/upload-artifact@v4
with:
name: mono-logo
path: artistic/meerkat_work/logo_mono.png
continue-on-error: true
- name: Generate logo GDS
uses: ./.github/actions/oseda-cmd
with:
cmd: "cd artistic; python3 scripts/meerkat.py -i meerkat_work/logo_mono.png -g meerkat_work/croc_tm.gds -l 134 -n croc -s meerkat_work/croc_logo.svg -o meerkat_work/croc_logo.gds"
- name: Upload logo GDS
uses: actions/upload-artifact@v4
with:
name: logo-gds
path: artistic/meerkat_work/croc_logo.gds
continue-on-error: true
- name: Upload logo SVG
uses: actions/upload-artifact@v4
with:
name: logo-svg
path: artistic/meerkat_work/croc_logo.svg
continue-on-error: true
- name: Merge logo GDS with chip GDS
uses: ./.github/actions/oseda-cmd
with:
cmd: "cd artistic; cd meerkat_work; klayout -zz -rm ../scripts/merge_logo.py"
- name: Upload chip GDS
uses: actions/upload-artifact@v4
with:
name: chip-gds
path: artistic/meerkat_work/croc_chip.gds.gz
continue-on-error: true
- name: Prepare render
run: |
mkdir -p artistic/renderics
cp -v .github/config/croc_ci.json artistic/renderics/croc_ci.json
cp -v .github/config/croc_map_ci.json artistic/renderics/croc_map_ci.json
sed "s|/fosic/designs|/home/runner/work/croc|g" artistic/renderics/croc_ci.json > artistic/renderics/croc_ci_runner.json
sed "s|/fosic/designs|/home/runner/work/croc|g" artistic/renderics/croc_map_ci.json > artistic/renderics/croc_map_ci_runner.json
- name: Analyze render
uses: ./.github/actions/oseda-cmd
with:
cmd: "cd artistic; make analyze CFG_FILE=/fosic/designs/croc/artistic/renderics/croc_ci.json > renderics/analyze.txt"
- name: Upload render summary
uses: actions/upload-artifact@v4
with:
name: render-summary
path: artistic/renderics/analyze.txt
continue-on-error: true
- name: Upload color preview
uses: actions/upload-artifact@v4
with:
name: render-color-preview
path: artistic/renderics/colors_croc.svg
continue-on-error: true
- name: Render b/w layer tiles
uses: ./.github/actions/oseda-cmd
with:
cmd: "cd artistic; make gen_raw CFG_FILE=/fosic/designs/croc/artistic/renderics/croc_ci.json"
- name: Render PDFs
run: |
cd artistic; make -j gen_pdfs CFG_FILE=renderics/croc_ci_runner.json
- name: Finish render
run: |
mv artistic/renderics//DPI__croc_0-0.png artistic/renderics/croc_render.png
mv artistic/renderics//PDF__croc_0-0.pdf artistic/renderics/croc_render.pdf
convert artistic/renderics/croc_render.png artistic/renderics/croc_render.jpg
- name: Create annotated outlines SVG
run: |
python3 artistic/scripts/gen_outline.py -i openroad/out/croc.def -o artistic/renderics/croc_modules.svg -b artistic/renderics/croc_render.jpg --lef_files ihp13/pdk/ihp-sg13g2/libs.ref/sg13g2_sram/lef/*.lef --px_scale 15000 --module_json .github/config/croc_modules.json --opacity 0.65 --font_size 35 --luminosity 0.85
- name: Create annotated outlines PNG and PDF
run: |
inkscape artistic/renderics/croc_modules.svg -o artistic/renderics/croc_modules.png
inkscape artistic/renderics/croc_modules.svg -o artistic/renderics/croc_modules.pdf
- name: Upload render PNG
uses: actions/upload-artifact@v4
with:
name: render-png
path: artistic/renderics/croc_render.png
continue-on-error: true
- name: Upload render PDF
uses: actions/upload-artifact@v4
with:
name: render-pdf
path: artistic/renderics/croc_render.pdf
continue-on-error: true
- name: Upload render JPG
uses: actions/upload-artifact@v4
with:
name: render-jpg
path: artistic/renderics/croc_render.jpg
continue-on-error: true
- name: Upload render module SVG
uses: actions/upload-artifact@v4
with:
name: render-module-svg
path: artistic/renderics/croc_modules.svg
continue-on-error: true
- name: Upload render module PNG
uses: actions/upload-artifact@v4
with:
name: render-module-png
path: artistic/renderics/croc_modules.png
continue-on-error: true
- name: Upload render module PDF
uses: actions/upload-artifact@v4
with:
name: render-module-pdf
path: artistic/renderics/croc_modules.pdf
continue-on-error: true
# Map render and deploy below:
- name: Render b/w map layer tiles
uses: ./.github/actions/oseda-cmd
with:
cmd: "cd artistic; make gen_raw CFG_FILE=/fosic/designs/croc/artistic/renderics/croc_map_ci.json"
- name: Render Map Tiles
run: |
cd artistic; make -j gen_tiles CFG_FILE=renderics/croc_map_ci_runner.json
- name: Mapify Tiles
run: |
cd artistic; python3 scripts/mapify.py renderics/croc_map_ci_runner.json | sh
- name: Copy index.html
run: |
cp .github/config/gh-pages-map.html artistic/mapify/index.html
- name: Upload OpenStreetMap DB
uses: actions/upload-artifact@v4
with:
name: map-db
path: artistic/mapify
continue-on-error: true
- name: Copy GDS to be deployed
run: |
cp artistic/meerkat_work/croc_logo.gds artistic/mapify/croc_logo.gds
- name: Copy Outlines to be deployed
run: |
cp artistic/renderics/croc_modules.* artistic/mapify/
cp artistic/renderics/croc_render.jpg artistic/mapify/
- name: Upload OpenStreetMap DB to pages
uses: actions/upload-pages-artifact@v3
with:
path: artistic/mapify
- name: Deploy pages (on main only)
if: github.ref == 'refs/heads/main'
id: deployment
uses: actions/deploy-pages@v4