Nested sample generation
The following example will illustrate filling a wafer with multiple 10 x 10 mm pieces, as well as addition of dicing marks and labels for the 10 x 10s.
For the purpose of this tutorial, the 10 x 10 pieces will be empty.
First, imports
1import qnngds as qg
2from phidl import quickplot as qp
3import phidl.geometry as pg
Now, basic single layer PDK setup. This is only really necessary to get the nice layername to tuple translation, since we’re not doing any routing here.
1ls = qg.LayerSet()
2ls.add_layer(qg.Layer(name="PHOTO", gds_layer=1))
3PDK = qg.Pdk("single_layer_pdk", layers=ls)
4PDK.activate()
Next, we’ll define the 10 x 10 piece and place a dummy rectangle on it. In practice, one would fill this up with experiments generated from devices and circuits.
1piece = qg.sample.Sample(cell_size=1e3, sample=qg.sample.piece10mm, edge_exclusion=500)
2piece.place_on_sample(
3 device=pg.rectangle(size=(1, 1), layer=qg.get_layer("PHOTO")),
4 cell_coordinate_bbox=(4, 4),
5)
Now, we generate the wafer sample and place a bunch of identical copies of the 10 x 10. Again, in practice, one would have several different 10 x 10s.
1wafer = qg.sample.Sample(
2 cell_size=10e3,
3 sample=qg.sample.wafer100mm,
4 edge_exclusion=10e3,
5 allow_cell_span=False,
6)
7wafer.place_multiple_on_sample(
8 devices=[piece.devices] * wafer.num_open_cells(),
9 cell_coordinate_bbox=((0, 0), (10, 10)),
10)
Now we can write corners for all the occupied cells on the wafer as well as text labels so we can keep track of which piece is which after dicing.
1wafer.write_cell_corners(width=100, layer="PHOTO")
2wafer.write_cell_labels(size=400, layer="PHOTO", inset_dist=200, location=2)
Finally, we can write alignment marks and plot the device.
1wafer.write_alignment_marks(
2 marker_spec=pg.cross(length=100, width=3, layer=qg.get_layer("PHOTO")),
3 location=(20e3, 30e3),
4)
5qp(wafer.devices)
Reference
1import qnngds as qg
2from phidl import quickplot as qp
3import phidl.geometry as pg
4
5ls = qg.LayerSet()
6ls.add_layer(qg.Layer(name="PHOTO", gds_layer=1))
7PDK = qg.Pdk("single_layer_pdk", layers=ls)
8PDK.activate()
9piece = qg.sample.Sample(cell_size=1e3, sample=qg.sample.piece10mm, edge_exclusion=500)
10piece.place_on_sample(
11 device=pg.rectangle(size=(1, 1), layer=qg.get_layer("PHOTO")),
12 cell_coordinate_bbox=(4, 4),
13)
14wafer = qg.sample.Sample(
15 cell_size=10e3,
16 sample=qg.sample.wafer100mm,
17 edge_exclusion=10e3,
18 allow_cell_span=False,
19)
20wafer.place_multiple_on_sample(
21 devices=[piece.devices] * wafer.num_open_cells(),
22 cell_coordinate_bbox=((0, 0), (10, 10)),
23)
24wafer.write_cell_corners(width=100, layer="PHOTO")
25wafer.write_cell_labels(size=400, layer="PHOTO", inset_dist=200, location=2)
26wafer.write_alignment_marks(
27 marker_spec=pg.cross(length=100, width=3, layer=qg.get_layer("PHOTO")),
28 location=(20e3, 30e3),
29)
30qp(wafer.devices)