mirror of https://github.com/VLSIDA/OpenRAM.git
Search all shapes for boundary rather than specify structure
This commit is contained in:
parent
43d2058b3c
commit
3c2e8754e0
|
|
@ -73,7 +73,7 @@ def auto_measure_libcell(pin_list, name, units, lpp):
|
|||
return cell
|
||||
|
||||
|
||||
def get_gds_size(name, gds_filename, units, lpp, structure = ""):
|
||||
def get_gds_size(name, gds_filename, units, lpp):
|
||||
"""
|
||||
Open a GDS file and return the size from either the
|
||||
bounding box or a border layer.
|
||||
|
|
@ -83,7 +83,7 @@ def get_gds_size(name, gds_filename, units, lpp, structure = ""):
|
|||
reader = gdsMill.Gds2reader(cell_vlsi)
|
||||
reader.loadFromFile(gds_filename)
|
||||
|
||||
measure_result = cell_vlsi.getLayoutBorder(lpp, structure)
|
||||
measure_result = cell_vlsi.getLayoutBorder(lpp)
|
||||
if not measure_result:
|
||||
debug.info(2, "Layout border failed. Trying to measure size for {}".format(name))
|
||||
measure_result = cell_vlsi.measureSize(name)
|
||||
|
|
@ -91,15 +91,14 @@ def get_gds_size(name, gds_filename, units, lpp, structure = ""):
|
|||
return measure_result
|
||||
|
||||
|
||||
def get_libcell_size(name, units, lpp, structure = ""):
|
||||
def get_libcell_size(name, units, lpp):
|
||||
"""
|
||||
Open a GDS file and return the library cell size from either the
|
||||
bounding box or a border layer.
|
||||
"""
|
||||
|
||||
cell_gds = OPTS.openram_tech + "gds_lib/" + str(name) + ".gds"
|
||||
return(get_gds_size(name, cell_gds, units, lpp, structure))
|
||||
|
||||
return(get_gds_size(name, cell_gds, units, lpp))
|
||||
|
||||
|
||||
def get_gds_pins(pin_names, name, gds_filename, units):
|
||||
|
|
|
|||
|
|
@ -41,10 +41,8 @@ class s8_bitcell(bitcell_base.bitcell_base):
|
|||
|
||||
if version == "opt1":
|
||||
self.name = "s8sram_cell_opt1"
|
||||
self.border_structure = "s8sram_cell"
|
||||
elif version == "opt1a":
|
||||
self.name = "s8sram_cell_opt1a"
|
||||
self.border_structure = "s8sram_cell"
|
||||
|
||||
bitcell_base.bitcell_base.__init__(self, self.name)
|
||||
debug.info(2, "Create bitcell")
|
||||
|
|
|
|||
|
|
@ -22,16 +22,12 @@ class s8_col_end(design.design):
|
|||
|
||||
if version == "colend":
|
||||
self.name = "s8sram16x16_colend"
|
||||
structure = "s8sram16x16_colend"
|
||||
elif version == "colend_p_cent":
|
||||
self.name = "s8sram16x16_colend_p_cent"
|
||||
structure = "s8sram16x16_colend_p_cent\x00"
|
||||
elif version == "colenda":
|
||||
self.name = "s8sram16x16_colenda"
|
||||
structure = "s8sram16x16_colenda\x00"
|
||||
elif version == "colenda_p_cent":
|
||||
self.name = "s8sram16x16_colenda_p_cent"
|
||||
structure = "s8sram16x16_colenda_p_cent"
|
||||
else:
|
||||
debug.error("Invalid type for col_end", -1)
|
||||
design.design.__init__(self, name=self.name)
|
||||
|
|
@ -42,4 +38,4 @@ class s8_col_end(design.design):
|
|||
pin_map = utils.get_libcell_pins(pin_names, self.name, GDS["unit"])
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -22,18 +22,14 @@ class s8_internal(design.design):
|
|||
|
||||
if version == "wlstrap":
|
||||
self.name = "s8sram_wlstrap"
|
||||
self.structure = "s8sram_wlstrap_ce\x00"
|
||||
elif version == "wlstrap_p":
|
||||
self.name = "s8sram16x16_wlstrap_p"
|
||||
self.structure = "s8sram16x16_wlstrap_p_ce"
|
||||
elif version == "wlstrapa":
|
||||
self.name = "s8sram_wlstrapa"
|
||||
self.structure = "s8sram_wlstrapa_ce"
|
||||
else:
|
||||
debug.error("Invalid version", -1)
|
||||
design.design.__init__(self, name=self.name)
|
||||
(self.width, self.height) = utils.get_libcell_size(self.name,
|
||||
GDS["unit"],
|
||||
layer["mem"],
|
||||
self.structure)
|
||||
pin_map = utils.get_libcell_pins(pin_names, self.name, GDS["unit"])
|
||||
layer["mem"])
|
||||
pin_map = utils.get_libcell_pins(pin_names, self.name, GDS["unit"])
|
||||
|
|
|
|||
|
|
@ -597,20 +597,20 @@ class VlsiLayout:
|
|||
if structure == "":
|
||||
structure = self.rootStructureName
|
||||
cellSizeMicron = None
|
||||
for boundary in self.structures[structure].boundaries:
|
||||
if sameLPP((boundary.drawingLayer, boundary.purposeLayer),
|
||||
lpp):
|
||||
if self.debug:
|
||||
debug.info(1, "Find border "+str(boundary.coordinates))
|
||||
left_bottom = boundary.coordinates[0]
|
||||
right_top = boundary.coordinates[2]
|
||||
cellSize = [right_top[0]-left_bottom[0],
|
||||
right_top[1]-left_bottom[1]]
|
||||
cellSizeMicron = [cellSize[0]*self.units[0],
|
||||
cellSize[1]*self.units[0]]
|
||||
debug.check(cellSizeMicron,
|
||||
"Error: "+str(structure)+".cell_size information not found yet")
|
||||
|
||||
shapes = self.getAllShapes(lpp)
|
||||
if len(shapes) != 1:
|
||||
debug.warning("More than one boundary found in cell: {}".format(structure))
|
||||
debug.check(len(shapes) != 0,
|
||||
"Error: "+str(structure)+".cell_size information not found yet")
|
||||
max_boundary = None
|
||||
max_area = 0
|
||||
for boundary in shapes:
|
||||
new_area = boundaryArea(boundary)
|
||||
if not max_boundary or new_area > max_area:
|
||||
max_boundary = boundary
|
||||
max_area = new_area
|
||||
cellSizeMicron = [max_boundary[2], max_boundary[3]]
|
||||
return cellSizeMicron
|
||||
|
||||
def measureSize(self, startStructure):
|
||||
|
|
|
|||
Loading…
Reference in New Issue