From 777c5565897cd515a4cd7f51a2ea514d41be6e35 Mon Sep 17 00:00:00 2001 From: Thomas Benz Date: Tue, 16 Dec 2025 11:21:57 +0100 Subject: [PATCH] ci: artistic: add outline gen --- .github/config/croc_ci.json | 2 +- .github/config/croc_map_ci.json | 12 ++++---- .github/config/croc_modules.json | 34 ++++++++++++++++++++++ .github/workflows/artistic.yml | 48 ++++++++++++++++++++++++++++---- 4 files changed, 84 insertions(+), 12 deletions(-) create mode 100644 .github/config/croc_modules.json diff --git a/.github/config/croc_ci.json b/.github/config/croc_ci.json index 06523a30..0d337e90 100644 --- a/.github/config/croc_ci.json +++ b/.github/config/croc_ci.json @@ -34,7 +34,7 @@ "TV1" : {"layer" : "125/0", "color" : "#7FFFD4", "alpha" : "0.5" }, "T1" : {"layer" : "126/0", "color" : "#7FFFD4", "alpha" : "0.5" }, "TV2" : {"layer" : "133/0", "color" : "#1E90FF", "alpha" : "0.5" }, - "T2" : {"layer" : "134/0", "color" : "#FFFFFF", "alpha" : "0.8" } + "T2" : {"layer" : "134/0", "color" : "#FFFFFF", "alpha" : "0.3" } }, "work" : { "dir" : "/fosic/designs/croc/artistic/renderics" diff --git a/.github/config/croc_map_ci.json b/.github/config/croc_map_ci.json index fc7d7c39..04d27841 100644 --- a/.github/config/croc_map_ci.json +++ b/.github/config/croc_map_ci.json @@ -4,14 +4,14 @@ }, "gds" : { "file" : "/fosic/designs/croc/artistic/meerkat_work/croc_chip.gds.gz", - "x_offset_um" : 0, - "y_offset_um" : 0, - "width_um" : 1930, - "height_um" : 1930 + "x_offset_um" : -59, + "y_offset_um" : -59, + "width_um" : 2048, + "height_um" : 2048 }, "image": { - "px_width" : 19300, - "px_height" : 19300, + "px_width" : 20480, + "px_height" : 20480, "overrender_factor" : 1, "num_segs_width" : 5, "num_segs_height" : 5 diff --git a/.github/config/croc_modules.json b/.github/config/croc_modules.json new file mode 100644 index 00000000..eff93495 --- /dev/null +++ b/.github/config/croc_modules.json @@ -0,0 +1,34 @@ +{ + "i_uart": { + "name": "UART", + "color": "#f88c05" + }, + "i_dm_top": { + "name": "Debug", + "color": "#d489cc" + }, + "i_dmi_jtag": { + "name": "JTAG", + "color": "#80499c" + }, + "i_obi_timer": { + "name": "Timer", + "color": "#f3d408" + }, + "i_core_wrap": { + "name": "Core", + "color": "#fb120d" + }, + "i_user": { + "name": "User", + "color": "#1bb32c" + }, + "i_gpio": { + "name": "GPIO", + "color": "#43fdaa" + }, + "gen_sram_bank": { + "name": "SRAM", + "color": "#39729f" + } +} diff --git a/.github/workflows/artistic.yml b/.github/workflows/artistic.yml index ce3a5259..f1b4fab3 100644 --- a/.github/workflows/artistic.yml +++ b/.github/workflows/artistic.yml @@ -42,7 +42,7 @@ jobs: echo "run-id=${RUN_ID}" >> "$GITHUB_OUTPUT" env: GH_TOKEN: ${{ github.token }} - - name: Download artifact from "Full Flow" workflow + - name: Download GDS artifact from "Full Flow" workflow uses: actions/download-artifact@v4 with: name: croc-gds @@ -50,12 +50,20 @@ jobs: 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: 33986fa39e07d89a8337d65e84b01113bf18ea03 + ref: 31277dfbcb5f15d219c9834bc9e6f1c9b4705bf3 path: artistic - name: Update package lists and install Inkscape, img2pdf run: | @@ -74,9 +82,10 @@ jobs: path: doc/artwork/logo.png continue-on-error: true - - name: Install ImageMagick + - name: Install ImageMagick, Potrace, Pillow, svgpathtools run: | - sudo apt-get install -y imagemagick + 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: @@ -103,7 +112,7 @@ jobs: - name: Generate logo GDS uses: ./.github/actions/oseda-cmd with: - cmd: "cd artistic; python3 scripts/meerkat.py -m '145,145,145,145' -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" + 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: @@ -162,6 +171,13 @@ jobs: 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: @@ -180,6 +196,24 @@ jobs: 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 @@ -203,6 +237,10 @@ jobs: - 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: