Add stdc bounding box too

This commit is contained in:
mrg 2020-06-11 11:54:16 -07:00
parent 098219d56c
commit 089331ced3
1 changed files with 28 additions and 17 deletions

View File

@ -695,14 +695,19 @@ class layout():
# we should add a boundary just for DRC in some technologies # we should add a boundary just for DRC in some technologies
if not self.is_library_cell and not self.bounding_box: if not self.is_library_cell and not self.bounding_box:
# If there is a boundary layer, and we didn't create one, add one. # If there is a boundary layer, and we didn't create one, add one.
boundary_layers = []
if "boundary" in techlayer.keys(): if "boundary" in techlayer.keys():
boundary_layer = "boundary" boundary_layers.append("boundary")
boundary = [self.find_lowest_coords(), if "stdc" in techlayer.keys():
self.find_highest_coords()] boundary_layers.append("stdc")
debug.check(boundary[0] and boundary[1], "No shapes to make a boundary.") boundary = [self.find_lowest_coords(),
self.find_highest_coords()]
debug.check(boundary[0] and boundary[1], "No shapes to make a boundary.")
height = boundary[1][1] - boundary[0][1] height = boundary[1][1] - boundary[0][1]
width = boundary[1][0] - boundary[0][0] width = boundary[1][0] - boundary[0][0]
for boundary_layer in boundary_layers:
(layer_number, layer_purpose) = techlayer[boundary_layer] (layer_number, layer_purpose) = techlayer[boundary_layer]
gds_layout.addBox(layerNumber=layer_number, gds_layout.addBox(layerNumber=layer_number,
purposeNumber=layer_purpose, purposeNumber=layer_purpose,
@ -1259,17 +1264,23 @@ class layout():
if OPTS.netlist_only: if OPTS.netlist_only:
return return
boundary_layer = "boundary" boundary_layers = []
if not ur: if "stdc" in techlayer.keys():
self.bounding_box = self.add_rect(layer=boundary_layer, boundary_layers.append("stdc")
offset=ll, if "boundary" in techlayer.keys():
height=self.height, boundary_layers.append("boundary")
width=self.width) # Save the last one as self.bounding_box
else: for boundary_layer in boundary_layers:
self.bounding_box = self.add_rect(layer=boundary_layer, if not ur:
offset=ll, self.bounding_box = self.add_rect(layer=boundary_layer,
height=ur.y - ll.y, offset=ll,
width=ur.x - ll.x) height=self.height,
width=self.width)
else:
self.bounding_box = self.add_rect(layer=boundary_layer,
offset=ll,
height=ur.y - ll.y,
width=ur.x - ll.x)
def add_enclosure(self, insts, layer="nwell"): def add_enclosure(self, insts, layer="nwell"):
""" Add a layer that surrounds the given instances. Useful """ Add a layer that surrounds the given instances. Useful