Skip to content

Commit

Permalink
FaML design, fix pitch in merge script
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasc-ubc committed Oct 27, 2024
1 parent cd7d5b3 commit 57b1ce3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
37 changes: 17 additions & 20 deletions merge/EBeam_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,15 @@ def log(text):
course = 'openEBL'
if 'ebeam' in basefilename.lower():
course = 'edXphot1x'
if 'faml' in basefilename.lower():
course = 'FaML'
if 'elec413' in basefilename.lower():
course = 'ELEC413'
if 'openebl' in basefilename.lower():
course = 'openEBL'
if 'siepic_passives' in basefilename.lower():
course = 'SiEPIC_Passives'
# Last, all the edge coupler devices
if 'faml' in basefilename.lower():
course = 'FaML'

cell_course = eval('cell_' + course)
log(" - course name: %s" % (course) )
Expand Down Expand Up @@ -294,14 +295,8 @@ def log(text):
log(' - WARNING: Cell was clipped to maximum size of %s X %s' % (cell_Width +(cell_FaML_width_extra if course == 'FaML' else 0), cell_Height) )
log(' - clipped bounding box: %s' % bbox2.to_s() )

subcell.copy_tree(cell)
'''
if course is not 'FaML':
# copy
subcell.copy_tree(layout2.cell(cell2))
else:
subcell.copy_tree(cell)
'''
# Copy the cropped version
subcell.copy_tree(layout2.cell(cell2))

# Check if this cell would overlap with other Floorplans, then move if necessary

Expand All @@ -325,25 +320,27 @@ def sub_instances(instance,name):
if type(instance) == pya.Cell:
cell = instance
else:
cell = instance.cell()
cell = instance.cell
for inst in cell.each_inst():
# log(' - looking for FaML instance: %s' % (inst.to_s()))
if inst.cell.name == name:
found_instances.append(inst)
if name in inst.cell.name:
found_instances.append([inst, inst.trans])
# log(' - Found FaML instance: %s, %s' % (inst.to_s(), inst.cell.name))
elif inst.cell.child_instances() > 0:
for f in sub_instances(inst,name):
if f.cell.name == name:
found_instances.append(f)
if name in f[0].cell.name:
f[1] *= inst.trans
found_instances.append(f) # .transform(inst.trans))
return found_instances

found_faml_instances = sub_instances(layout2.top_cells()[0], name = 'ebeam_dream_FaML_SiN_1550_BB')
# found_faml_instances = sub_instances(layout2.top_cells()[0], name = 'ebeam_dream_FaML_SiN_1550_BB')
found_faml_instances = sub_instances(subcell2, name = 'ebeam_dream_FaML_SiN_1550_BB')
#for f in found_faml_instances:
# log(' - Found FaML instance: %s, %s' % (f.to_s(), f.cell.name))
found_faml_instances.sort(key=lambda x: -x.cplx_trans.disp.y)
found_faml_instances.sort(key=lambda x: -x[1].disp.y)
for f in found_faml_instances:
log(' - Found FaML instance (sorted): %s, %s' % (f.to_s(), f.cell.name))
top_FaML = found_faml_instances[0].cplx_trans.disp.y
log(' - Found FaML instance (sorted): %s, %s' % (f[0].to_s(), f[0].cell.name))
top_FaML = found_faml_instances[0][1].disp.y

else:
x_offset = 0
Expand Down Expand Up @@ -384,7 +381,7 @@ def next_position(x, y, cell_Gap_Height, cell_Gap_Width, chip_Height, cell_Heigh

if course == 'FaML':
# record placement of FaML
previous_top_FaML = found_faml_instances[0].cplx_trans.disp.y + y
previous_top_FaML = found_faml_instances[0][1].disp.y + y
log(' - top FaML position: %s' % (previous_top_FaML) )

# Measure the height of the cell that was added, and move up
Expand Down
Binary file added submissions/OpenEBL_snewman_SiN_CDCB3_1_FaML.gds
Binary file not shown.

0 comments on commit 57b1ce3

Please sign in to comment.