-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdie.py
71 lines (57 loc) · 2.07 KB
/
die.py
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
import gdsfactory as gf
from gdsfactory.components import text
from gdsfactory.typings import ComponentSpec, Coordinate, Float2, LayerSpec
import gvtt
from gvtt.layers import LAYER
def box(x0: float, y0: float, w: float, h: float) -> list[Coordinate]:
dw = w / 2.0
dh = h / 2.0
return [
(x0 + dw, y0 + dh),
(x0 + dw, y0 - dh),
(x0 - dw, y0 - dh),
(x0 - dw, y0 + dh),
]
@gf.cell
def die(
size: tuple[float, float] = (5000.0, 9500.0),
street_width: float = 75.0,
street_length: float = 1000.0,
die_name: str | None = "chip99",
text_size: float = 100.0,
text_location: str | Float2 = "SW",
layer: LayerSpec | None = None, # "FLOORPLAN",
bbox_layer: LayerSpec | None = None,
draw_corners: bool = True,
draw_dicing_lane: bool = True,
text_component: ComponentSpec = text,
) -> gf.Component:
c = gf.Component(name="die")
w, h = size[0], size[1]
for layer_, size_ in gvtt.frame_dimensions.items():
c.add_polygon(box(w / 2.0 - size_ / 2.0, 0.0, size_, h), layer=layer_)
c.add_polygon(box(-w / 2.0 + size_ / 2.0, 0.0, size_, h), layer=layer_)
c.add_polygon(box(0.0, h / 2.0 - size_ / 2.0, w, size_), layer=layer_)
c.add_polygon(box(0.0, -h / 2.0 + size_ / 2.0, w, size_), layer=layer_)
if bbox_layer:
c.add_polygon(
[(w / 2, h / 2), (w / 2, -h / 2), (-w / 2, -h / 2), (-w / 2, h / 2)],
layer=bbox_layer,
)
c.info["frame_margin"] = gvtt.frame_dimensions[LAYER.WG_SNGL_ADD] + 1.5
# c.info["port_x_position_west"] = (
# -w / 2.0 + gvtt.frame_dimensions[gvtt.LAYER.WG_SNGL_ADD] + 1.5
# )
# c.info["port_x_position_east"] = (
# w / 2.0 - gvtt.frame_dimensions[gvtt.LAYER.WG_SNGL_ADD] - 1.5
# )
# c.info["port_y_position_north"] = (
# h / 2.0 - gvtt.frame_dimensions[gvtt.LAYER.WG_SNGL_ADD] - 1.5
# )
# c.info["port_y_position_south"] = (
# -h / 2.0 + gvtt.frame_dimensions[gvtt.LAYER.WG_SNGL_ADD] + 1.5
# )
return c
if __name__ == "__main__":
c = die()
c.show()