Skip to content

Commit d4b6aea

Browse files
committed
artistic: add run script
1 parent ae9f72d commit d4b6aea

File tree

12 files changed

+291
-346
lines changed

12 files changed

+291
-346
lines changed

.github/workflows/artistic.yml

Lines changed: 47 additions & 160 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@ jobs:
2626
name: github-pages
2727
url: ${{ steps.deployment.outputs.page_url }}
2828
steps:
29+
30+
# Check out croc repo and cleanup
2931
- name: Checkout repository (with submodules)
3032
uses: actions/checkout@v4
3133
with:
32-
submodules: true
34+
submodules: recursive
3335
- name: Free disk space
3436
uses: ./.github/actions/free-space
3537
- name: Get run ID of "Full Flow" workflow
@@ -42,6 +44,8 @@ jobs:
4244
echo "run-id=${RUN_ID}" >> "$GITHUB_OUTPUT"
4345
env:
4446
GH_TOKEN: ${{ github.token }}
47+
48+
# Restore previous artifacts (GDS and DEF)
4549
- name: Download GDS artifact from "Full Flow" workflow
4650
uses: actions/download-artifact@v4
4751
with:
@@ -59,193 +63,76 @@ jobs:
5963
run-id: ${{ steps.get-run-id.outputs.run-id }}
6064
path: openroad
6165

62-
- name: Checkout ArtistIC repository
63-
uses: actions/checkout@v4
64-
with:
65-
repository: pulp-platform/artistic
66-
ref: 31277dfbcb5f15d219c9834bc9e6f1c9b4705bf3
67-
path: artistic
68-
- name: Update package lists and install Inkscape, img2pdf
66+
# Install dependencies
67+
- name: Update package lists and install Inkscape, img2pdf, Magick, potrace, Pillow
6968
run: |
7069
sudo apt-get update
71-
sudo apt-get install -y inkscape img2pdf
72-
- name: Customize input logo
73-
run : |
74-
sed "s/#DATE#/$(date '+%Y-%m-%d')/g" doc/artwork/logo_chip.svg > doc/artwork/logo.svg
75-
sed -i "s/#HASH#/$(git rev-parse --short HEAD)/g" doc/artwork/logo.svg
76-
sed -i "s|#REPO#|gh.io/$GITHUB_REPOSITORY|g" doc/artwork/logo.svg
77-
inkscape doc/artwork/logo.svg -w 660 -h 660 -o doc/artwork/logo.png
78-
- name: Upload logo
79-
uses: actions/upload-artifact@v4
80-
with:
81-
name: png-logo
82-
path: doc/artwork/logo.png
83-
continue-on-error: true
84-
85-
- name: Install ImageMagick, Potrace, Pillow, svgpathtools
86-
run: |
87-
sudo apt-get install -y imagemagick potrace
70+
sudo apt-get install -y inkscape img2pdf imagemagick potrace
8871
pip install --break-system-packages svgpathtools Pillow
8972
- name: Install packages in OSEDA
9073
uses: ./.github/actions/oseda-cmd
9174
with:
9275
cmd: "pip install --break-system-packages gdspy"
93-
- name: Meercat setup, export top-level GDS
94-
uses: ./.github/actions/oseda-cmd
95-
with:
96-
cmd: "ls -lah klayout; cd artistic; mkdir -p meerkat_work; python3 scripts/meerkat_interface.py -i ../../klayout/out/croc_chip.gds.gz -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"
97-
- name: Upload top-level GDS
98-
uses: actions/upload-artifact@v4
99-
with:
100-
name: top-level-gds
101-
path: artistic/meerkat_work/croc_tm.gds
102-
continue-on-error: true
103-
- name: Translate the logo to mono
104-
run: |
105-
convert doc/artwork/logo.png -remap pattern:gray50 artistic/meerkat_work/logo_mono.png
106-
- name: Upload mono logo
107-
uses: actions/upload-artifact@v4
108-
with:
109-
name: mono-logo
110-
path: artistic/meerkat_work/logo_mono.png
111-
continue-on-error: true
112-
- name: Generate logo GDS
113-
uses: ./.github/actions/oseda-cmd
114-
with:
115-
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"
116-
- name: Upload logo GDS
117-
uses: actions/upload-artifact@v4
118-
with:
119-
name: logo-gds
120-
path: artistic/meerkat_work/croc_logo.gds
121-
continue-on-error: true
122-
- name: Upload logo SVG
123-
uses: actions/upload-artifact@v4
124-
with:
125-
name: logo-svg
126-
path: artistic/meerkat_work/croc_logo.svg
127-
continue-on-error: true
128-
- name: Merge logo GDS with chip GDS
129-
uses: ./.github/actions/oseda-cmd
130-
with:
131-
cmd: "cd artistic; cd meerkat_work; klayout -zz -rm ../scripts/merge_logo.py"
132-
- name: Upload chip GDS
133-
uses: actions/upload-artifact@v4
134-
with:
135-
name: chip-gds
136-
path: artistic/meerkat_work/croc_chip.gds.gz
137-
continue-on-error: true
13876

139-
- name: Prepare render
77+
# Prepare and create logo
78+
- name: Prepare logo
14079
run: |
141-
mkdir -p artistic/renderics
142-
cp -v .github/config/croc_ci.json artistic/renderics/croc_ci.json
143-
cp -v .github/config/croc_map_ci.json artistic/renderics/croc_map_ci.json
144-
sed "s|/fosic/designs|/home/runner/work/croc|g" artistic/renderics/croc_ci.json > artistic/renderics/croc_ci_runner.json
145-
sed "s|/fosic/designs|/home/runner/work/croc|g" artistic/renderics/croc_map_ci.json > artistic/renderics/croc_map_ci_runner.json
146-
- name: Analyze render
80+
cd artistic; ./run_artistic.sh --prepare-logo
81+
- name: Create Logo
14782
uses: ./.github/actions/oseda-cmd
14883
with:
149-
cmd: "cd artistic; make analyze CFG_FILE=/fosic/designs/croc/artistic/renderics/croc_ci.json > renderics/analyze.txt"
150-
- name: Upload render summary
151-
uses: actions/upload-artifact@v4
152-
with:
153-
name: render-summary
154-
path: artistic/renderics/analyze.txt
155-
continue-on-error: true
156-
- name: Upload color preview
157-
uses: actions/upload-artifact@v4
158-
with:
159-
name: render-color-preview
160-
path: artistic/renderics/colors_croc.svg
161-
continue-on-error: true
162-
- name: Render b/w layer tiles
84+
cmd: "cd artistic; ./run_artistic.sh --create-logo croc_chip.gds.gz"
85+
86+
# Render Chip
87+
- name: Render RAW
16388
uses: ./.github/actions/oseda-cmd
16489
with:
165-
cmd: "cd artistic; make gen_raw CFG_FILE=/fosic/designs/croc/artistic/renderics/croc_ci.json"
166-
- name: Render PDFs
90+
cmd: "cd artistic; ./run_artistic.sh --render-raw"
91+
- name: Render PDF
16792
run: |
168-
cd artistic; make -j gen_pdfs CFG_FILE=renderics/croc_ci_runner.json
169-
- name: Finish render
170-
run: |
171-
mv artistic/renderics//DPI__croc_0-0.png artistic/renderics/croc_render.png
172-
mv artistic/renderics//PDF__croc_0-0.pdf artistic/renderics/croc_render.pdf
173-
convert artistic/renderics/croc_render.png artistic/renderics/croc_render.jpg
93+
cd artistic; ./run_artistic.sh --render-pdf
94+
95+
# Render Outlines
17496
- name: Create annotated outlines SVG
17597
run: |
176-
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
177-
- name: Create annotated outlines PNG and PDF
178-
run: |
179-
inkscape artistic/renderics/croc_modules.svg -o artistic/renderics/croc_modules.png
180-
inkscape artistic/renderics/croc_modules.svg -o artistic/renderics/croc_modules.pdf
181-
- name: Upload render PNG
182-
uses: actions/upload-artifact@v4
183-
with:
184-
name: render-png
185-
path: artistic/renderics/croc_render.png
186-
continue-on-error: true
187-
- name: Upload render PDF
188-
uses: actions/upload-artifact@v4
189-
with:
190-
name: render-pdf
191-
path: artistic/renderics/croc_render.pdf
192-
continue-on-error: true
193-
- name: Upload render JPG
194-
uses: actions/upload-artifact@v4
195-
with:
196-
name: render-jpg
197-
path: artistic/renderics/croc_render.jpg
198-
continue-on-error: true
199-
- name: Upload render module SVG
200-
uses: actions/upload-artifact@v4
201-
with:
202-
name: render-module-svg
203-
path: artistic/renderics/croc_modules.svg
204-
continue-on-error: true
205-
- name: Upload render module PNG
206-
uses: actions/upload-artifact@v4
207-
with:
208-
name: render-module-png
209-
path: artistic/renderics/croc_modules.png
210-
continue-on-error: true
211-
- name: Upload render module PDF
212-
uses: actions/upload-artifact@v4
213-
with:
214-
name: render-module-pdf
215-
path: artistic/renderics/croc_modules.pdf
216-
continue-on-error: true
217-
# Map render and deploy below:
218-
- name: Render b/w map layer tiles
98+
cd artistic; ./run_artistic.sh --outline
99+
100+
# Render Map
101+
- name: Render map RAW
219102
uses: ./.github/actions/oseda-cmd
220103
with:
221-
cmd: "cd artistic; make gen_raw CFG_FILE=/fosic/designs/croc/artistic/renderics/croc_map_ci.json"
222-
- name: Render Map Tiles
223-
run: |
224-
cd artistic; make -j gen_tiles CFG_FILE=renderics/croc_map_ci_runner.json
225-
- name: Mapify Tiles
226-
run: |
227-
cd artistic; python3 scripts/mapify.py renderics/croc_map_ci_runner.json | sh
228-
- name: Copy index.html
104+
cmd: "cd artistic; ./run_artistic.sh --render-map-raw"
105+
- name: Render map DB
229106
run: |
230-
cp .github/config/gh-pages-map.html artistic/mapify/index.html
231-
- name: Upload OpenStreetMap DB
107+
cd artistic; ./run_artistic.sh --render-map-db
108+
109+
# Upload artifacts
110+
- name: Upload ArtistIC artifacts
232111
uses: actions/upload-artifact@v4
233112
with:
234-
name: map-db
235-
path: artistic/mapify
113+
name: croc-artistic
114+
path: |
115+
artistic/meerkat_work/croc_chip.gds.gz
116+
artistic/meerkat_work/croc_logo.*
117+
artistic/meerkat_work/*.log
118+
artistic/renderics/croc_modules.*
119+
artistic/renderics/croc_render.*
120+
artistic/renderics/croc_colors.svg
121+
artistic/renderics/*.log
236122
continue-on-error: true
237-
- name: Copy GDS to be deployed
123+
124+
# Deploy
125+
- name: Copy files to be deployed
238126
run: |
127+
cp openroad/reports/04_croc.routed.png artistic/mapify/croc_routed.png
239128
cp artistic/meerkat_work/croc_logo.gds artistic/mapify/croc_logo.gds
240-
- name: Copy Outlines to be deployed
241-
run: |
242-
cp artistic/renderics/croc_modules.* artistic/mapify/
243-
cp artistic/renderics/croc_render.jpg artistic/mapify/
129+
cp artistic/renderics/croc_modules.jpg artistic/mapify/croc_modules.jpg
130+
cp artistic/renderics/croc_render.jpg artistic/mapify/croc_render.jpg
244131
- name: Upload OpenStreetMap DB to pages
245132
uses: actions/upload-pages-artifact@v3
246133
with:
247134
path: artistic/mapify
248-
- name: Deploy pages (on main only)
135+
- name: Deploy pages
249136
if: github.ref == 'refs/heads/main'
250137
id: deployment
251138
uses: actions/deploy-pages@v4

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[submodule "ihp13/pdk"]
22
path = ihp13/pdk
33
url = https://github.com/IHP-GmbH/IHP-Open-PDK
4+
[submodule "artistic/artistic"]
5+
path = artistic/artistic
6+
url = git@github.com:pulp-platform/artistic.git

artistic/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
renderics
2+
meerkat_work
3+
mapify*

artistic/artistic

Submodule artistic added at 31277df

0 commit comments

Comments
 (0)