laylight DSL
DSL Playground
The compiler runs in your browser as WebAssembly. Examples can import tech.lyl and components.lyl.
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
# A 1x2 MMI splitter and a binary tree of them joined by S-bends. import "components.lyl" cell MMI1x2 { param { wg_len size = 10um wg_width size = 500nm mmi_len size = 30um mmi_width size = 6um out_offset size = 1.5um } attribute { description "1x2 MMI splitter" total_length wg_len * 2 + mmi_len } marker { input { at inp_wg.left_center with type = "waveguide", direction = "input", width = wg_width } # A marker can hold several locations; `at` may refer to shapes # defined further down. output { at { out_wg1.right_center out_wg2.right_center } with { type = "waveguide" direction = "output" width = wg_width } } } layer si { shape rect with width = wg_len, height = wg_width as inp_wg shape rect with mmi_len, mmi_width as mmi_area clone inp_wg as out_wg1 clone inp_wg as out_wg2 place { inp_wg.left_center at self.origin mmi_area.left_center at inp_wg.right_center out_wg1.left_center at mmi_area.right_center offset (0, out_offset) out_wg2.left_center at mmi_area.right_center offset (0, -out_offset) } } layer sio2 { shape rect with total_length, mmi_width + 4um as cladding place cladding.left_center at self.origin } } cell MMITree { param { level integer = 3 pitch size = 10um # output pitch of the last level } marker { input { at self.origin with type = "waveguide", direction = "input" } } place { define spread = pitch for i in 1..level { spread = spread * 2 } define from_ports: [point] = [self.origin] for i in 0..level { define next_ports: [point] = [] for port in from_ports { place MMI1x2 at port as mmi place SBend with shift = spread / 2 - mmi.out_offset at mmi.marker.output[0] as up place SBend with shift = mmi.out_offset - spread / 2 at mmi.marker.output[1] as down next_ports.append(up.marker.output[0]) next_ports.append(down.marker.output[0]) } from_ports = next_ports spread = spread / 2 } } }
Layout
mmi
loading compilerā¦
Waiting for the first compileā¦