Skip to content

Instantly share code, notes, and snippets.

@urish
Created November 9, 2024 16:09
Show Gist options
  • Save urish/171c98605da4e31ab2c84a27301b988c to your computer and use it in GitHub Desktop.
Save urish/171c98605da4e31ab2c84a27301b988c to your computer and use it in GitHub Desktop.
Generates skull fill for sg13g2 IHP
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: 2024 Uri Shaked
import gdspy
LAYER = 134 # TopMetal2
DATATYPE = 22 # filler
PIXEL_SIZE = 0.28 # um
skull = [
[9, 4, 16, 5],
[8, 5, 17, 6],
[6, 6, 19, 8],
[5, 8, 20, 12],
[5, 12, 8, 13],
[17, 12, 20, 13],
[11, 12, 14, 15],
[5, 13, 7, 14],
[18, 13, 20, 14],
[6, 14, 7, 17],
[10, 15, 15, 16],
[18, 14, 19, 16],
[7, 15, 8, 17],
[9, 16, 11, 20],
[8, 16, 9, 18],
[11, 16, 12, 17],
[17, 15, 18, 18],
[13, 16, 17, 17],
[14, 17, 17, 18],
[11, 18, 16, 20],
[9, 20, 10, 21],
[11, 20, 12, 21],
[13, 20, 14, 21],
[15, 20, 16, 21],
]
bones = [
[3, 0, 4, 1],
[2, 1, 5, 2],
[2, 2, 6, 3],
[2, 3, 8, 4],
[3, 4, 10, 5],
[8, 5, 12, 6],
[13, 5, 17, 6],
[15, 4, 23, 5],
[17, 3, 23, 4],
[19, 2, 23, 3],
[20, 1, 23, 2],
[21, 0, 22, 1],
[10, 6, 15, 8],
[8, 8, 12, 9],
[13, 8, 17, 9],
[6, 9, 10, 10],
[15, 9, 19, 10],
[3, 10, 9, 11],
[16, 10, 22, 11],
[2, 11, 7, 13],
[18, 11, 23, 13],
[3, 13, 6, 14],
[19, 13, 22, 14],
]
HEIGHT = 33
layout = gdspy.Cell("skull_fill")
for [x1, y1, x2, y2] in skull:
layout.add(
gdspy.Rectangle(
(x1 * PIXEL_SIZE, (HEIGHT - y1) * PIXEL_SIZE),
(x2 * PIXEL_SIZE, (HEIGHT - y2) * PIXEL_SIZE),
layer=LAYER,
datatype=DATATYPE,
)
)
for [x1, y1, x2, y2] in bones:
layout.add(
gdspy.Rectangle(
(x1 * PIXEL_SIZE, (HEIGHT - 19 - y1) * PIXEL_SIZE),
(x2 * PIXEL_SIZE, (HEIGHT - 19 - y2) * PIXEL_SIZE),
layer=LAYER,
datatype=DATATYPE,
)
)
# Save the layout to a file
gdspy.write_gds("skull_bones_fill.gds")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment