-
Notifications
You must be signed in to change notification settings - Fork 1
/
awg_340nm.rb
187 lines (173 loc) · 6.17 KB
/
awg_340nm.rb
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
load "Awg_class.rb"
load "GratingCoupler_class.rb"
include MyBasic
include RBA
# create a new view (mode 1) with an empty layout
main_window =Application::instance.main_window
layout = main_window.create_layout(1).layout
layout_view = main_window.current_view
# set the database unit (shown as an example, the default is 0.001)
dbu = 0.001
layout.dbu = dbu
# create a cell
#########################AWG_400G_width450#########################
cell = layout.create_cell("AWG_200G_width450")
awg_200G = Awg.new()
awg_200G.narms=40
awg_200G.nchannel=6
awg_200G.ra=54.0/dbu
awg_200G.theta_da=0.9
awg_200G.theta_cs=1.4
awg_200G.w_wg=0.45/dbu
awg_200G.w_aperture=2.0/dbu
awg_200G.array_aperture=1.68/dbu
awg_200G.array_w=0.45/dbu
awg_200G.array_R=30.0/dbu
awg_200G.delta_L=32.935/dbu
awg_200G.arrayed_taper=30.0/dbu
awg_200G.w_taper=30.0/dbu
awg_200G.arrayed_spacing=2.8/dbu
awg_200G.ports_spacing=100.0/dbu
awg_200G.overlap_fpr1=0.1/dbu
awg_200G.overlap_fpr2=0.25/dbu
awg_200G.overlap_array=0.1/dbu
awg_200G.overlap_ports=0.1/dbu
awg_200G.fsr_angle1 = 57.0
awg_200G.fsr_angle2 = 53.0
awg_200G.layer_fsr= layout.layer(1, 0)
awg_200G.layer_arrayed= layout.layer(2, 0)
awg_200G.layer_ports = layout.layer(3, 0)
awg_200G.centre_line = 1
#awg_200G.straight_neff = 2.82371
#awg_200G.bend_neff = 2.824144
awg_200G.shapes(cell)
#################Grating Coupler##############
gccell = layout.create_cell("Grating_Coupler_340nm_width_450")
gcoupler = GratingCoupler.new()
gcoupler.width_in = awg_200G.ports[0].width
gcoupler.shapes(gccell)
overlap = 0.1/dbu
awg_200G.ports.each do |port|
angle = (port.direction-gcoupler.ports[0].direction-Math::PI)
tmpover = DPoint::new(overlap*Math::cos(angle),overlap*Math::sin(angle))
disp = port.point-gcoupler.ports[0].point - tmpover
t = CplxTrans::new(1.0, angle/Math::PI*180.0,false,disp)
tmp = CellInstArray::new(gccell.cell_index,t)
cell.insert(tmp)
end
#########################AWG_400G_width400#########################
cell = layout.create_cell("AWG_200G_width400")
awg_200G.w_wg=0.4/dbu
awg_200G.array_w=0.4/dbu
awg_200G.shapes(cell)
#################Grating Coupler##############
gccell = layout.create_cell("Grating_Coupler_340nm_width_400")
gcoupler.width_in = awg_200G.ports[0].width
gcoupler.shapes(gccell)
overlap = 0.1/dbu
awg_200G.ports.each do |port|
angle = (port.direction-gcoupler.ports[0].direction-Math::PI)
tmpover = DPoint::new(overlap*Math::cos(angle),overlap*Math::sin(angle))
disp = port.point-gcoupler.ports[0].point - tmpover
t = CplxTrans::new(1.0, angle/Math::PI*180.0,false,disp)
tmp = CellInstArray::new(gccell.cell_index,t)
cell.insert(tmp)
end
#########################AWG_200G_width500#########################
cell = layout.create_cell("AWG_200G_width500")
awg_200G.w_wg=0.5/dbu
awg_200G.array_w=0.5/dbu
awg_200G.shapes(cell)
#################Grating Coupler##############
gccell = layout.create_cell("Grating_Coupler_340nm_width_500")
gcoupler.width_in = awg_200G.ports[0].width
gcoupler.period = 0.64/dbu
gcoupler.duty = 0.38
gcoupler.shapes(gccell)
overlap = 0.1/dbu
awg_200G.ports.each do |port|
angle = (port.direction-gcoupler.ports[0].direction-Math::PI)
tmpover = DPoint::new(overlap*Math::cos(angle),overlap*Math::sin(angle))
disp = port.point-gcoupler.ports[0].point - tmpover
t = CplxTrans::new(1.0, angle/Math::PI*180.0,false,disp)
tmp = CellInstArray::new(gccell.cell_index,t)
cell.insert(tmp)
end
#########################AWG_400G_width450#########################
cell = layout.create_cell("AWG_400G_width450")
awg_400G = Awg.new()
awg_400G.narms=32
awg_400G.nchannel=6
awg_400G.ra=54.0/dbu
awg_400G.theta_da=0.9
awg_400G.theta_cs=1.4
awg_400G.w_wg=0.45/dbu
awg_400G.w_aperture=2.0/dbu
awg_400G.array_aperture=1.68/dbu
awg_400G.array_w=0.45/dbu
awg_400G.array_R=30.0/dbu
awg_400G.delta_L=16.5/dbu
awg_400G.arrayed_taper=30.0/dbu
awg_400G.w_taper=30.0/dbu
awg_400G.arrayed_spacing=2.8/dbu
awg_400G.ports_spacing=100.0/dbu
awg_400G.overlap_fpr1=0.1/dbu
awg_400G.overlap_fpr2=0.25/dbu
awg_400G.overlap_array=0.1/dbu
awg_400G.overlap_ports=0.1/dbu
awg_400G.fsr_angle1 = 57.0
awg_400G.fsr_angle2 = 53.0
awg_400G.layer_fsr= layout.layer(1, 0)
awg_400G.layer_arrayed= layout.layer(2, 0)
awg_400G.layer_ports = layout.layer(3, 0)
awg_400G.centre_line = 1
#awg_400G.straight_neff = 2.82371
#awg_400G.bend_neff = 2.824144
awg_400G.shapes(cell)
#################Grating Coupler##############
gccell = layout.cell("Grating_Coupler_340nm_width_450")
overlap = 0.1/dbu
awg_400G.ports.each do |port|
angle = (port.direction-gcoupler.ports[0].direction-Math::PI)
tmpover = DPoint::new(overlap*Math::cos(angle),overlap*Math::sin(angle))
disp = port.point-gcoupler.ports[0].point - tmpover
t = CplxTrans::new(1.0, angle/Math::PI*180.0,false,disp)
tmp = CellInstArray::new(gccell.cell_index,t)
cell.insert(tmp)
end
#########################AWG_400G_width400#########################
cell = layout.create_cell("AWG_400G_width400")
awg_400G.w_wg=0.4/dbu
awg_400G.array_w=0.4/dbu
awg_400G.shapes(cell)
#################Grating Coupler##############
gccell = layout.cell("Grating_Coupler_340nm_width_400")
overlap = 0.1/dbu
awg_400G.ports.each do |port|
angle = (port.direction-gcoupler.ports[0].direction-Math::PI)
tmpover = DPoint::new(overlap*Math::cos(angle),overlap*Math::sin(angle))
disp = port.point-gcoupler.ports[0].point - tmpover
t = CplxTrans::new(1.0, angle/Math::PI*180.0,false,disp)
tmp = CellInstArray::new(gccell.cell_index,t)
cell.insert(tmp)
end
#########################AWG_400G_width500#########################
cell = layout.create_cell("AWG_400G_width500")
awg_400G.w_wg=0.5/dbu
awg_400G.array_w=0.5/dbu
awg_400G.shapes(cell)
#################Grating Coupler##############
gccell = layout.cell("Grating_Coupler_340nm_width_500")
overlap = 0.1/dbu
awg_400G.ports.each do |port|
angle = (port.direction-gcoupler.ports[0].direction-Math::PI)
tmpover = DPoint::new(overlap*Math::cos(angle),overlap*Math::sin(angle))
disp = port.point-gcoupler.ports[0].point - tmpover
t = CplxTrans::new(1.0, angle/Math::PI*180.0,false,disp)
tmp = CellInstArray::new(gccell.cell_index,t)
cell.insert(tmp)
end
#########################Top#########################
layout_view.select_cell(cell.cell_index, 0)
layout_view.add_missing_layers
layout_view.zoom_fit