Commit d115d3d7 by ZhiangWang033

fix the width of soft macro

parent 3ed1fd6a
...@@ -12,7 +12,7 @@ from FormatTranslators import MacroPin ...@@ -12,7 +12,7 @@ from FormatTranslators import MacroPin
class Clustering: class Clustering:
def __init__(self, design, src_dir, fixed_file, step_threshold = 100.6, distance = 1000.0, def __init__(self, design, src_dir, fixed_file, step_threshold = 100.6, distance = 1000.0,
max_num_vertices = 1000000, net_size_threshold = 300, grid_width = 30.0, max_num_vertices = 1000000, net_size_threshold = 300,
Nparts = 500, setup_file = "setup.tcl", RePlace = True, placement_density = 0.7, GUI = True): Nparts = 500, setup_file = "setup.tcl", RePlace = True, placement_density = 0.7, GUI = True):
""" """
parameter: design, help="design_name: ariane, MegaBoom_x2 ", type = str parameter: design, help="design_name: ariane, MegaBoom_x2 ", type = str
...@@ -20,6 +20,7 @@ class Clustering: ...@@ -20,6 +20,7 @@ class Clustering:
parameter: fixed_file, help="fixed file generated by grouping", type = str parameter: fixed_file, help="fixed file generated by grouping", type = str
parameter: step_threshold, help = "threshold (x and y) to break clusters (in um)", type = float parameter: step_threshold, help = "threshold (x and y) to break clusters (in um)", type = float
parameter: distance, help="distance for merge clusters", type = float parameter: distance, help="distance for merge clusters", type = float
parameter: grid_width, help = "grid width generated by gridding script"
parameter: max_num_vertices, help="threshold for smaller clusters", type = int parameter: max_num_vertices, help="threshold for smaller clusters", type = int
parameter: net_size_threshold, help="large net threshold", type = int parameter: net_size_threshold, help="large net threshold", type = int
parameter: Nparts, help = "number of clusters (only for hmetis, default = 500)", type = int parameter: Nparts, help = "number of clusters (only for hmetis, default = 500)", type = int
...@@ -566,7 +567,7 @@ class Clustering: ...@@ -566,7 +567,7 @@ class Clustering:
class ProBufFormat: class ProBufFormat:
def __init__(self, io_file, macro_pin_file, inst_file, outline_file, def __init__(self, io_file, macro_pin_file, inst_file, outline_file,
net_file, soft_macros, pbf_file, net_size_threshold, net_file, soft_macros, pbf_file, net_size_threshold,
aspect_ratio): grid_width):
self.io_file = io_file self.io_file = io_file
self.macro_pin_file = macro_pin_file self.macro_pin_file = macro_pin_file
self.inst_file = inst_file self.inst_file = inst_file
...@@ -575,7 +576,7 @@ class ProBufFormat: ...@@ -575,7 +576,7 @@ class ProBufFormat:
self.soft_macros = soft_macros self.soft_macros = soft_macros
self.pbf_file = pbf_file self.pbf_file = pbf_file
self.net_size_threshold = net_size_threshold self.net_size_threshold = net_size_threshold
self.aspect_ratio = aspect_ratio self.grid_width = grid_width
self.insts = { } # map name to Port, Macro, Soft Macro self.insts = { } # map name to Port, Macro, Soft Macro
self.macro_pin_map = { } # map macro_pin to macro self.macro_pin_map = { } # map macro_pin to macro
self.macro_pin_offset = { } # map macro_pin_name to offset self.macro_pin_offset = { } # map macro_pin_name to offset
...@@ -681,8 +682,8 @@ class ProBufFormat: ...@@ -681,8 +682,8 @@ class ProBufFormat:
self.std_cell_map[std_cell] = macro_name self.std_cell_map[std_cell] = macro_name
x = (lx + ux) / 2.0 x = (lx + ux) / 2.0
y = (ly + uy) / 2.0 y = (ly + uy) / 2.0
height = sqrt(area * self.aspect_ratio) width = self.grid_width
width = area / height height = area / width
self.insts[macro_name] = Macro(macro_name, width, height, x, y) self.insts[macro_name] = Macro(macro_name, width, height, x, y)
self.insts[macro_name].IsSoft() self.insts[macro_name].IsSoft()
soft_macro_id += 1 soft_macro_id += 1
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -12,6 +12,7 @@ if __name__ == '__main__': ...@@ -12,6 +12,7 @@ if __name__ == '__main__':
parser.add_argument("--fixed_file", help="fixed file generated by grouping", type = str, default = "./fix_files_grouping/ariane.fix.old") parser.add_argument("--fixed_file", help="fixed file generated by grouping", type = str, default = "./fix_files_grouping/ariane.fix.old")
parser.add_argument("--step_threshold", help = "threshold (x and y) to break clusters (in um)", type = float, default = 400.0) parser.add_argument("--step_threshold", help = "threshold (x and y) to break clusters (in um)", type = float, default = 400.0)
parser.add_argument("--distance", help="distance for merge clusters", type = float, default = 200.0) parser.add_argument("--distance", help="distance for merge clusters", type = float, default = 200.0)
parser.add_argument("--grid_width", help="grid width, the width of soft macro", type = int, default = 30.0)
parser.add_argument("--max_num_vertices", help="threshold for samller clusters", type = int, default = 100) parser.add_argument("--max_num_vertices", help="threshold for samller clusters", type = int, default = 100)
parser.add_argument("--net_size_threshold", help = "large net threshold", type = int, default = 300) parser.add_argument("--net_size_threshold", help = "large net threshold", type = int, default = 300)
parser.add_argument("--Nparts", help = "number of clusters (only for hmetis, default = 500)", type = int, default = 500) parser.add_argument("--Nparts", help = "number of clusters (only for hmetis, default = 500)", type = int, default = 500)
...@@ -32,6 +33,7 @@ if __name__ == '__main__': ...@@ -32,6 +33,7 @@ if __name__ == '__main__':
step_threshold = args.step_threshold step_threshold = args.step_threshold
distance = args.distance distance = args.distance
grid_width = args.grid_width
max_num_vertices = args.max_num_vertices max_num_vertices = args.max_num_vertices
net_size_threshold = args.net_size_threshold net_size_threshold = args.net_size_threshold
Nparts = args.Nparts Nparts = args.Nparts
...@@ -44,7 +46,7 @@ if __name__ == '__main__': ...@@ -44,7 +46,7 @@ if __name__ == '__main__':
# To use the grouping function, you need to specify the directory of src file # To use the grouping function, you need to specify the directory of src file
src_dir = "../src" src_dir = "../src"
Clustering(design, src_dir, fixed_file, step_threshold, distance, Clustering(design, src_dir, fixed_file, step_threshold, distance, grid_width,
max_num_vertices, net_size_threshold, Nparts, setup_file, max_num_vertices, net_size_threshold, Nparts, setup_file,
RePlace, placement_density, GUI) RePlace, placement_density, GUI)
......
...@@ -66,6 +66,7 @@ clustering_src_dir = '../Clustering/src' ...@@ -66,6 +66,7 @@ clustering_src_dir = '../Clustering/src'
chip_width = gridding.GetChipWidth() chip_width = gridding.GetChipWidth()
chip_height = gridding.GetChipHeight() chip_height = gridding.GetChipHeight()
num_std_cells = gridding.GetNumStdCells() num_std_cells = gridding.GetNumStdCells()
grid_width = chip_width / num_cols
Nparts = 500 Nparts = 500
# Based on the description of circuit training, [see line 180 at grouper.py] # Based on the description of circuit training, [see line 180 at grouper.py]
...@@ -80,7 +81,7 @@ print("[INFO] max_num_vertices : ", max_num_vertices) ...@@ -80,7 +81,7 @@ print("[INFO] max_num_vertices : ", max_num_vertices)
clustering = Clustering(design, clustering_src_dir, fixed_file, step_threshold, distance, clustering = Clustering(design, clustering_src_dir, fixed_file, step_threshold, distance,
max_num_vertices, global_net_threshold, Nparts, setup_file, Replace) grid_width, max_num_vertices, global_net_threshold, Nparts, setup_file, Replace)
cluster_def = "./results/OpenROAD/clustered_netlist.def" cluster_def = "./results/OpenROAD/clustered_netlist.def"
cluster_lef = "./results/OpenROAD/clusters.lef" cluster_lef = "./results/OpenROAD/clusters.lef"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment