Commit d115d3d7 by ZhiangWang033

fix the width of soft macro

parent 3ed1fd6a
......@@ -12,7 +12,7 @@ from FormatTranslators import MacroPin
class Clustering:
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):
"""
parameter: design, help="design_name: ariane, MegaBoom_x2 ", type = str
......@@ -20,6 +20,7 @@ class Clustering:
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: 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: net_size_threshold, help="large net threshold", type = int
parameter: Nparts, help = "number of clusters (only for hmetis, default = 500)", type = int
......@@ -566,7 +567,7 @@ class Clustering:
class ProBufFormat:
def __init__(self, io_file, macro_pin_file, inst_file, outline_file,
net_file, soft_macros, pbf_file, net_size_threshold,
aspect_ratio):
grid_width):
self.io_file = io_file
self.macro_pin_file = macro_pin_file
self.inst_file = inst_file
......@@ -575,7 +576,7 @@ class ProBufFormat:
self.soft_macros = soft_macros
self.pbf_file = pbf_file
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.macro_pin_map = { } # map macro_pin to macro
self.macro_pin_offset = { } # map macro_pin_name to offset
......@@ -681,8 +682,8 @@ class ProBufFormat:
self.std_cell_map[std_cell] = macro_name
x = (lx + ux) / 2.0
y = (ly + uy) / 2.0
height = sqrt(area * self.aspect_ratio)
width = area / height
width = self.grid_width
height = area / width
self.insts[macro_name] = Macro(macro_name, width, height, x, y)
self.insts[macro_name].IsSoft()
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__':
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("--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("--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)
......@@ -32,6 +33,7 @@ if __name__ == '__main__':
step_threshold = args.step_threshold
distance = args.distance
grid_width = args.grid_width
max_num_vertices = args.max_num_vertices
net_size_threshold = args.net_size_threshold
Nparts = args.Nparts
......@@ -44,7 +46,7 @@ if __name__ == '__main__':
# To use the grouping function, you need to specify the directory of src file
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,
RePlace, placement_density, GUI)
......
......@@ -66,6 +66,7 @@ clustering_src_dir = '../Clustering/src'
chip_width = gridding.GetChipWidth()
chip_height = gridding.GetChipHeight()
num_std_cells = gridding.GetNumStdCells()
grid_width = chip_width / num_cols
Nparts = 500
# 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)
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_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