Closed sbuchbinder closed 5 years ago
Step run_bpg_tests
failed with details below:
+ export BPG_DIR=/buildbot/runtests/build
+ BPG_DIR=/buildbot/runtests/build
+ /opt/run_bpg.sh
+ mkdir -p workdir
+ cd workdir
+ '[' -z /buildbot/runtests/build ']'
+ '[' -z '' ']'
+ BAG_HASH=e2b2f54
+ '[' -z '' ']'
+ BAG2_TEMPLATES_EC_HASH=e79f54c
+ '[' '!' -d BAG_framework ']'
+ pushd BAG_framework
/buildbot/runtests/build/workdir/BAG_framework /buildbot/runtests/build/workdir
+ git checkout e2b2f54
HEAD is now at e2b2f54 1. fix type-hinting warnings in Pycharm.
+ popd
/buildbot/runtests/build/workdir
+ '[' '!' -d BAG2_TEMPLATES_EC ']'
+ pushd BAG2_TEMPLATES_EC
+ git checkout e79f54c
/buildbot/runtests/build/workdir/BAG2_TEMPLATES_EC /buildbot/runtests/build/workdir
HEAD is now at e79f54c Merge pull request #2 from ucb-art/gf14_compatibility
+ popd
+ export BAG_WORK_DIR=/buildbot/runtests/build/workdir
+ BAG_WORK_DIR=/buildbot/runtests/build/workdir
/buildbot/runtests/build/workdir
+ export BAG_FRAMEWORK=/buildbot/runtests/build/workdir/BAG_framework
+ BAG_FRAMEWORK=/buildbot/runtests/build/workdir/BAG_framework
+ export BAG_TEMP_DIR=/buildbot/runtests/build/workdir/tmp
+ BAG_TEMP_DIR=/buildbot/runtests/build/workdir/tmp
+ export BAG_TECH_CONFIG_DIR=/buildbot/runtests/build/examples/tech/BAG_tech_files
+ BAG_TECH_CONFIG_DIR=/buildbot/runtests/build/examples/tech/BAG_tech_files
+ export PYTHONPATH=/buildbot/runtests/build/workdir/BAG_framework:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+ PYTHONPATH=/buildbot/runtests/build/workdir/BAG_framework:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+ mkdir -p /buildbot/runtests/build/workdir/tmp
+ rm -f BPG
+ ln -s /buildbot/runtests/build BPG
+ BPG/run_tests.py
============================= test session starts ==============================
platform linux -- Python 3.6.7, pytest-3.3.2, py-1.5.2, pluggy-0.6.0
rootdir: /buildbot/runtests/build/workdir/BPG, inifile:
collected 20 items
BPG/tests/test_add_rect.py . [ 5%]
BPG/tests/test_add_round.py F [ 10%]
BPG/tests/test_add_via_stack.py . [ 15%]
BPG/tests/test_anyangle.py .... [ 35%]
BPG/tests/test_anyangle_alignment.py . [ 40%]
BPG/tests/test_dataprep_generic.py F [ 45%]
BPG/tests/test_dataprep_op.py F [ 50%]
BPG/tests/test_dataprep_width_space.py . [ 55%]
BPG/tests/test_flatten.py . [ 60%]
BPG/tests/test_gds_import.py . [ 65%]
BPG/tests/test_logger.py .. [ 75%]
BPG/tests/test_lumerical_material_generator.py . [ 80%]
BPG/tests/test_path.py . [ 85%]
BPG/tests/test_port_extraction.py . [ 90%]
BPG/tests/test_sweep.py . [ 95%]
BPG/tests/test_wg_port.py . [100%]
=================================== FAILURES ===================================
________________________________ test_add_round ________________________________
def test_add_round():
spec_file = 'BPG/tests/specs/add_round_specs.yaml'
plm = BPG.PhotonicLayoutManager(spec_file)
plm.generate_content()
> plm.generate_gds()
BPG/tests/test_add_round.py:61:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
BPG/BPG/layout_manager.py:223: in generate_gds
max_points_per_polygon=max_points_per_polygon)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <BPG.gds.core.GDSPlugin object at 0xffff903447f0>
content_lists = [ContentList for cell_name=add_round_cell], name_append = ''
max_points_per_polygon = 199, write_gds = True
def export_content_list(self,
content_lists: List["ContentList"],
name_append: str = '',
max_points_per_polygon: Optional[int] = None,
write_gds: bool = True,
):
"""
Exports the physical design to GDS
Parameters
----------
content_lists : List[ContentList]
A list of ContentList objects that represent the layout.
name_append : str
A suffix to add to the end of the generated gds filename
max_points_per_polygon : Optional[int]
Maximum number of points allowed per polygon shape in the gds.
Defaults to value set in the init of GDSPlugin if not specified.
write_gds : bool
Default True. True to write out the gds file.
False to create the gdspy object, but not write out the gds.
"""
logging.info(f'In PhotonicTemplateDB._create_gds')
tech_info = self.grid.tech_info
lay_unit = tech_info.layout_unit
res = tech_info.resolution
if not max_points_per_polygon:
max_points_per_polygon = self.max_points_per_polygon
with open(self.gds_layermap, 'r') as f:
lay_info = yaml.load(f)
lay_map = lay_info['layer_map']
via_info = lay_info['via_info']
# TODO: fix
out_fname = self.gds_filepath + f'{name_append}.gds'
gds_lib = gdspy.GdsLibrary(name=self.lib_name, unit=lay_unit, precision=res * lay_unit)
cell_dict = gds_lib.cell_dict
logging.info(f'Instantiating gds layout')
start = time.time()
for content_list in content_lists:
gds_cell = gdspy.Cell(content_list.cell_name, exclude_from_current=True)
gds_lib.add(gds_cell)
# add instances
for inst_info in content_list.inst_list: # type: InstanceInfo
if inst_info.params is not None:
raise ValueError('Cannot instantiate PCells in GDS.')
num_rows = inst_info.num_rows
num_cols = inst_info.num_cols
angle, reflect = inst_info.angle_reflect
if num_rows > 1 or num_cols > 1:
cur_inst = gdspy.CellArray(cell_dict[inst_info.cell], num_cols, num_rows,
(inst_info.sp_cols, inst_info.sp_rows),
origin=inst_info.loc, rotation=angle,
x_reflection=reflect)
else:
cur_inst = gdspy.CellReference(cell_dict[inst_info.cell], origin=inst_info.loc,
rotation=angle, x_reflection=reflect)
gds_cell.add(cur_inst)
# add rectangles
for rect in content_list.rect_list:
nx, ny = rect.get('arr_nx', 1), rect.get('arr_ny', 1)
(x0, y0), (x1, y1) = rect['bbox']
lay_id, purp_id = lay_map[tuple(rect['layer'])]
if nx > 1 or ny > 1:
spx, spy = rect['arr_spx'], rect['arr_spy']
for xidx in range(nx):
dx = xidx * spx
for yidx in range(ny):
dy = yidx * spy
cur_rect = gdspy.Rectangle((x0 + dx, y0 + dy), (x1 + dx, y1 + dy),
layer=lay_id, datatype=purp_id)
gds_cell.add(cur_rect)
else:
cur_rect = gdspy.Rectangle((x0, y0), (x1, y1), layer=lay_id, datatype=purp_id)
gds_cell.add(cur_rect)
# add vias
for via in content_list.via_list: # type: ViaInfo
via_lay_info = via_info[via.id]
nx, ny = via.arr_nx, via.arr_ny
x0, y0 = via.loc
if nx > 1 or ny > 1:
spx, spy = via.arr_spx, via.arr_spy
for xidx in range(nx):
xc = x0 + xidx * spx
for yidx in range(ny):
yc = y0 + yidx * spy
self._add_gds_via(gds_cell, via, lay_map, via_lay_info, xc, yc)
else:
self._add_gds_via(gds_cell, via, lay_map, via_lay_info, x0, y0)
# add pins
for pin in content_list.pin_list: # type: PinInfo
lay_id, purp_id = lay_map[pin.layer]
bbox = pin.bbox
label = pin.label
if pin.make_rect:
cur_rect = gdspy.Rectangle((bbox.left, bbox.bottom), (bbox.right, bbox.top),
layer=lay_id, datatype=purp_id)
gds_cell.add(cur_rect)
angle = 90 if bbox.height_unit > bbox.width_unit else 0
cur_lbl = gdspy.Label(label, (bbox.xc, bbox.yc), rotation=angle,
layer=lay_id, texttype=purp_id)
gds_cell.add(cur_lbl)
for path in content_list.path_list:
# Photonic paths should be treated like polygons
lay_id, purp_id = lay_map[path['layer']]
cur_path = gdspy.Polygon(path['polygon_points'], layer=lay_id, datatype=purp_id)
gds_cell.add(cur_path.fracture(precision=res, max_points=max_points_per_polygon))
for blockage in content_list.blockage_list:
pass
for boundary in content_list.boundary_list:
pass
for polygon in content_list.polygon_list:
lay_id, purp_id = lay_map[polygon['layer']]
cur_poly = gdspy.Polygon(polygon['points'], layer=lay_id, datatype=purp_id)
gds_cell.add(cur_poly.fracture(precision=res, max_points=max_points_per_polygon))
for round_obj in content_list.round_list:
nx, ny = round_obj.get('arr_nx', 1), round_obj.get('arr_ny', 1)
lay_id, purp_id = lay_map[tuple(round_obj['layer'])]
x0, y0 = round_obj['center']
if nx > 1 or ny > 1:
spx, spy = round_obj['arr_spx'], round_obj['arr_spy']
for xidx in range(nx):
dx = xidx * spx
for yidx in range(ny):
dy = yidx * spy
cur_round = gdspy.Round((x0 + dx, y0 + dy), radius=round_obj['rout'],
inner_radius=round_obj['rin'],
initial_angle=round_obj['theta0'] * pi / 180,
final_angle=round_obj['theta1'] * pi / 180,
tolerance=self.grid.resolution,
layer=lay_id, datatype=purp_id)
gds_cell.add(cur_round)
else:
cur_round = gdspy.Round((x0, y0), radius=round_obj['rout'],
inner_radius=round_obj['rin'],
initial_angle=round_obj['theta0'] * pi / 180,
final_angle=round_obj['theta1'] * pi / 180,
tolerance=self.grid.resolution,
> layer=lay_id, datatype=purp_id)
E TypeError: __init__() got an unexpected keyword argument 'tolerance'
BPG/BPG/gds/core.py:185: TypeError
----------------------------- Captured stdout call -----------------------------
*WARNING* Cannot find file: /buildbot/runtests/build/workdir/BAG_server_port.txt
Setting up tech info class
Loading layermap from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/gds_map.yaml
Loading lumerical export config from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/lumerical_map.yaml
Loading dataprep procedure from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_routine.yaml
Loading dataprep parameters from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_parameters.yaml
----------------------------- Captured stderr call -----------------------------
##########################
Starting BPG Build
2019-06-04 19:54:44.185334
##########################
PhotonicCoreLayout initialized from spec file: BPG/tests/specs/add_round_specs.yaml
loading layermap from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/gds_map.yaml
loading dataprep procedure from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_routine.yaml
loading dataprep and DRC parameters from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_parameters.yaml
loading lumerical export configuration from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/lumerical_map.yaml
loaded paths successfully
------------------------------Generating template-------------------------------
0.0052433 | AddRound Template generation
----------------------------Generating content list-----------------------------
-------------------------------Save content list--------------------------------
Saving content list: content_list : 0.000928402s
0.00150895 | Content list creation
0.000200748 | - Content list generation
0.0013082 | - Content list saving
--------------------------------Generating .gds---------------------------------
In PhotonicTemplateDB._create_gds
Instantiating gds layout
________________________________ test_dataprep _________________________________
def test_dataprep():
# spec_file = 'BPG/tests/specs/dataprep_debug_specs.yaml'
spec_file = 'BPG/tests/specs/dataprep_specs.yaml'
plm = BPG.PhotonicLayoutManager(spec_file)
plm.generate_content()
> plm.generate_gds()
BPG/tests/test_dataprep_generic.py:227:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
BPG/BPG/layout_manager.py:223: in generate_gds
max_points_per_polygon=max_points_per_polygon)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <BPG.gds.core.GDSPlugin object at 0xffff902b2898>
content_lists = [ContentList for cell_name=DataprepShapes_4, ContentList for cell_name=DataprepShapes_3, ContentList for cell_name=Dat...t for cell_name=DataprepShapes_2, ContentList for cell_name=DataprepShapes_1, ContentList for cell_name=Top_Level_Cell]
name_append = '', max_points_per_polygon = 199, write_gds = True
def export_content_list(self,
content_lists: List["ContentList"],
name_append: str = '',
max_points_per_polygon: Optional[int] = None,
write_gds: bool = True,
):
"""
Exports the physical design to GDS
Parameters
----------
content_lists : List[ContentList]
A list of ContentList objects that represent the layout.
name_append : str
A suffix to add to the end of the generated gds filename
max_points_per_polygon : Optional[int]
Maximum number of points allowed per polygon shape in the gds.
Defaults to value set in the init of GDSPlugin if not specified.
write_gds : bool
Default True. True to write out the gds file.
False to create the gdspy object, but not write out the gds.
"""
logging.info(f'In PhotonicTemplateDB._create_gds')
tech_info = self.grid.tech_info
lay_unit = tech_info.layout_unit
res = tech_info.resolution
if not max_points_per_polygon:
max_points_per_polygon = self.max_points_per_polygon
with open(self.gds_layermap, 'r') as f:
lay_info = yaml.load(f)
lay_map = lay_info['layer_map']
via_info = lay_info['via_info']
# TODO: fix
out_fname = self.gds_filepath + f'{name_append}.gds'
gds_lib = gdspy.GdsLibrary(name=self.lib_name, unit=lay_unit, precision=res * lay_unit)
cell_dict = gds_lib.cell_dict
logging.info(f'Instantiating gds layout')
start = time.time()
for content_list in content_lists:
gds_cell = gdspy.Cell(content_list.cell_name, exclude_from_current=True)
gds_lib.add(gds_cell)
# add instances
for inst_info in content_list.inst_list: # type: InstanceInfo
if inst_info.params is not None:
raise ValueError('Cannot instantiate PCells in GDS.')
num_rows = inst_info.num_rows
num_cols = inst_info.num_cols
angle, reflect = inst_info.angle_reflect
if num_rows > 1 or num_cols > 1:
cur_inst = gdspy.CellArray(cell_dict[inst_info.cell], num_cols, num_rows,
(inst_info.sp_cols, inst_info.sp_rows),
origin=inst_info.loc, rotation=angle,
x_reflection=reflect)
else:
cur_inst = gdspy.CellReference(cell_dict[inst_info.cell], origin=inst_info.loc,
rotation=angle, x_reflection=reflect)
gds_cell.add(cur_inst)
# add rectangles
for rect in content_list.rect_list:
nx, ny = rect.get('arr_nx', 1), rect.get('arr_ny', 1)
(x0, y0), (x1, y1) = rect['bbox']
lay_id, purp_id = lay_map[tuple(rect['layer'])]
if nx > 1 or ny > 1:
spx, spy = rect['arr_spx'], rect['arr_spy']
for xidx in range(nx):
dx = xidx * spx
for yidx in range(ny):
dy = yidx * spy
cur_rect = gdspy.Rectangle((x0 + dx, y0 + dy), (x1 + dx, y1 + dy),
layer=lay_id, datatype=purp_id)
gds_cell.add(cur_rect)
else:
cur_rect = gdspy.Rectangle((x0, y0), (x1, y1), layer=lay_id, datatype=purp_id)
gds_cell.add(cur_rect)
# add vias
for via in content_list.via_list: # type: ViaInfo
via_lay_info = via_info[via.id]
nx, ny = via.arr_nx, via.arr_ny
x0, y0 = via.loc
if nx > 1 or ny > 1:
spx, spy = via.arr_spx, via.arr_spy
for xidx in range(nx):
xc = x0 + xidx * spx
for yidx in range(ny):
yc = y0 + yidx * spy
self._add_gds_via(gds_cell, via, lay_map, via_lay_info, xc, yc)
else:
self._add_gds_via(gds_cell, via, lay_map, via_lay_info, x0, y0)
# add pins
for pin in content_list.pin_list: # type: PinInfo
lay_id, purp_id = lay_map[pin.layer]
bbox = pin.bbox
label = pin.label
if pin.make_rect:
cur_rect = gdspy.Rectangle((bbox.left, bbox.bottom), (bbox.right, bbox.top),
layer=lay_id, datatype=purp_id)
gds_cell.add(cur_rect)
angle = 90 if bbox.height_unit > bbox.width_unit else 0
cur_lbl = gdspy.Label(label, (bbox.xc, bbox.yc), rotation=angle,
layer=lay_id, texttype=purp_id)
gds_cell.add(cur_lbl)
for path in content_list.path_list:
# Photonic paths should be treated like polygons
lay_id, purp_id = lay_map[path['layer']]
cur_path = gdspy.Polygon(path['polygon_points'], layer=lay_id, datatype=purp_id)
gds_cell.add(cur_path.fracture(precision=res, max_points=max_points_per_polygon))
for blockage in content_list.blockage_list:
pass
for boundary in content_list.boundary_list:
pass
for polygon in content_list.polygon_list:
lay_id, purp_id = lay_map[polygon['layer']]
cur_poly = gdspy.Polygon(polygon['points'], layer=lay_id, datatype=purp_id)
gds_cell.add(cur_poly.fracture(precision=res, max_points=max_points_per_polygon))
for round_obj in content_list.round_list:
nx, ny = round_obj.get('arr_nx', 1), round_obj.get('arr_ny', 1)
lay_id, purp_id = lay_map[tuple(round_obj['layer'])]
x0, y0 = round_obj['center']
if nx > 1 or ny > 1:
spx, spy = round_obj['arr_spx'], round_obj['arr_spy']
for xidx in range(nx):
dx = xidx * spx
for yidx in range(ny):
dy = yidx * spy
cur_round = gdspy.Round((x0 + dx, y0 + dy), radius=round_obj['rout'],
inner_radius=round_obj['rin'],
initial_angle=round_obj['theta0'] * pi / 180,
final_angle=round_obj['theta1'] * pi / 180,
tolerance=self.grid.resolution,
layer=lay_id, datatype=purp_id)
gds_cell.add(cur_round)
else:
cur_round = gdspy.Round((x0, y0), radius=round_obj['rout'],
inner_radius=round_obj['rin'],
initial_angle=round_obj['theta0'] * pi / 180,
final_angle=round_obj['theta1'] * pi / 180,
tolerance=self.grid.resolution,
> layer=lay_id, datatype=purp_id)
E TypeError: __init__() got an unexpected keyword argument 'tolerance'
BPG/BPG/gds/core.py:185: TypeError
----------------------------- Captured stdout call -----------------------------
*WARNING* Cannot find file: /buildbot/runtests/build/workdir/BAG_server_port.txt
Setting up tech info class
Loading layermap from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/gds_map.yaml
Loading lumerical export config from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/lumerical_map.yaml
Loading dataprep procedure from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_routine.yaml
Loading dataprep parameters from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_parameters.yaml
----------------------------- Captured stderr call -----------------------------
##########################
Starting BPG Build
2019-06-04 19:54:54.542275
##########################
PhotonicCoreLayout initialized from spec file: BPG/tests/specs/dataprep_specs.yaml
loading layermap from /buildbot/runtests/build/workdir/BPG/tests/specs/dataprep_layermap_op.yaml
loading dataprep procedure from /buildbot/runtests/build/workdir/BPG/tests/specs/dataprep_routine_op.yaml
loading dataprep and DRC parameters from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_parameters.yaml
loading lumerical export configuration from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/lumerical_map.yaml
loaded paths successfully
------------------------------Generating template-------------------------------
0.00705934 | DataprepOpsTest Template generation
----------------------------Generating content list-----------------------------
-------------------------------Save content list--------------------------------
Saving content list: content_list : 0.00260496s
0.0036478 | Content list creation
0.000603199 | - Content list generation
0.00304461 | - Content list saving
--------------------------------Generating .gds---------------------------------
In PhotonicTemplateDB._create_gds
Instantiating gds layout
________________________________ test_dataprep _________________________________
def test_dataprep():
spec_file = 'BPG/tests/specs/dataprep_specs_op.yaml'
plm = BPG.PhotonicLayoutManager(spec_file)
plm.generate_content()
> plm.generate_gds()
BPG/tests/test_dataprep_op.py:121:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
BPG/BPG/layout_manager.py:223: in generate_gds
max_points_per_polygon=max_points_per_polygon)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <BPG.gds.core.GDSPlugin object at 0xffff90337748>
content_lists = [ContentList for cell_name=DataprepShapes_4, ContentList for cell_name=DataprepShapes_3, ContentList for cell_name=Dat...t for cell_name=DataprepShapes_2, ContentList for cell_name=DataprepShapes_1, ContentList for cell_name=Top_Level_Cell]
name_append = '', max_points_per_polygon = 199, write_gds = True
def export_content_list(self,
content_lists: List["ContentList"],
name_append: str = '',
max_points_per_polygon: Optional[int] = None,
write_gds: bool = True,
):
"""
Exports the physical design to GDS
Parameters
----------
content_lists : List[ContentList]
A list of ContentList objects that represent the layout.
name_append : str
A suffix to add to the end of the generated gds filename
max_points_per_polygon : Optional[int]
Maximum number of points allowed per polygon shape in the gds.
Defaults to value set in the init of GDSPlugin if not specified.
write_gds : bool
Default True. True to write out the gds file.
False to create the gdspy object, but not write out the gds.
"""
logging.info(f'In PhotonicTemplateDB._create_gds')
tech_info = self.grid.tech_info
lay_unit = tech_info.layout_unit
res = tech_info.resolution
if not max_points_per_polygon:
max_points_per_polygon = self.max_points_per_polygon
with open(self.gds_layermap, 'r') as f:
lay_info = yaml.load(f)
lay_map = lay_info['layer_map']
via_info = lay_info['via_info']
# TODO: fix
out_fname = self.gds_filepath + f'{name_append}.gds'
gds_lib = gdspy.GdsLibrary(name=self.lib_name, unit=lay_unit, precision=res * lay_unit)
cell_dict = gds_lib.cell_dict
logging.info(f'Instantiating gds layout')
start = time.time()
for content_list in content_lists:
gds_cell = gdspy.Cell(content_list.cell_name, exclude_from_current=True)
gds_lib.add(gds_cell)
# add instances
for inst_info in content_list.inst_list: # type: InstanceInfo
if inst_info.params is not None:
raise ValueError('Cannot instantiate PCells in GDS.')
num_rows = inst_info.num_rows
num_cols = inst_info.num_cols
angle, reflect = inst_info.angle_reflect
if num_rows > 1 or num_cols > 1:
cur_inst = gdspy.CellArray(cell_dict[inst_info.cell], num_cols, num_rows,
(inst_info.sp_cols, inst_info.sp_rows),
origin=inst_info.loc, rotation=angle,
x_reflection=reflect)
else:
cur_inst = gdspy.CellReference(cell_dict[inst_info.cell], origin=inst_info.loc,
rotation=angle, x_reflection=reflect)
gds_cell.add(cur_inst)
# add rectangles
for rect in content_list.rect_list:
nx, ny = rect.get('arr_nx', 1), rect.get('arr_ny', 1)
(x0, y0), (x1, y1) = rect['bbox']
lay_id, purp_id = lay_map[tuple(rect['layer'])]
if nx > 1 or ny > 1:
spx, spy = rect['arr_spx'], rect['arr_spy']
for xidx in range(nx):
dx = xidx * spx
for yidx in range(ny):
dy = yidx * spy
cur_rect = gdspy.Rectangle((x0 + dx, y0 + dy), (x1 + dx, y1 + dy),
layer=lay_id, datatype=purp_id)
gds_cell.add(cur_rect)
else:
cur_rect = gdspy.Rectangle((x0, y0), (x1, y1), layer=lay_id, datatype=purp_id)
gds_cell.add(cur_rect)
# add vias
for via in content_list.via_list: # type: ViaInfo
via_lay_info = via_info[via.id]
nx, ny = via.arr_nx, via.arr_ny
x0, y0 = via.loc
if nx > 1 or ny > 1:
spx, spy = via.arr_spx, via.arr_spy
for xidx in range(nx):
xc = x0 + xidx * spx
for yidx in range(ny):
yc = y0 + yidx * spy
self._add_gds_via(gds_cell, via, lay_map, via_lay_info, xc, yc)
else:
self._add_gds_via(gds_cell, via, lay_map, via_lay_info, x0, y0)
# add pins
for pin in content_list.pin_list: # type: PinInfo
lay_id, purp_id = lay_map[pin.layer]
bbox = pin.bbox
label = pin.label
if pin.make_rect:
cur_rect = gdspy.Rectangle((bbox.left, bbox.bottom), (bbox.right, bbox.top),
layer=lay_id, datatype=purp_id)
gds_cell.add(cur_rect)
angle = 90 if bbox.height_unit > bbox.width_unit else 0
cur_lbl = gdspy.Label(label, (bbox.xc, bbox.yc), rotation=angle,
layer=lay_id, texttype=purp_id)
gds_cell.add(cur_lbl)
for path in content_list.path_list:
# Photonic paths should be treated like polygons
lay_id, purp_id = lay_map[path['layer']]
cur_path = gdspy.Polygon(path['polygon_points'], layer=lay_id, datatype=purp_id)
gds_cell.add(cur_path.fracture(precision=res, max_points=max_points_per_polygon))
for blockage in content_list.blockage_list:
pass
for boundary in content_list.boundary_list:
pass
for polygon in content_list.polygon_list:
lay_id, purp_id = lay_map[polygon['layer']]
cur_poly = gdspy.Polygon(polygon['points'], layer=lay_id, datatype=purp_id)
gds_cell.add(cur_poly.fracture(precision=res, max_points=max_points_per_polygon))
for round_obj in content_list.round_list:
nx, ny = round_obj.get('arr_nx', 1), round_obj.get('arr_ny', 1)
lay_id, purp_id = lay_map[tuple(round_obj['layer'])]
x0, y0 = round_obj['center']
if nx > 1 or ny > 1:
spx, spy = round_obj['arr_spx'], round_obj['arr_spy']
for xidx in range(nx):
dx = xidx * spx
for yidx in range(ny):
dy = yidx * spy
cur_round = gdspy.Round((x0 + dx, y0 + dy), radius=round_obj['rout'],
inner_radius=round_obj['rin'],
initial_angle=round_obj['theta0'] * pi / 180,
final_angle=round_obj['theta1'] * pi / 180,
tolerance=self.grid.resolution,
layer=lay_id, datatype=purp_id)
gds_cell.add(cur_round)
else:
cur_round = gdspy.Round((x0, y0), radius=round_obj['rout'],
inner_radius=round_obj['rin'],
initial_angle=round_obj['theta0'] * pi / 180,
final_angle=round_obj['theta1'] * pi / 180,
tolerance=self.grid.resolution,
> layer=lay_id, datatype=purp_id)
E TypeError: __init__() got an unexpected keyword argument 'tolerance'
BPG/BPG/gds/core.py:185: TypeError
----------------------------- Captured stdout call -----------------------------
*WARNING* Cannot find file: /buildbot/runtests/build/workdir/BAG_server_port.txt
Setting up tech info class
Loading layermap from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/gds_map.yaml
Loading lumerical export config from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/lumerical_map.yaml
Loading dataprep procedure from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_routine.yaml
Loading dataprep parameters from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_parameters.yaml
----------------------------- Captured stderr call -----------------------------
##########################
Starting BPG Build
2019-06-04 19:54:55.381973
##########################
PhotonicCoreLayout initialized from spec file: BPG/tests/specs/dataprep_specs_op.yaml
loading layermap from /buildbot/runtests/build/workdir/BPG/tests/specs/dataprep_layermap_op.yaml
loading dataprep procedure from /buildbot/runtests/build/workdir/BPG/tests/specs/dataprep_routine_op.yaml
loading dataprep and DRC parameters from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_parameters.yaml
loading lumerical export configuration from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/lumerical_map.yaml
loaded paths successfully
------------------------------Generating template-------------------------------
0.0069015 | DataprepOpsTest Template generation
----------------------------Generating content list-----------------------------
-------------------------------Save content list--------------------------------
Saving content list: content_list : 0.00263953s
0.00371599 | Content list creation
0.000657082 | - Content list generation
0.00305891 | - Content list saving
--------------------------------Generating .gds---------------------------------
In PhotonicTemplateDB._create_gds
Instantiating gds layout
=============================== warnings summary ===============================
tests/test_gds_import.py::TestGDSImport
cannot collect test class 'TestGDSImport' because it has a __init__ constructor
-- Docs: http://doc.pytest.org/en/latest/warnings.html
=============== 3 failed, 17 passed, 1 warnings in 31.08 seconds ===============
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 0 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/custom_log_name_test.txt for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
Step run_bpg_photonics_dev
failed with details below:
+ export BPG_DIR=/buildbot/runtests/build
+ BPG_DIR=/buildbot/runtests/build
+ /opt/run_bpg_photonics_dev.sh
+ mkdir -p workdir
+ cd workdir
+ '[' -z /buildbot/runtests/build ']'
+ '[' -z '' ']'
+ PHOTONICS_DEV_HASH=9a82057
+ rm -rf Photonics_Dev
+ git clone git@github.com:pvnbhargava/Photonics_Dev.git
Cloning into 'Photonics_Dev'...
+ cd Photonics_Dev
+ git checkout 9a82057
Note: checking out '9a82057'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
HEAD is now at 9a82057 Use ssh for BAG for now
+ git submodule update --init --recursive
Submodule 'BAG2_TEMPLATES_EC' (git@github.com:ucb-art/BAG2_TEMPLATES_EC.git) registered for path 'BAG2_TEMPLATES_EC'
Submodule 'BAG_framework' (git@github.com:ucb-art/BAG_framework.git) registered for path 'BAG_framework'
Submodule 'BPG' (git@github.com:pvnbhargava/BPG.git) registered for path 'BPG'
Submodule 'Photonic_Core_Layout' (git@github.com:pvnbhargava/Photonic_Core_Layout.git) registered for path 'Photonic_Core_Layout'
Submodule 'gdspy' (https://github.com/heitzmann/gdspy.git) registered for path 'gdspy'
Cloning into '/buildbot/runtests/build/workdir/Photonics_Dev/BAG2_TEMPLATES_EC'...
Cloning into '/buildbot/runtests/build/workdir/Photonics_Dev/BAG_framework'...
Cloning into '/buildbot/runtests/build/workdir/Photonics_Dev/BPG'...
Cloning into '/buildbot/runtests/build/workdir/Photonics_Dev/Photonic_Core_Layout'...
Cloning into '/buildbot/runtests/build/workdir/Photonics_Dev/gdspy'...
Submodule path 'BAG2_TEMPLATES_EC': checked out 'e79f54c8da5b16c1b02ba6483296883488b9a83a'
error: Server does not allow request for unadvertised object e2b2f54423735020be61f66a915b676da5c54797
Fetched in submodule path 'BAG_framework', but it did not contain e2b2f54423735020be61f66a915b676da5c54797. Direct fetching of that commit failed.
Step run_bpg_tests
failed with details below:
+ export BPG_DIR=/buildbot/runtests/build
+ BPG_DIR=/buildbot/runtests/build
+ /opt/run_bpg.sh
+ mkdir -p workdir
+ cd workdir
+ '[' -z /buildbot/runtests/build ']'
+ '[' -z '' ']'
+ BAG_HASH=e2b2f54
+ '[' -z '' ']'
+ BAG2_TEMPLATES_EC_HASH=e79f54c
+ '[' '!' -d BAG_framework ']'
+ pushd BAG_framework
+ git checkout e2b2f54
/buildbot/runtests/build/workdir/BAG_framework /buildbot/runtests/build/workdir
HEAD is now at e2b2f54 1. fix type-hinting warnings in Pycharm.
+ popd
/buildbot/runtests/build/workdir
+ '[' '!' -d BAG2_TEMPLATES_EC ']'
+ pushd BAG2_TEMPLATES_EC
+ git checkout e79f54c
/buildbot/runtests/build/workdir/BAG2_TEMPLATES_EC /buildbot/runtests/build/workdir
HEAD is now at e79f54c Merge pull request #2 from ucb-art/gf14_compatibility
+ popd
+ export BAG_WORK_DIR=/buildbot/runtests/build/workdir
+ BAG_WORK_DIR=/buildbot/runtests/build/workdir
+ export BAG_FRAMEWORK=/buildbot/runtests/build/workdir/BAG_framework
/buildbot/runtests/build/workdir
+ BAG_FRAMEWORK=/buildbot/runtests/build/workdir/BAG_framework
+ export BAG_TEMP_DIR=/buildbot/runtests/build/workdir/tmp
+ BAG_TEMP_DIR=/buildbot/runtests/build/workdir/tmp
+ export BAG_TECH_CONFIG_DIR=/buildbot/runtests/build/examples/tech/BAG_tech_files
+ BAG_TECH_CONFIG_DIR=/buildbot/runtests/build/examples/tech/BAG_tech_files
+ export PYTHONPATH=/buildbot/runtests/build/workdir/BAG_framework:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+ PYTHONPATH=/buildbot/runtests/build/workdir/BAG_framework:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+ mkdir -p /buildbot/runtests/build/workdir/tmp
+ rm -f BPG
+ ln -s /buildbot/runtests/build BPG
+ BPG/run_tests.py
============================= test session starts ==============================
platform linux -- Python 3.6.7, pytest-3.3.2, py-1.5.2, pluggy-0.6.0
rootdir: /buildbot/runtests/build/workdir/BPG, inifile:
collected 20 items
BPG/tests/test_add_rect.py . [ 5%]
BPG/tests/test_add_round.py F [ 10%]
BPG/tests/test_add_via_stack.py . [ 15%]
BPG/tests/test_anyangle.py .... [ 35%]
BPG/tests/test_anyangle_alignment.py . [ 40%]
BPG/tests/test_dataprep_generic.py F [ 45%]
BPG/tests/test_dataprep_op.py F [ 50%]
BPG/tests/test_dataprep_width_space.py . [ 55%]
BPG/tests/test_flatten.py . [ 60%]
BPG/tests/test_gds_import.py F [ 65%]
BPG/tests/test_logger.py .. [ 75%]
BPG/tests/test_lumerical_material_generator.py . [ 80%]
BPG/tests/test_path.py . [ 85%]
BPG/tests/test_port_extraction.py . [ 90%]
BPG/tests/test_sweep.py . [ 95%]
BPG/tests/test_wg_port.py . [100%]
=================================== FAILURES ===================================
________________________________ test_add_round ________________________________
def test_add_round():
spec_file = 'BPG/tests/specs/add_round_specs.yaml'
plm = BPG.PhotonicLayoutManager(spec_file)
plm.generate_content()
> plm.generate_gds()
BPG/tests/test_add_round.py:61:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
BPG/BPG/layout_manager.py:223: in generate_gds
max_points_per_polygon=max_points_per_polygon)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <BPG.gds.core.GDSPlugin object at 0xffff8d96cc18>
content_lists = [ContentList for cell_name=add_round_cell], name_append = ''
max_points_per_polygon = 199, write_gds = True
def export_content_list(self,
content_lists: List["ContentList"],
name_append: str = '',
max_points_per_polygon: Optional[int] = None,
write_gds: bool = True,
):
"""
Exports the physical design to GDS
Parameters
----------
content_lists : List[ContentList]
A list of ContentList objects that represent the layout.
name_append : str
A suffix to add to the end of the generated gds filename
max_points_per_polygon : Optional[int]
Maximum number of points allowed per polygon shape in the gds.
Defaults to value set in the init of GDSPlugin if not specified.
write_gds : bool
Default True. True to write out the gds file.
False to create the gdspy object, but not write out the gds.
"""
logging.info(f'In PhotonicTemplateDB._create_gds')
tech_info = self.grid.tech_info
lay_unit = tech_info.layout_unit
res = tech_info.resolution
if not max_points_per_polygon:
max_points_per_polygon = self.max_points_per_polygon
with open(self.gds_layermap, 'r') as f:
lay_info = yaml.load(f)
lay_map = lay_info['layer_map']
via_info = lay_info['via_info']
# TODO: fix
out_fname = self.gds_filepath + f'{name_append}.gds'
gds_lib = gdspy.GdsLibrary(name=self.lib_name, unit=lay_unit, precision=res * lay_unit)
cell_dict = gds_lib.cell_dict
logging.info(f'Instantiating gds layout')
start = time.time()
for content_list in content_lists:
gds_cell = gdspy.Cell(content_list.cell_name, exclude_from_current=True)
gds_lib.add(gds_cell)
# add instances
for inst_info in content_list.inst_list: # type: InstanceInfo
if inst_info.params is not None:
raise ValueError('Cannot instantiate PCells in GDS.')
num_rows = inst_info.num_rows
num_cols = inst_info.num_cols
angle, reflect = inst_info.angle_reflect
if num_rows > 1 or num_cols > 1:
cur_inst = gdspy.CellArray(cell_dict[inst_info.cell], num_cols, num_rows,
(inst_info.sp_cols, inst_info.sp_rows),
origin=inst_info.loc, rotation=angle,
x_reflection=reflect)
else:
cur_inst = gdspy.CellReference(cell_dict[inst_info.cell], origin=inst_info.loc,
rotation=angle, x_reflection=reflect)
gds_cell.add(cur_inst)
# add rectangles
for rect in content_list.rect_list:
nx, ny = rect.get('arr_nx', 1), rect.get('arr_ny', 1)
(x0, y0), (x1, y1) = rect['bbox']
lay_id, purp_id = lay_map[tuple(rect['layer'])]
if nx > 1 or ny > 1:
spx, spy = rect['arr_spx'], rect['arr_spy']
for xidx in range(nx):
dx = xidx * spx
for yidx in range(ny):
dy = yidx * spy
cur_rect = gdspy.Rectangle((x0 + dx, y0 + dy), (x1 + dx, y1 + dy),
layer=lay_id, datatype=purp_id)
gds_cell.add(cur_rect)
else:
cur_rect = gdspy.Rectangle((x0, y0), (x1, y1), layer=lay_id, datatype=purp_id)
gds_cell.add(cur_rect)
# add vias
for via in content_list.via_list: # type: ViaInfo
via_lay_info = via_info[via.id]
nx, ny = via.arr_nx, via.arr_ny
x0, y0 = via.loc
if nx > 1 or ny > 1:
spx, spy = via.arr_spx, via.arr_spy
for xidx in range(nx):
xc = x0 + xidx * spx
for yidx in range(ny):
yc = y0 + yidx * spy
self._add_gds_via(gds_cell, via, lay_map, via_lay_info, xc, yc)
else:
self._add_gds_via(gds_cell, via, lay_map, via_lay_info, x0, y0)
# add pins
for pin in content_list.pin_list: # type: PinInfo
lay_id, purp_id = lay_map[pin.layer]
bbox = pin.bbox
label = pin.label
if pin.make_rect:
cur_rect = gdspy.Rectangle((bbox.left, bbox.bottom), (bbox.right, bbox.top),
layer=lay_id, datatype=purp_id)
gds_cell.add(cur_rect)
angle = 90 if bbox.height_unit > bbox.width_unit else 0
cur_lbl = gdspy.Label(label, (bbox.xc, bbox.yc), rotation=angle,
layer=lay_id, texttype=purp_id)
gds_cell.add(cur_lbl)
for path in content_list.path_list:
# Photonic paths should be treated like polygons
lay_id, purp_id = lay_map[path['layer']]
cur_path = gdspy.Polygon(path['polygon_points'], layer=lay_id, datatype=purp_id)
gds_cell.add(cur_path.fracture(precision=res, max_points=max_points_per_polygon))
for blockage in content_list.blockage_list:
pass
for boundary in content_list.boundary_list:
pass
for polygon in content_list.polygon_list:
lay_id, purp_id = lay_map[polygon['layer']]
cur_poly = gdspy.Polygon(polygon['points'], layer=lay_id, datatype=purp_id)
gds_cell.add(cur_poly.fracture(precision=res, max_points=max_points_per_polygon))
for round_obj in content_list.round_list:
nx, ny = round_obj.get('arr_nx', 1), round_obj.get('arr_ny', 1)
lay_id, purp_id = lay_map[tuple(round_obj['layer'])]
x0, y0 = round_obj['center']
if nx > 1 or ny > 1:
spx, spy = round_obj['arr_spx'], round_obj['arr_spy']
for xidx in range(nx):
dx = xidx * spx
for yidx in range(ny):
dy = yidx * spy
cur_round = gdspy.Round((x0 + dx, y0 + dy), radius=round_obj['rout'],
inner_radius=round_obj['rin'],
initial_angle=round_obj['theta0'] * pi / 180,
final_angle=round_obj['theta1'] * pi / 180,
tolerance=self.grid.resolution,
layer=lay_id, datatype=purp_id)
gds_cell.add(cur_round)
else:
cur_round = gdspy.Round((x0, y0), radius=round_obj['rout'],
inner_radius=round_obj['rin'],
initial_angle=round_obj['theta0'] * pi / 180,
final_angle=round_obj['theta1'] * pi / 180,
tolerance=self.grid.resolution,
> layer=lay_id, datatype=purp_id)
E TypeError: __init__() got an unexpected keyword argument 'tolerance'
BPG/BPG/gds/core.py:185: TypeError
----------------------------- Captured stdout call -----------------------------
*WARNING* Cannot find file: /buildbot/runtests/build/workdir/BAG_server_port.txt
Setting up tech info class
Loading layermap from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/gds_map.yaml
Loading lumerical export config from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/lumerical_map.yaml
Loading dataprep procedure from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_routine.yaml
Loading dataprep parameters from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_parameters.yaml
----------------------------- Captured stderr call -----------------------------
##########################
Starting BPG Build
2019-06-10 21:15:36.347638
##########################
PhotonicCoreLayout initialized from spec file: BPG/tests/specs/add_round_specs.yaml
loading layermap from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/gds_map.yaml
loading dataprep procedure from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_routine.yaml
loading dataprep and DRC parameters from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_parameters.yaml
loading lumerical export configuration from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/lumerical_map.yaml
loaded paths successfully
------------------------------Generating template-------------------------------
0.00525236 | AddRound Template generation
----------------------------Generating content list-----------------------------
-------------------------------Save content list--------------------------------
Saving content list: content_list : 0.000935316s
0.00152826 | Content list creation
0.000202417 | - Content list generation
0.00132585 | - Content list saving
--------------------------------Generating .gds---------------------------------
In PhotonicTemplateDB._create_gds
Instantiating gds layout
________________________________ test_dataprep _________________________________
def test_dataprep():
# spec_file = 'BPG/tests/specs/dataprep_debug_specs.yaml'
spec_file = 'BPG/tests/specs/dataprep_specs.yaml'
plm = BPG.PhotonicLayoutManager(spec_file)
plm.generate_content()
> plm.generate_gds()
BPG/tests/test_dataprep_generic.py:227:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
BPG/BPG/layout_manager.py:223: in generate_gds
max_points_per_polygon=max_points_per_polygon)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <BPG.gds.core.GDSPlugin object at 0xffff8d945ba8>
content_lists = [ContentList for cell_name=DataprepShapes, ContentList for cell_name=DataprepShapes_2, ContentList for cell_name=Datap...t for cell_name=DataprepShapes_4, ContentList for cell_name=DataprepShapes_1, ContentList for cell_name=Top_Level_Cell]
name_append = '', max_points_per_polygon = 199, write_gds = True
def export_content_list(self,
content_lists: List["ContentList"],
name_append: str = '',
max_points_per_polygon: Optional[int] = None,
write_gds: bool = True,
):
"""
Exports the physical design to GDS
Parameters
----------
content_lists : List[ContentList]
A list of ContentList objects that represent the layout.
name_append : str
A suffix to add to the end of the generated gds filename
max_points_per_polygon : Optional[int]
Maximum number of points allowed per polygon shape in the gds.
Defaults to value set in the init of GDSPlugin if not specified.
write_gds : bool
Default True. True to write out the gds file.
False to create the gdspy object, but not write out the gds.
"""
logging.info(f'In PhotonicTemplateDB._create_gds')
tech_info = self.grid.tech_info
lay_unit = tech_info.layout_unit
res = tech_info.resolution
if not max_points_per_polygon:
max_points_per_polygon = self.max_points_per_polygon
with open(self.gds_layermap, 'r') as f:
lay_info = yaml.load(f)
lay_map = lay_info['layer_map']
via_info = lay_info['via_info']
# TODO: fix
out_fname = self.gds_filepath + f'{name_append}.gds'
gds_lib = gdspy.GdsLibrary(name=self.lib_name, unit=lay_unit, precision=res * lay_unit)
cell_dict = gds_lib.cell_dict
logging.info(f'Instantiating gds layout')
start = time.time()
for content_list in content_lists:
gds_cell = gdspy.Cell(content_list.cell_name, exclude_from_current=True)
gds_lib.add(gds_cell)
# add instances
for inst_info in content_list.inst_list: # type: InstanceInfo
if inst_info.params is not None:
raise ValueError('Cannot instantiate PCells in GDS.')
num_rows = inst_info.num_rows
num_cols = inst_info.num_cols
angle, reflect = inst_info.angle_reflect
if num_rows > 1 or num_cols > 1:
cur_inst = gdspy.CellArray(cell_dict[inst_info.cell], num_cols, num_rows,
(inst_info.sp_cols, inst_info.sp_rows),
origin=inst_info.loc, rotation=angle,
x_reflection=reflect)
else:
cur_inst = gdspy.CellReference(cell_dict[inst_info.cell], origin=inst_info.loc,
rotation=angle, x_reflection=reflect)
gds_cell.add(cur_inst)
# add rectangles
for rect in content_list.rect_list:
nx, ny = rect.get('arr_nx', 1), rect.get('arr_ny', 1)
(x0, y0), (x1, y1) = rect['bbox']
lay_id, purp_id = lay_map[tuple(rect['layer'])]
if nx > 1 or ny > 1:
spx, spy = rect['arr_spx'], rect['arr_spy']
for xidx in range(nx):
dx = xidx * spx
for yidx in range(ny):
dy = yidx * spy
cur_rect = gdspy.Rectangle((x0 + dx, y0 + dy), (x1 + dx, y1 + dy),
layer=lay_id, datatype=purp_id)
gds_cell.add(cur_rect)
else:
cur_rect = gdspy.Rectangle((x0, y0), (x1, y1), layer=lay_id, datatype=purp_id)
gds_cell.add(cur_rect)
# add vias
for via in content_list.via_list: # type: ViaInfo
via_lay_info = via_info[via.id]
nx, ny = via.arr_nx, via.arr_ny
x0, y0 = via.loc
if nx > 1 or ny > 1:
spx, spy = via.arr_spx, via.arr_spy
for xidx in range(nx):
xc = x0 + xidx * spx
for yidx in range(ny):
yc = y0 + yidx * spy
self._add_gds_via(gds_cell, via, lay_map, via_lay_info, xc, yc)
else:
self._add_gds_via(gds_cell, via, lay_map, via_lay_info, x0, y0)
# add pins
for pin in content_list.pin_list: # type: PinInfo
lay_id, purp_id = lay_map[pin.layer]
bbox = pin.bbox
label = pin.label
if pin.make_rect:
cur_rect = gdspy.Rectangle((bbox.left, bbox.bottom), (bbox.right, bbox.top),
layer=lay_id, datatype=purp_id)
gds_cell.add(cur_rect)
angle = 90 if bbox.height_unit > bbox.width_unit else 0
cur_lbl = gdspy.Label(label, (bbox.xc, bbox.yc), rotation=angle,
layer=lay_id, texttype=purp_id)
gds_cell.add(cur_lbl)
for path in content_list.path_list:
# Photonic paths should be treated like polygons
lay_id, purp_id = lay_map[path['layer']]
cur_path = gdspy.Polygon(path['polygon_points'], layer=lay_id, datatype=purp_id)
gds_cell.add(cur_path.fracture(precision=res, max_points=max_points_per_polygon))
for blockage in content_list.blockage_list:
pass
for boundary in content_list.boundary_list:
pass
for polygon in content_list.polygon_list:
lay_id, purp_id = lay_map[polygon['layer']]
cur_poly = gdspy.Polygon(polygon['points'], layer=lay_id, datatype=purp_id)
gds_cell.add(cur_poly.fracture(precision=res, max_points=max_points_per_polygon))
for round_obj in content_list.round_list:
nx, ny = round_obj.get('arr_nx', 1), round_obj.get('arr_ny', 1)
lay_id, purp_id = lay_map[tuple(round_obj['layer'])]
x0, y0 = round_obj['center']
if nx > 1 or ny > 1:
spx, spy = round_obj['arr_spx'], round_obj['arr_spy']
for xidx in range(nx):
dx = xidx * spx
for yidx in range(ny):
dy = yidx * spy
cur_round = gdspy.Round((x0 + dx, y0 + dy), radius=round_obj['rout'],
inner_radius=round_obj['rin'],
initial_angle=round_obj['theta0'] * pi / 180,
final_angle=round_obj['theta1'] * pi / 180,
tolerance=self.grid.resolution,
layer=lay_id, datatype=purp_id)
gds_cell.add(cur_round)
else:
cur_round = gdspy.Round((x0, y0), radius=round_obj['rout'],
inner_radius=round_obj['rin'],
initial_angle=round_obj['theta0'] * pi / 180,
final_angle=round_obj['theta1'] * pi / 180,
tolerance=self.grid.resolution,
> layer=lay_id, datatype=purp_id)
E TypeError: __init__() got an unexpected keyword argument 'tolerance'
BPG/BPG/gds/core.py:185: TypeError
----------------------------- Captured stdout call -----------------------------
*WARNING* Cannot find file: /buildbot/runtests/build/workdir/BAG_server_port.txt
Setting up tech info class
Loading layermap from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/gds_map.yaml
Loading lumerical export config from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/lumerical_map.yaml
Loading dataprep procedure from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_routine.yaml
Loading dataprep parameters from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_parameters.yaml
----------------------------- Captured stderr call -----------------------------
##########################
Starting BPG Build
2019-06-10 21:15:46.805650
##########################
PhotonicCoreLayout initialized from spec file: BPG/tests/specs/dataprep_specs.yaml
loading layermap from /buildbot/runtests/build/workdir/BPG/tests/specs/dataprep_layermap_op.yaml
loading dataprep procedure from /buildbot/runtests/build/workdir/BPG/tests/specs/dataprep_routine_op.yaml
loading dataprep and DRC parameters from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_parameters.yaml
loading lumerical export configuration from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/lumerical_map.yaml
loaded paths successfully
------------------------------Generating template-------------------------------
0.00690293 | DataprepOpsTest Template generation
----------------------------Generating content list-----------------------------
-------------------------------Save content list--------------------------------
Saving content list: content_list : 0.00266838s
0.00368333 | Content list creation
0.000615835 | - Content list generation
0.00306749 | - Content list saving
--------------------------------Generating .gds---------------------------------
In PhotonicTemplateDB._create_gds
Instantiating gds layout
________________________________ test_dataprep _________________________________
def test_dataprep():
spec_file = 'BPG/tests/specs/dataprep_specs_op.yaml'
plm = BPG.PhotonicLayoutManager(spec_file)
plm.generate_content()
> plm.generate_gds()
BPG/tests/test_dataprep_op.py:121:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
BPG/BPG/layout_manager.py:223: in generate_gds
max_points_per_polygon=max_points_per_polygon)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <BPG.gds.core.GDSPlugin object at 0xffff8d9fce80>
content_lists = [ContentList for cell_name=DataprepShapes, ContentList for cell_name=DataprepShapes_2, ContentList for cell_name=Datap...t for cell_name=DataprepShapes_4, ContentList for cell_name=DataprepShapes_1, ContentList for cell_name=Top_Level_Cell]
name_append = '', max_points_per_polygon = 199, write_gds = True
def export_content_list(self,
content_lists: List["ContentList"],
name_append: str = '',
max_points_per_polygon: Optional[int] = None,
write_gds: bool = True,
):
"""
Exports the physical design to GDS
Parameters
----------
content_lists : List[ContentList]
A list of ContentList objects that represent the layout.
name_append : str
A suffix to add to the end of the generated gds filename
max_points_per_polygon : Optional[int]
Maximum number of points allowed per polygon shape in the gds.
Defaults to value set in the init of GDSPlugin if not specified.
write_gds : bool
Default True. True to write out the gds file.
False to create the gdspy object, but not write out the gds.
"""
logging.info(f'In PhotonicTemplateDB._create_gds')
tech_info = self.grid.tech_info
lay_unit = tech_info.layout_unit
res = tech_info.resolution
if not max_points_per_polygon:
max_points_per_polygon = self.max_points_per_polygon
with open(self.gds_layermap, 'r') as f:
lay_info = yaml.load(f)
lay_map = lay_info['layer_map']
via_info = lay_info['via_info']
# TODO: fix
out_fname = self.gds_filepath + f'{name_append}.gds'
gds_lib = gdspy.GdsLibrary(name=self.lib_name, unit=lay_unit, precision=res * lay_unit)
cell_dict = gds_lib.cell_dict
logging.info(f'Instantiating gds layout')
start = time.time()
for content_list in content_lists:
gds_cell = gdspy.Cell(content_list.cell_name, exclude_from_current=True)
gds_lib.add(gds_cell)
# add instances
for inst_info in content_list.inst_list: # type: InstanceInfo
if inst_info.params is not None:
raise ValueError('Cannot instantiate PCells in GDS.')
num_rows = inst_info.num_rows
num_cols = inst_info.num_cols
angle, reflect = inst_info.angle_reflect
if num_rows > 1 or num_cols > 1:
cur_inst = gdspy.CellArray(cell_dict[inst_info.cell], num_cols, num_rows,
(inst_info.sp_cols, inst_info.sp_rows),
origin=inst_info.loc, rotation=angle,
x_reflection=reflect)
else:
cur_inst = gdspy.CellReference(cell_dict[inst_info.cell], origin=inst_info.loc,
rotation=angle, x_reflection=reflect)
gds_cell.add(cur_inst)
# add rectangles
for rect in content_list.rect_list:
nx, ny = rect.get('arr_nx', 1), rect.get('arr_ny', 1)
(x0, y0), (x1, y1) = rect['bbox']
lay_id, purp_id = lay_map[tuple(rect['layer'])]
if nx > 1 or ny > 1:
spx, spy = rect['arr_spx'], rect['arr_spy']
for xidx in range(nx):
dx = xidx * spx
for yidx in range(ny):
dy = yidx * spy
cur_rect = gdspy.Rectangle((x0 + dx, y0 + dy), (x1 + dx, y1 + dy),
layer=lay_id, datatype=purp_id)
gds_cell.add(cur_rect)
else:
cur_rect = gdspy.Rectangle((x0, y0), (x1, y1), layer=lay_id, datatype=purp_id)
gds_cell.add(cur_rect)
# add vias
for via in content_list.via_list: # type: ViaInfo
via_lay_info = via_info[via.id]
nx, ny = via.arr_nx, via.arr_ny
x0, y0 = via.loc
if nx > 1 or ny > 1:
spx, spy = via.arr_spx, via.arr_spy
for xidx in range(nx):
xc = x0 + xidx * spx
for yidx in range(ny):
yc = y0 + yidx * spy
self._add_gds_via(gds_cell, via, lay_map, via_lay_info, xc, yc)
else:
self._add_gds_via(gds_cell, via, lay_map, via_lay_info, x0, y0)
# add pins
for pin in content_list.pin_list: # type: PinInfo
lay_id, purp_id = lay_map[pin.layer]
bbox = pin.bbox
label = pin.label
if pin.make_rect:
cur_rect = gdspy.Rectangle((bbox.left, bbox.bottom), (bbox.right, bbox.top),
layer=lay_id, datatype=purp_id)
gds_cell.add(cur_rect)
angle = 90 if bbox.height_unit > bbox.width_unit else 0
cur_lbl = gdspy.Label(label, (bbox.xc, bbox.yc), rotation=angle,
layer=lay_id, texttype=purp_id)
gds_cell.add(cur_lbl)
for path in content_list.path_list:
# Photonic paths should be treated like polygons
lay_id, purp_id = lay_map[path['layer']]
cur_path = gdspy.Polygon(path['polygon_points'], layer=lay_id, datatype=purp_id)
gds_cell.add(cur_path.fracture(precision=res, max_points=max_points_per_polygon))
for blockage in content_list.blockage_list:
pass
for boundary in content_list.boundary_list:
pass
for polygon in content_list.polygon_list:
lay_id, purp_id = lay_map[polygon['layer']]
cur_poly = gdspy.Polygon(polygon['points'], layer=lay_id, datatype=purp_id)
gds_cell.add(cur_poly.fracture(precision=res, max_points=max_points_per_polygon))
for round_obj in content_list.round_list:
nx, ny = round_obj.get('arr_nx', 1), round_obj.get('arr_ny', 1)
lay_id, purp_id = lay_map[tuple(round_obj['layer'])]
x0, y0 = round_obj['center']
if nx > 1 or ny > 1:
spx, spy = round_obj['arr_spx'], round_obj['arr_spy']
for xidx in range(nx):
dx = xidx * spx
for yidx in range(ny):
dy = yidx * spy
cur_round = gdspy.Round((x0 + dx, y0 + dy), radius=round_obj['rout'],
inner_radius=round_obj['rin'],
initial_angle=round_obj['theta0'] * pi / 180,
final_angle=round_obj['theta1'] * pi / 180,
tolerance=self.grid.resolution,
layer=lay_id, datatype=purp_id)
gds_cell.add(cur_round)
else:
cur_round = gdspy.Round((x0, y0), radius=round_obj['rout'],
inner_radius=round_obj['rin'],
initial_angle=round_obj['theta0'] * pi / 180,
final_angle=round_obj['theta1'] * pi / 180,
tolerance=self.grid.resolution,
> layer=lay_id, datatype=purp_id)
E TypeError: __init__() got an unexpected keyword argument 'tolerance'
BPG/BPG/gds/core.py:185: TypeError
----------------------------- Captured stdout call -----------------------------
*WARNING* Cannot find file: /buildbot/runtests/build/workdir/BAG_server_port.txt
Setting up tech info class
Loading layermap from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/gds_map.yaml
Loading lumerical export config from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/lumerical_map.yaml
Loading dataprep procedure from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_routine.yaml
Loading dataprep parameters from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_parameters.yaml
----------------------------- Captured stderr call -----------------------------
##########################
Starting BPG Build
2019-06-10 21:15:47.648176
##########################
PhotonicCoreLayout initialized from spec file: BPG/tests/specs/dataprep_specs_op.yaml
loading layermap from /buildbot/runtests/build/workdir/BPG/tests/specs/dataprep_layermap_op.yaml
loading dataprep procedure from /buildbot/runtests/build/workdir/BPG/tests/specs/dataprep_routine_op.yaml
loading dataprep and DRC parameters from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_parameters.yaml
loading lumerical export configuration from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/lumerical_map.yaml
loaded paths successfully
------------------------------Generating template-------------------------------
0.00707412 | DataprepOpsTest Template generation
----------------------------Generating content list-----------------------------
-------------------------------Save content list--------------------------------
Saving content list: content_list : 0.00274849s
0.00384498 | Content list creation
0.000622034 | - Content list generation
0.00322294 | - Content list saving
--------------------------------Generating .gds---------------------------------
In PhotonicTemplateDB._create_gds
Instantiating gds layout
_______________________________ test_gds_import ________________________________
def test_gds_import():
spec_file = 'BPG/tests/specs/gds_import.yaml'
plm = BPG.PhotonicLayoutManager(spec_file)
> plm.generate_content()
BPG/tests/test_gds_import.py:23:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
BPG/BPG/layout_manager.py:190: in generate_content
self.generate_template()
BPG/BPG/layout_manager.py:170: in generate_template
debug=False))
BAG_framework/bag/layout/template.py:263: in new_template
gen_cls=temp_cls, debug=debug, **kwargs)
BAG_framework/bag/util/cache.py:635: in new_master
master.finalize()
BPG/BPG/template.py:254: in finalize
TemplateBase.finalize(self)
BAG_framework/bag/layout/template.py:631: in finalize
self.draw_layout()
BPG/tests/test_gds_import.py:16: in draw_layout
master = self.new_template(params=self.params, temp_cls=GDSImport)
BAG_framework/bag/layout/template.py:1193: in new_template
**kwargs)
BAG_framework/bag/layout/template.py:263: in new_template
gen_cls=temp_cls, debug=debug, **kwargs)
BAG_framework/bag/util/cache.py:635: in new_master
master.finalize()
BPG/BPG/template.py:254: in finalize
TemplateBase.finalize(self)
BAG_framework/bag/layout/template.py:631: in finalize
self.draw_layout()
BPG/BPG/gds/io.py:31: in draw_layout
self.import_content_from_gds(self.params['gds_path'])
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <BPG.gds.io.GDSImport object at 0xffff8d99ce80>
gds_filepath = 'gen_libs/bpg_test_suite/data/any_angle_alignment.gds'
def import_content_from_gds(self,
gds_filepath: str
):
"""
Read a GDS and copy all of the polygons into this master
gdspy turns all input shapes into polygons, so we only need to care about importing into
the polygon list. Currently we only import labels at the top level of the hierarchy
Parameters
----------
gds_filepath : str
Path to the gds to be imported
"""
# Import information from the layermap
with open(self.gds_layermap, 'r') as f:
lay_info = yaml.load(f)
lay_map = lay_info['layer_map']
# Import the GDS from the file
gds_lib = gdspy.GdsLibrary()
gds_lib.read_gds(infile=gds_filepath, units='convert')
# Get the top cell in the GDS and flatten its contents
top_cell = gds_lib.top_level()
if len(top_cell) != 1:
raise ValueError("Cannot import a GDS with multiple top level cells")
top_cell = top_cell[0] # top_cell returns a list, so just grab the only element
top_cell.flatten()
# TODO: This currently accesses an internal attr polygons, instead of the get_polygons() method, may be unstable
> for polyset in top_cell.polygons:
E AttributeError: 'Cell' object has no attribute 'polygons'
BPG/BPG/gds/io.py:64: AttributeError
----------------------------- Captured stdout call -----------------------------
*WARNING* Cannot find file: /buildbot/runtests/build/workdir/BAG_server_port.txt
Setting up tech info class
Loading layermap from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/gds_map.yaml
Loading lumerical export config from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/lumerical_map.yaml
Loading dataprep procedure from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_routine.yaml
Loading dataprep parameters from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_parameters.yaml
----------------------------- Captured stderr call -----------------------------
##########################
Starting BPG Build
2019-06-10 21:15:51.018410
##########################
PhotonicCoreLayout initialized from spec file: BPG/tests/specs/gds_import.yaml
loading layermap from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/gds_map.yaml
loading dataprep procedure from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_routine.yaml
loading dataprep and DRC parameters from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_parameters.yaml
loading lumerical export configuration from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/lumerical_map.yaml
loaded paths successfully
------------------------------Generating template-------------------------------
=============================== warnings summary ===============================
tests/test_gds_import.py::TestGDSImport
cannot collect test class 'TestGDSImport' because it has a __init__ constructor
-- Docs: http://doc.pytest.org/en/latest/warnings.html
=============== 4 failed, 16 passed, 1 warnings in 31.96 seconds ===============
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 0 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/custom_log_name_test.txt for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
Step run_bpg_photonics_dev
failed with details below:
+ export BPG_DIR=/buildbot/runtests/build
+ BPG_DIR=/buildbot/runtests/build
+ /opt/run_bpg_photonics_dev.sh
+ mkdir -p workdir
+ cd workdir
+ '[' -z /buildbot/runtests/build ']'
+ '[' -z '' ']'
+ PHOTONICS_DEV_HASH=9a82057
+ rm -rf Photonics_Dev
+ git clone git@github.com:pvnbhargava/Photonics_Dev.git
Cloning into 'Photonics_Dev'...
+ cd Photonics_Dev
+ git checkout 9a82057
Note: checking out '9a82057'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
HEAD is now at 9a82057 Use ssh for BAG for now
+ git submodule update --init --recursive
Submodule 'BAG2_TEMPLATES_EC' (git@github.com:ucb-art/BAG2_TEMPLATES_EC.git) registered for path 'BAG2_TEMPLATES_EC'
Submodule 'BAG_framework' (git@github.com:ucb-art/BAG_framework.git) registered for path 'BAG_framework'
Submodule 'BPG' (git@github.com:pvnbhargava/BPG.git) registered for path 'BPG'
Submodule 'Photonic_Core_Layout' (git@github.com:pvnbhargava/Photonic_Core_Layout.git) registered for path 'Photonic_Core_Layout'
Submodule 'gdspy' (https://github.com/heitzmann/gdspy.git) registered for path 'gdspy'
Cloning into '/buildbot/runtests/build/workdir/Photonics_Dev/BAG2_TEMPLATES_EC'...
Cloning into '/buildbot/runtests/build/workdir/Photonics_Dev/BAG_framework'...
Cloning into '/buildbot/runtests/build/workdir/Photonics_Dev/BPG'...
Cloning into '/buildbot/runtests/build/workdir/Photonics_Dev/Photonic_Core_Layout'...
Cloning into '/buildbot/runtests/build/workdir/Photonics_Dev/gdspy'...
Submodule path 'BAG2_TEMPLATES_EC': checked out 'e79f54c8da5b16c1b02ba6483296883488b9a83a'
error: Server does not allow request for unadvertised object e2b2f54423735020be61f66a915b676da5c54797
Fetched in submodule path 'BAG_framework', but it did not contain e2b2f54423735020be61f66a915b676da5c54797. Direct fetching of that commit failed.
I am pulling. This is a buildbot gdspy version issue.
Step run_bpg_tests
failed with details below:
+ export BPG_DIR=/buildbot/runtests/build
+ BPG_DIR=/buildbot/runtests/build
+ /opt/run_bpg.sh
+ mkdir -p workdir
+ cd workdir
+ '[' -z /buildbot/runtests/build ']'
+ '[' -z '' ']'
+ BAG_HASH=e2b2f54
+ '[' -z '' ']'
+ BAG2_TEMPLATES_EC_HASH=e79f54c
+ '[' '!' -d BAG_framework ']'
+ pushd BAG_framework
+ git checkout e2b2f54
/buildbot/runtests/build/workdir/BAG_framework /buildbot/runtests/build/workdir
HEAD is now at e2b2f54 1. fix type-hinting warnings in Pycharm.
+ popd
/buildbot/runtests/build/workdir
+ '[' '!' -d BAG2_TEMPLATES_EC ']'
+ pushd BAG2_TEMPLATES_EC
+ git checkout e79f54c
/buildbot/runtests/build/workdir/BAG2_TEMPLATES_EC /buildbot/runtests/build/workdir
HEAD is now at e79f54c Merge pull request #2 from ucb-art/gf14_compatibility
+ popd
+ export BAG_WORK_DIR=/buildbot/runtests/build/workdir
+ BAG_WORK_DIR=/buildbot/runtests/build/workdir
+ export BAG_FRAMEWORK=/buildbot/runtests/build/workdir/BAG_framework
/buildbot/runtests/build/workdir
+ BAG_FRAMEWORK=/buildbot/runtests/build/workdir/BAG_framework
+ export BAG_TEMP_DIR=/buildbot/runtests/build/workdir/tmp
+ BAG_TEMP_DIR=/buildbot/runtests/build/workdir/tmp
+ export BAG_TECH_CONFIG_DIR=/buildbot/runtests/build/examples/tech/BAG_tech_files
+ BAG_TECH_CONFIG_DIR=/buildbot/runtests/build/examples/tech/BAG_tech_files
+ export PYTHONPATH=/buildbot/runtests/build/workdir/BAG_framework:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+ PYTHONPATH=/buildbot/runtests/build/workdir/BAG_framework:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+ mkdir -p /buildbot/runtests/build/workdir/tmp
+ rm -f BPG
+ ln -s /buildbot/runtests/build BPG
+ BPG/run_tests.py
============================= test session starts ==============================
platform linux -- Python 3.6.7, pytest-3.3.2, py-1.5.2, pluggy-0.6.0
rootdir: /buildbot/runtests/build/workdir/BPG, inifile:
collected 20 items
BPG/tests/test_add_rect.py . [ 5%]
BPG/tests/test_add_round.py F [ 10%]
BPG/tests/test_add_via_stack.py . [ 15%]
BPG/tests/test_anyangle.py .... [ 35%]
BPG/tests/test_anyangle_alignment.py . [ 40%]
BPG/tests/test_dataprep_generic.py F [ 45%]
BPG/tests/test_dataprep_op.py F [ 50%]
BPG/tests/test_dataprep_width_space.py . [ 55%]
BPG/tests/test_flatten.py . [ 60%]
BPG/tests/test_gds_import.py F [ 65%]
BPG/tests/test_logger.py .. [ 75%]
BPG/tests/test_lumerical_material_generator.py . [ 80%]
BPG/tests/test_path.py . [ 85%]
BPG/tests/test_port_extraction.py . [ 90%]
BPG/tests/test_sweep.py . [ 95%]
BPG/tests/test_wg_port.py . [100%]
=================================== FAILURES ===================================
________________________________ test_add_round ________________________________
def test_add_round():
spec_file = 'BPG/tests/specs/add_round_specs.yaml'
plm = BPG.PhotonicLayoutManager(spec_file)
plm.generate_content()
> plm.generate_gds()
BPG/tests/test_add_round.py:61:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
BPG/BPG/layout_manager.py:223: in generate_gds
max_points_per_polygon=max_points_per_polygon)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <BPG.gds.core.GDSPlugin object at 0xffffa2155b38>
content_lists = [ContentList for cell_name=add_round_cell], name_append = ''
max_points_per_polygon = 199, write_gds = True
def export_content_list(self,
content_lists: List["ContentList"],
name_append: str = '',
max_points_per_polygon: Optional[int] = None,
write_gds: bool = True,
):
"""
Exports the physical design to GDS
Parameters
----------
content_lists : List[ContentList]
A list of ContentList objects that represent the layout.
name_append : str
A suffix to add to the end of the generated gds filename
max_points_per_polygon : Optional[int]
Maximum number of points allowed per polygon shape in the gds.
Defaults to value set in the init of GDSPlugin if not specified.
write_gds : bool
Default True. True to write out the gds file.
False to create the gdspy object, but not write out the gds.
"""
logging.info(f'In PhotonicTemplateDB._create_gds')
tech_info = self.grid.tech_info
lay_unit = tech_info.layout_unit
res = tech_info.resolution
if not max_points_per_polygon:
max_points_per_polygon = self.max_points_per_polygon
with open(self.gds_layermap, 'r') as f:
lay_info = yaml.load(f)
lay_map = lay_info['layer_map']
via_info = lay_info['via_info']
# TODO: fix
out_fname = self.gds_filepath + f'{name_append}.gds'
gds_lib = gdspy.GdsLibrary(name=self.lib_name, unit=lay_unit, precision=res * lay_unit)
cell_dict = gds_lib.cell_dict
logging.info(f'Instantiating gds layout')
start = time.time()
for content_list in content_lists:
gds_cell = gdspy.Cell(content_list.cell_name, exclude_from_current=True)
gds_lib.add(gds_cell)
# add instances
for inst_info in content_list.inst_list: # type: InstanceInfo
if inst_info.params is not None:
raise ValueError('Cannot instantiate PCells in GDS.')
num_rows = inst_info.num_rows
num_cols = inst_info.num_cols
angle, reflect = inst_info.angle_reflect
if num_rows > 1 or num_cols > 1:
cur_inst = gdspy.CellArray(cell_dict[inst_info.cell], num_cols, num_rows,
(inst_info.sp_cols, inst_info.sp_rows),
origin=inst_info.loc, rotation=angle,
x_reflection=reflect)
else:
cur_inst = gdspy.CellReference(cell_dict[inst_info.cell], origin=inst_info.loc,
rotation=angle, x_reflection=reflect)
gds_cell.add(cur_inst)
# add rectangles
for rect in content_list.rect_list:
nx, ny = rect.get('arr_nx', 1), rect.get('arr_ny', 1)
(x0, y0), (x1, y1) = rect['bbox']
lay_id, purp_id = lay_map[tuple(rect['layer'])]
if nx > 1 or ny > 1:
spx, spy = rect['arr_spx'], rect['arr_spy']
for xidx in range(nx):
dx = xidx * spx
for yidx in range(ny):
dy = yidx * spy
cur_rect = gdspy.Rectangle((x0 + dx, y0 + dy), (x1 + dx, y1 + dy),
layer=lay_id, datatype=purp_id)
gds_cell.add(cur_rect)
else:
cur_rect = gdspy.Rectangle((x0, y0), (x1, y1), layer=lay_id, datatype=purp_id)
gds_cell.add(cur_rect)
# add vias
for via in content_list.via_list: # type: ViaInfo
via_lay_info = via_info[via.id]
nx, ny = via.arr_nx, via.arr_ny
x0, y0 = via.loc
if nx > 1 or ny > 1:
spx, spy = via.arr_spx, via.arr_spy
for xidx in range(nx):
xc = x0 + xidx * spx
for yidx in range(ny):
yc = y0 + yidx * spy
self._add_gds_via(gds_cell, via, lay_map, via_lay_info, xc, yc)
else:
self._add_gds_via(gds_cell, via, lay_map, via_lay_info, x0, y0)
# add pins
for pin in content_list.pin_list: # type: PinInfo
lay_id, purp_id = lay_map[pin.layer]
bbox = pin.bbox
label = pin.label
if pin.make_rect:
cur_rect = gdspy.Rectangle((bbox.left, bbox.bottom), (bbox.right, bbox.top),
layer=lay_id, datatype=purp_id)
gds_cell.add(cur_rect)
angle = 90 if bbox.height_unit > bbox.width_unit else 0
cur_lbl = gdspy.Label(label, (bbox.xc, bbox.yc), rotation=angle,
layer=lay_id, texttype=purp_id)
gds_cell.add(cur_lbl)
for path in content_list.path_list:
# Photonic paths should be treated like polygons
lay_id, purp_id = lay_map[path['layer']]
cur_path = gdspy.Polygon(path['polygon_points'], layer=lay_id, datatype=purp_id)
gds_cell.add(cur_path.fracture(precision=res, max_points=max_points_per_polygon))
for blockage in content_list.blockage_list:
pass
for boundary in content_list.boundary_list:
pass
for polygon in content_list.polygon_list:
lay_id, purp_id = lay_map[polygon['layer']]
cur_poly = gdspy.Polygon(polygon['points'], layer=lay_id, datatype=purp_id)
gds_cell.add(cur_poly.fracture(precision=res, max_points=max_points_per_polygon))
for round_obj in content_list.round_list:
nx, ny = round_obj.get('arr_nx', 1), round_obj.get('arr_ny', 1)
lay_id, purp_id = lay_map[tuple(round_obj['layer'])]
x0, y0 = round_obj['center']
if nx > 1 or ny > 1:
spx, spy = round_obj['arr_spx'], round_obj['arr_spy']
for xidx in range(nx):
dx = xidx * spx
for yidx in range(ny):
dy = yidx * spy
cur_round = gdspy.Round((x0 + dx, y0 + dy), radius=round_obj['rout'],
inner_radius=round_obj['rin'],
initial_angle=round_obj['theta0'] * pi / 180,
final_angle=round_obj['theta1'] * pi / 180,
tolerance=self.grid.resolution,
layer=lay_id, datatype=purp_id)
gds_cell.add(cur_round)
else:
cur_round = gdspy.Round((x0, y0), radius=round_obj['rout'],
inner_radius=round_obj['rin'],
initial_angle=round_obj['theta0'] * pi / 180,
final_angle=round_obj['theta1'] * pi / 180,
tolerance=self.grid.resolution,
> layer=lay_id, datatype=purp_id)
E TypeError: __init__() got an unexpected keyword argument 'tolerance'
BPG/BPG/gds/core.py:185: TypeError
----------------------------- Captured stdout call -----------------------------
*WARNING* Cannot find file: /buildbot/runtests/build/workdir/BAG_server_port.txt
Setting up tech info class
Loading layermap from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/gds_map.yaml
Loading lumerical export config from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/lumerical_map.yaml
Loading dataprep procedure from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_routine.yaml
Loading dataprep parameters from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_parameters.yaml
----------------------------- Captured stderr call -----------------------------
##########################
Starting BPG Build
2019-06-10 21:18:16.299208
##########################
PhotonicCoreLayout initialized from spec file: BPG/tests/specs/add_round_specs.yaml
loading layermap from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/gds_map.yaml
loading dataprep procedure from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_routine.yaml
loading dataprep and DRC parameters from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_parameters.yaml
loading lumerical export configuration from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/lumerical_map.yaml
loaded paths successfully
------------------------------Generating template-------------------------------
0.00527644 | AddRound Template generation
----------------------------Generating content list-----------------------------
-------------------------------Save content list--------------------------------
Saving content list: content_list : 0.000983715s
0.00158596 | Content list creation
0.000201225 | - Content list generation
0.00138474 | - Content list saving
--------------------------------Generating .gds---------------------------------
In PhotonicTemplateDB._create_gds
Instantiating gds layout
________________________________ test_dataprep _________________________________
def test_dataprep():
# spec_file = 'BPG/tests/specs/dataprep_debug_specs.yaml'
spec_file = 'BPG/tests/specs/dataprep_specs.yaml'
plm = BPG.PhotonicLayoutManager(spec_file)
plm.generate_content()
> plm.generate_gds()
BPG/tests/test_dataprep_generic.py:227:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
BPG/BPG/layout_manager.py:223: in generate_gds
max_points_per_polygon=max_points_per_polygon)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <BPG.gds.core.GDSPlugin object at 0xffffa218d630>
content_lists = [ContentList for cell_name=DataprepShapes, ContentList for cell_name=DataprepShapes_3, ContentList for cell_name=Datap...t for cell_name=DataprepShapes_2, ContentList for cell_name=DataprepShapes_4, ContentList for cell_name=Top_Level_Cell]
name_append = '', max_points_per_polygon = 199, write_gds = True
def export_content_list(self,
content_lists: List["ContentList"],
name_append: str = '',
max_points_per_polygon: Optional[int] = None,
write_gds: bool = True,
):
"""
Exports the physical design to GDS
Parameters
----------
content_lists : List[ContentList]
A list of ContentList objects that represent the layout.
name_append : str
A suffix to add to the end of the generated gds filename
max_points_per_polygon : Optional[int]
Maximum number of points allowed per polygon shape in the gds.
Defaults to value set in the init of GDSPlugin if not specified.
write_gds : bool
Default True. True to write out the gds file.
False to create the gdspy object, but not write out the gds.
"""
logging.info(f'In PhotonicTemplateDB._create_gds')
tech_info = self.grid.tech_info
lay_unit = tech_info.layout_unit
res = tech_info.resolution
if not max_points_per_polygon:
max_points_per_polygon = self.max_points_per_polygon
with open(self.gds_layermap, 'r') as f:
lay_info = yaml.load(f)
lay_map = lay_info['layer_map']
via_info = lay_info['via_info']
# TODO: fix
out_fname = self.gds_filepath + f'{name_append}.gds'
gds_lib = gdspy.GdsLibrary(name=self.lib_name, unit=lay_unit, precision=res * lay_unit)
cell_dict = gds_lib.cell_dict
logging.info(f'Instantiating gds layout')
start = time.time()
for content_list in content_lists:
gds_cell = gdspy.Cell(content_list.cell_name, exclude_from_current=True)
gds_lib.add(gds_cell)
# add instances
for inst_info in content_list.inst_list: # type: InstanceInfo
if inst_info.params is not None:
raise ValueError('Cannot instantiate PCells in GDS.')
num_rows = inst_info.num_rows
num_cols = inst_info.num_cols
angle, reflect = inst_info.angle_reflect
if num_rows > 1 or num_cols > 1:
cur_inst = gdspy.CellArray(cell_dict[inst_info.cell], num_cols, num_rows,
(inst_info.sp_cols, inst_info.sp_rows),
origin=inst_info.loc, rotation=angle,
x_reflection=reflect)
else:
cur_inst = gdspy.CellReference(cell_dict[inst_info.cell], origin=inst_info.loc,
rotation=angle, x_reflection=reflect)
gds_cell.add(cur_inst)
# add rectangles
for rect in content_list.rect_list:
nx, ny = rect.get('arr_nx', 1), rect.get('arr_ny', 1)
(x0, y0), (x1, y1) = rect['bbox']
lay_id, purp_id = lay_map[tuple(rect['layer'])]
if nx > 1 or ny > 1:
spx, spy = rect['arr_spx'], rect['arr_spy']
for xidx in range(nx):
dx = xidx * spx
for yidx in range(ny):
dy = yidx * spy
cur_rect = gdspy.Rectangle((x0 + dx, y0 + dy), (x1 + dx, y1 + dy),
layer=lay_id, datatype=purp_id)
gds_cell.add(cur_rect)
else:
cur_rect = gdspy.Rectangle((x0, y0), (x1, y1), layer=lay_id, datatype=purp_id)
gds_cell.add(cur_rect)
# add vias
for via in content_list.via_list: # type: ViaInfo
via_lay_info = via_info[via.id]
nx, ny = via.arr_nx, via.arr_ny
x0, y0 = via.loc
if nx > 1 or ny > 1:
spx, spy = via.arr_spx, via.arr_spy
for xidx in range(nx):
xc = x0 + xidx * spx
for yidx in range(ny):
yc = y0 + yidx * spy
self._add_gds_via(gds_cell, via, lay_map, via_lay_info, xc, yc)
else:
self._add_gds_via(gds_cell, via, lay_map, via_lay_info, x0, y0)
# add pins
for pin in content_list.pin_list: # type: PinInfo
lay_id, purp_id = lay_map[pin.layer]
bbox = pin.bbox
label = pin.label
if pin.make_rect:
cur_rect = gdspy.Rectangle((bbox.left, bbox.bottom), (bbox.right, bbox.top),
layer=lay_id, datatype=purp_id)
gds_cell.add(cur_rect)
angle = 90 if bbox.height_unit > bbox.width_unit else 0
cur_lbl = gdspy.Label(label, (bbox.xc, bbox.yc), rotation=angle,
layer=lay_id, texttype=purp_id)
gds_cell.add(cur_lbl)
for path in content_list.path_list:
# Photonic paths should be treated like polygons
lay_id, purp_id = lay_map[path['layer']]
cur_path = gdspy.Polygon(path['polygon_points'], layer=lay_id, datatype=purp_id)
gds_cell.add(cur_path.fracture(precision=res, max_points=max_points_per_polygon))
for blockage in content_list.blockage_list:
pass
for boundary in content_list.boundary_list:
pass
for polygon in content_list.polygon_list:
lay_id, purp_id = lay_map[polygon['layer']]
cur_poly = gdspy.Polygon(polygon['points'], layer=lay_id, datatype=purp_id)
gds_cell.add(cur_poly.fracture(precision=res, max_points=max_points_per_polygon))
for round_obj in content_list.round_list:
nx, ny = round_obj.get('arr_nx', 1), round_obj.get('arr_ny', 1)
lay_id, purp_id = lay_map[tuple(round_obj['layer'])]
x0, y0 = round_obj['center']
if nx > 1 or ny > 1:
spx, spy = round_obj['arr_spx'], round_obj['arr_spy']
for xidx in range(nx):
dx = xidx * spx
for yidx in range(ny):
dy = yidx * spy
cur_round = gdspy.Round((x0 + dx, y0 + dy), radius=round_obj['rout'],
inner_radius=round_obj['rin'],
initial_angle=round_obj['theta0'] * pi / 180,
final_angle=round_obj['theta1'] * pi / 180,
tolerance=self.grid.resolution,
layer=lay_id, datatype=purp_id)
gds_cell.add(cur_round)
else:
cur_round = gdspy.Round((x0, y0), radius=round_obj['rout'],
inner_radius=round_obj['rin'],
initial_angle=round_obj['theta0'] * pi / 180,
final_angle=round_obj['theta1'] * pi / 180,
tolerance=self.grid.resolution,
> layer=lay_id, datatype=purp_id)
E TypeError: __init__() got an unexpected keyword argument 'tolerance'
BPG/BPG/gds/core.py:185: TypeError
----------------------------- Captured stdout call -----------------------------
*WARNING* Cannot find file: /buildbot/runtests/build/workdir/BAG_server_port.txt
Setting up tech info class
Loading layermap from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/gds_map.yaml
Loading lumerical export config from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/lumerical_map.yaml
Loading dataprep procedure from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_routine.yaml
Loading dataprep parameters from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_parameters.yaml
----------------------------- Captured stderr call -----------------------------
##########################
Starting BPG Build
2019-06-10 21:18:26.804210
##########################
PhotonicCoreLayout initialized from spec file: BPG/tests/specs/dataprep_specs.yaml
loading layermap from /buildbot/runtests/build/workdir/BPG/tests/specs/dataprep_layermap_op.yaml
loading dataprep procedure from /buildbot/runtests/build/workdir/BPG/tests/specs/dataprep_routine_op.yaml
loading dataprep and DRC parameters from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_parameters.yaml
loading lumerical export configuration from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/lumerical_map.yaml
loaded paths successfully
------------------------------Generating template-------------------------------
0.00688338 | DataprepOpsTest Template generation
----------------------------Generating content list-----------------------------
-------------------------------Save content list--------------------------------
Saving content list: content_list : 0.00269794s
0.00371099 | Content list creation
0.000599861 | - Content list generation
0.00311112 | - Content list saving
--------------------------------Generating .gds---------------------------------
In PhotonicTemplateDB._create_gds
Instantiating gds layout
________________________________ test_dataprep _________________________________
def test_dataprep():
spec_file = 'BPG/tests/specs/dataprep_specs_op.yaml'
plm = BPG.PhotonicLayoutManager(spec_file)
plm.generate_content()
> plm.generate_gds()
BPG/tests/test_dataprep_op.py:121:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
BPG/BPG/layout_manager.py:223: in generate_gds
max_points_per_polygon=max_points_per_polygon)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <BPG.gds.core.GDSPlugin object at 0xffffa21dff98>
content_lists = [ContentList for cell_name=DataprepShapes, ContentList for cell_name=DataprepShapes_3, ContentList for cell_name=Datap...t for cell_name=DataprepShapes_2, ContentList for cell_name=DataprepShapes_4, ContentList for cell_name=Top_Level_Cell]
name_append = '', max_points_per_polygon = 199, write_gds = True
def export_content_list(self,
content_lists: List["ContentList"],
name_append: str = '',
max_points_per_polygon: Optional[int] = None,
write_gds: bool = True,
):
"""
Exports the physical design to GDS
Parameters
----------
content_lists : List[ContentList]
A list of ContentList objects that represent the layout.
name_append : str
A suffix to add to the end of the generated gds filename
max_points_per_polygon : Optional[int]
Maximum number of points allowed per polygon shape in the gds.
Defaults to value set in the init of GDSPlugin if not specified.
write_gds : bool
Default True. True to write out the gds file.
False to create the gdspy object, but not write out the gds.
"""
logging.info(f'In PhotonicTemplateDB._create_gds')
tech_info = self.grid.tech_info
lay_unit = tech_info.layout_unit
res = tech_info.resolution
if not max_points_per_polygon:
max_points_per_polygon = self.max_points_per_polygon
with open(self.gds_layermap, 'r') as f:
lay_info = yaml.load(f)
lay_map = lay_info['layer_map']
via_info = lay_info['via_info']
# TODO: fix
out_fname = self.gds_filepath + f'{name_append}.gds'
gds_lib = gdspy.GdsLibrary(name=self.lib_name, unit=lay_unit, precision=res * lay_unit)
cell_dict = gds_lib.cell_dict
logging.info(f'Instantiating gds layout')
start = time.time()
for content_list in content_lists:
gds_cell = gdspy.Cell(content_list.cell_name, exclude_from_current=True)
gds_lib.add(gds_cell)
# add instances
for inst_info in content_list.inst_list: # type: InstanceInfo
if inst_info.params is not None:
raise ValueError('Cannot instantiate PCells in GDS.')
num_rows = inst_info.num_rows
num_cols = inst_info.num_cols
angle, reflect = inst_info.angle_reflect
if num_rows > 1 or num_cols > 1:
cur_inst = gdspy.CellArray(cell_dict[inst_info.cell], num_cols, num_rows,
(inst_info.sp_cols, inst_info.sp_rows),
origin=inst_info.loc, rotation=angle,
x_reflection=reflect)
else:
cur_inst = gdspy.CellReference(cell_dict[inst_info.cell], origin=inst_info.loc,
rotation=angle, x_reflection=reflect)
gds_cell.add(cur_inst)
# add rectangles
for rect in content_list.rect_list:
nx, ny = rect.get('arr_nx', 1), rect.get('arr_ny', 1)
(x0, y0), (x1, y1) = rect['bbox']
lay_id, purp_id = lay_map[tuple(rect['layer'])]
if nx > 1 or ny > 1:
spx, spy = rect['arr_spx'], rect['arr_spy']
for xidx in range(nx):
dx = xidx * spx
for yidx in range(ny):
dy = yidx * spy
cur_rect = gdspy.Rectangle((x0 + dx, y0 + dy), (x1 + dx, y1 + dy),
layer=lay_id, datatype=purp_id)
gds_cell.add(cur_rect)
else:
cur_rect = gdspy.Rectangle((x0, y0), (x1, y1), layer=lay_id, datatype=purp_id)
gds_cell.add(cur_rect)
# add vias
for via in content_list.via_list: # type: ViaInfo
via_lay_info = via_info[via.id]
nx, ny = via.arr_nx, via.arr_ny
x0, y0 = via.loc
if nx > 1 or ny > 1:
spx, spy = via.arr_spx, via.arr_spy
for xidx in range(nx):
xc = x0 + xidx * spx
for yidx in range(ny):
yc = y0 + yidx * spy
self._add_gds_via(gds_cell, via, lay_map, via_lay_info, xc, yc)
else:
self._add_gds_via(gds_cell, via, lay_map, via_lay_info, x0, y0)
# add pins
for pin in content_list.pin_list: # type: PinInfo
lay_id, purp_id = lay_map[pin.layer]
bbox = pin.bbox
label = pin.label
if pin.make_rect:
cur_rect = gdspy.Rectangle((bbox.left, bbox.bottom), (bbox.right, bbox.top),
layer=lay_id, datatype=purp_id)
gds_cell.add(cur_rect)
angle = 90 if bbox.height_unit > bbox.width_unit else 0
cur_lbl = gdspy.Label(label, (bbox.xc, bbox.yc), rotation=angle,
layer=lay_id, texttype=purp_id)
gds_cell.add(cur_lbl)
for path in content_list.path_list:
# Photonic paths should be treated like polygons
lay_id, purp_id = lay_map[path['layer']]
cur_path = gdspy.Polygon(path['polygon_points'], layer=lay_id, datatype=purp_id)
gds_cell.add(cur_path.fracture(precision=res, max_points=max_points_per_polygon))
for blockage in content_list.blockage_list:
pass
for boundary in content_list.boundary_list:
pass
for polygon in content_list.polygon_list:
lay_id, purp_id = lay_map[polygon['layer']]
cur_poly = gdspy.Polygon(polygon['points'], layer=lay_id, datatype=purp_id)
gds_cell.add(cur_poly.fracture(precision=res, max_points=max_points_per_polygon))
for round_obj in content_list.round_list:
nx, ny = round_obj.get('arr_nx', 1), round_obj.get('arr_ny', 1)
lay_id, purp_id = lay_map[tuple(round_obj['layer'])]
x0, y0 = round_obj['center']
if nx > 1 or ny > 1:
spx, spy = round_obj['arr_spx'], round_obj['arr_spy']
for xidx in range(nx):
dx = xidx * spx
for yidx in range(ny):
dy = yidx * spy
cur_round = gdspy.Round((x0 + dx, y0 + dy), radius=round_obj['rout'],
inner_radius=round_obj['rin'],
initial_angle=round_obj['theta0'] * pi / 180,
final_angle=round_obj['theta1'] * pi / 180,
tolerance=self.grid.resolution,
layer=lay_id, datatype=purp_id)
gds_cell.add(cur_round)
else:
cur_round = gdspy.Round((x0, y0), radius=round_obj['rout'],
inner_radius=round_obj['rin'],
initial_angle=round_obj['theta0'] * pi / 180,
final_angle=round_obj['theta1'] * pi / 180,
tolerance=self.grid.resolution,
> layer=lay_id, datatype=purp_id)
E TypeError: __init__() got an unexpected keyword argument 'tolerance'
BPG/BPG/gds/core.py:185: TypeError
----------------------------- Captured stdout call -----------------------------
*WARNING* Cannot find file: /buildbot/runtests/build/workdir/BAG_server_port.txt
Setting up tech info class
Loading layermap from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/gds_map.yaml
Loading lumerical export config from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/lumerical_map.yaml
Loading dataprep procedure from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_routine.yaml
Loading dataprep parameters from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_parameters.yaml
----------------------------- Captured stderr call -----------------------------
##########################
Starting BPG Build
2019-06-10 21:18:27.635178
##########################
PhotonicCoreLayout initialized from spec file: BPG/tests/specs/dataprep_specs_op.yaml
loading layermap from /buildbot/runtests/build/workdir/BPG/tests/specs/dataprep_layermap_op.yaml
loading dataprep procedure from /buildbot/runtests/build/workdir/BPG/tests/specs/dataprep_routine_op.yaml
loading dataprep and DRC parameters from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_parameters.yaml
loading lumerical export configuration from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/lumerical_map.yaml
loaded paths successfully
------------------------------Generating template-------------------------------
0.00689149 | DataprepOpsTest Template generation
----------------------------Generating content list-----------------------------
-------------------------------Save content list--------------------------------
Saving content list: content_list : 0.00267839s
0.00372601 | Content list creation
0.000608921 | - Content list generation
0.00311708 | - Content list saving
--------------------------------Generating .gds---------------------------------
In PhotonicTemplateDB._create_gds
Instantiating gds layout
_______________________________ test_gds_import ________________________________
def test_gds_import():
spec_file = 'BPG/tests/specs/gds_import.yaml'
plm = BPG.PhotonicLayoutManager(spec_file)
> plm.generate_content()
BPG/tests/test_gds_import.py:23:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
BPG/BPG/layout_manager.py:190: in generate_content
self.generate_template()
BPG/BPG/layout_manager.py:170: in generate_template
debug=False))
BAG_framework/bag/layout/template.py:263: in new_template
gen_cls=temp_cls, debug=debug, **kwargs)
BAG_framework/bag/util/cache.py:635: in new_master
master.finalize()
BPG/BPG/template.py:254: in finalize
TemplateBase.finalize(self)
BAG_framework/bag/layout/template.py:631: in finalize
self.draw_layout()
BPG/tests/test_gds_import.py:16: in draw_layout
master = self.new_template(params=self.params, temp_cls=GDSImport)
BAG_framework/bag/layout/template.py:1193: in new_template
**kwargs)
BAG_framework/bag/layout/template.py:263: in new_template
gen_cls=temp_cls, debug=debug, **kwargs)
BAG_framework/bag/util/cache.py:635: in new_master
master.finalize()
BPG/BPG/template.py:254: in finalize
TemplateBase.finalize(self)
BAG_framework/bag/layout/template.py:631: in finalize
self.draw_layout()
BPG/BPG/gds/io.py:31: in draw_layout
self.import_content_from_gds(self.params['gds_path'])
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <BPG.gds.io.GDSImport object at 0xffffa215fe80>
gds_filepath = 'gen_libs/bpg_test_suite/data/any_angle_alignment.gds'
def import_content_from_gds(self,
gds_filepath: str
):
"""
Read a GDS and copy all of the polygons into this master
gdspy turns all input shapes into polygons, so we only need to care about importing into
the polygon list. Currently we only import labels at the top level of the hierarchy
Parameters
----------
gds_filepath : str
Path to the gds to be imported
"""
# Import information from the layermap
with open(self.gds_layermap, 'r') as f:
lay_info = yaml.load(f)
lay_map = lay_info['layer_map']
# Import the GDS from the file
gds_lib = gdspy.GdsLibrary()
gds_lib.read_gds(infile=gds_filepath, units='convert')
# Get the top cell in the GDS and flatten its contents
top_cell = gds_lib.top_level()
if len(top_cell) != 1:
raise ValueError("Cannot import a GDS with multiple top level cells")
top_cell = top_cell[0] # top_cell returns a list, so just grab the only element
top_cell.flatten()
# TODO: This currently accesses an internal attr polygons, instead of the get_polygons() method, may be unstable
> for polyset in top_cell.polygons:
E AttributeError: 'Cell' object has no attribute 'polygons'
BPG/BPG/gds/io.py:64: AttributeError
----------------------------- Captured stdout call -----------------------------
*WARNING* Cannot find file: /buildbot/runtests/build/workdir/BAG_server_port.txt
Setting up tech info class
Loading layermap from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/gds_map.yaml
Loading lumerical export config from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/lumerical_map.yaml
Loading dataprep procedure from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_routine.yaml
Loading dataprep parameters from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_parameters.yaml
----------------------------- Captured stderr call -----------------------------
##########################
Starting BPG Build
2019-06-10 21:18:30.983875
##########################
PhotonicCoreLayout initialized from spec file: BPG/tests/specs/gds_import.yaml
loading layermap from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/gds_map.yaml
loading dataprep procedure from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_routine.yaml
loading dataprep and DRC parameters from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/dataprep_parameters.yaml
loading lumerical export configuration from /buildbot/runtests/build/workdir/BPG/examples/tech/BPG_tech_files/lumerical_map.yaml
loaded paths successfully
------------------------------Generating template-------------------------------
=============================== warnings summary ===============================
tests/test_gds_import.py::TestGDSImport
cannot collect test class 'TestGDSImport' because it has a __init__ constructor
-- Docs: http://doc.pytest.org/en/latest/warnings.html
=============== 4 failed, 16 passed, 1 warnings in 31.81 seconds ===============
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 0 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/custom_log_name_test.txt for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
-------------------------------BPG call completed-------------------------------
Ran with 2 warnings.
See /buildbot/runtests/build/workdir/gen_libs/bpg_test_suite/output.log for details.
Step run_bpg_photonics_dev
failed with details below:
+ export BPG_DIR=/buildbot/runtests/build
+ BPG_DIR=/buildbot/runtests/build
+ /opt/run_bpg_photonics_dev.sh
+ mkdir -p workdir
+ cd workdir
+ '[' -z /buildbot/runtests/build ']'
+ '[' -z '' ']'
+ PHOTONICS_DEV_HASH=9a82057
+ rm -rf Photonics_Dev
+ git clone git@github.com:pvnbhargava/Photonics_Dev.git
Cloning into 'Photonics_Dev'...
+ cd Photonics_Dev
+ git checkout 9a82057
Note: checking out '9a82057'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
HEAD is now at 9a82057 Use ssh for BAG for now
+ git submodule update --init --recursive
Submodule 'BAG2_TEMPLATES_EC' (git@github.com:ucb-art/BAG2_TEMPLATES_EC.git) registered for path 'BAG2_TEMPLATES_EC'
Submodule 'BAG_framework' (git@github.com:ucb-art/BAG_framework.git) registered for path 'BAG_framework'
Submodule 'BPG' (git@github.com:pvnbhargava/BPG.git) registered for path 'BPG'
Submodule 'Photonic_Core_Layout' (git@github.com:pvnbhargava/Photonic_Core_Layout.git) registered for path 'Photonic_Core_Layout'
Submodule 'gdspy' (https://github.com/heitzmann/gdspy.git) registered for path 'gdspy'
Cloning into '/buildbot/runtests/build/workdir/Photonics_Dev/BAG2_TEMPLATES_EC'...
Cloning into '/buildbot/runtests/build/workdir/Photonics_Dev/BAG_framework'...
Cloning into '/buildbot/runtests/build/workdir/Photonics_Dev/BPG'...
Cloning into '/buildbot/runtests/build/workdir/Photonics_Dev/Photonic_Core_Layout'...
Cloning into '/buildbot/runtests/build/workdir/Photonics_Dev/gdspy'...
Submodule path 'BAG2_TEMPLATES_EC': checked out 'e79f54c8da5b16c1b02ba6483296883488b9a83a'
error: Server does not allow request for unadvertised object e2b2f54423735020be61f66a915b676da5c54797
Fetched in submodule path 'BAG_framework', but it did not contain e2b2f54423735020be61f66a915b676da5c54797. Direct fetching of that commit failed.
Adding PLVS flow into BPG layout manager