Skip to content

Commit

Permalink
make routability opt engine configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
limbo018 committed Jun 25, 2020
1 parent 64f4538 commit d5fe491
Show file tree
Hide file tree
Showing 12 changed files with 82 additions and 67 deletions.
53 changes: 27 additions & 26 deletions dreamplace/NonLinearPlace.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def one_descent_step(Lgamma_step, Llambda_density_weight_step,

if params.routability_opt_flag:
adjust_area_flag = True
adjust_route_area_flag = params.adjust_route_area_flag
adjust_route_area_flag = params.adjust_nctugr_area_flag or params.adjust_rudy_area_flag
adjust_pin_area_flag = params.adjust_pin_area_flag
num_area_adjust = 0

Expand Down Expand Up @@ -350,34 +350,35 @@ def one_descent_step(Lgamma_step, Llambda_density_weight_step,
route_utilization_map = None
pin_utilization_map = None
if adjust_route_area_flag:
#route_utilization_map = model.op_collections.route_utilization_map_op(pos)
route_utilization_map = model.op_collections.nctugr_congestion_map_op(
pos)
#if params.plot_flag:
path = "%s/%s" % (params.result_dir,
params.design_name())
figname = "%s/plot/rudy%d.png" % (
path, num_area_adjust)
os.system("mkdir -p %s" %
(os.path.dirname(figname)))
plt.imsave(
figname,
route_utilization_map.data.cpu().numpy().T,
origin='lower')
if params.adjust_nctugr_area_flag:
route_utilization_map = model.op_collections.nctugr_congestion_map_op(pos)
else:
route_utilization_map = model.op_collections.route_utilization_map_op(pos)
if params.plot_flag:
path = "%s/%s" % (params.result_dir,
params.design_name())
figname = "%s/plot/route%d.png" % (
path, num_area_adjust)
os.system("mkdir -p %s" %
(os.path.dirname(figname)))
plt.imsave(
figname,
route_utilization_map.data.cpu().numpy().T,
origin='lower')
if adjust_pin_area_flag:
pin_utilization_map = model.op_collections.pin_utilization_map_op(
pos)
#if params.plot_flag:
path = "%s/%s" % (params.result_dir,
params.design_name())
figname = "%s/plot/pin%d.png" % (
path, num_area_adjust)
os.system("mkdir -p %s" %
(os.path.dirname(figname)))
plt.imsave(
figname,
pin_utilization_map.data.cpu().numpy().T,
origin='lower')
if params.plot_flag:
path = "%s/%s" % (params.result_dir,
params.design_name())
figname = "%s/plot/pin%d.png" % (
path, num_area_adjust)
os.system("mkdir -p %s" %
(os.path.dirname(figname)))
plt.imsave(
figname,
pin_utilization_map.data.cpu().numpy().T,
origin='lower')
adjust_area_flag, adjust_route_area_flag, adjust_pin_area_flag = model.op_collections.adjust_node_area_op(
pos, route_utilization_map,
pin_utilization_map)
Expand Down
6 changes: 5 additions & 1 deletion dreamplace/params.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@
"descripton" : "maximum times to adjust node area",
"default" : 3
},
"adjust_route_area_flag" : {
"adjust_nctugr_area_flag" : {
"descripton" : "whether use NCTUgr congestion map to guide area adjustment",
"default" : 0
},
"adjust_rudy_area_flag" : {
"descripton" : "whether use RUDY/RISA map to guide area adjustment",
"default" : 1
},
Expand Down
9 changes: 5 additions & 4 deletions test/dac2012/superblue11.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"gp_noise_ratio" : 0.025,
"global_place_flag" : 1,
"legalize_flag" : 1,
"detailed_place_flag" : 0,
"detailed_place_engine" : "thirdparty/ntuplace4h",
"detailed_place_command" : "-nolegal",
"detailed_place_flag" : 1,
"detailed_place_engine" : "",
"detailed_place_command" : "",
"stop_overflow" : 0.10,
"dtype" : "float32",
"plot_flag" : 0,
Expand All @@ -29,7 +29,8 @@
"route_num_bins_x" : 800,
"route_num_bins_y" : 415,
"node_area_adjust_overflow" : 0.20,
"adjust_route_area_flag" : 1,
"adjust_nctugr_area_flag" : 1,
"adjust_rudy_area_flag" : 0,
"adjust_pin_area_flag" : 0,
"area_adjust_stop_ratio" : 0.01,
"route_area_adjust_stop_ratio" : 0.01,
Expand Down
9 changes: 5 additions & 4 deletions test/dac2012/superblue12.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"gp_noise_ratio" : 0.025,
"global_place_flag" : 1,
"legalize_flag" : 1,
"detailed_place_flag" : 0,
"detailed_place_engine" : "thirdparty/ntuplace4h",
"detailed_place_command" : "-nolegal",
"detailed_place_flag" : 1,
"detailed_place_engine" : "",
"detailed_place_command" : "",
"stop_overflow" : 0.10,
"dtype" : "float32",
"plot_flag" : 0,
Expand All @@ -29,7 +29,8 @@
"route_num_bins_x" : 800,
"route_num_bins_y" : 415,
"node_area_adjust_overflow" : 0.20,
"adjust_route_area_flag" : 1,
"adjust_nctugr_area_flag" : 1,
"adjust_rudy_area_flag" : 0,
"adjust_pin_area_flag" : 0,
"area_adjust_stop_ratio" : 0.01,
"route_area_adjust_stop_ratio" : 0.01,
Expand Down
9 changes: 5 additions & 4 deletions test/dac2012/superblue14.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"gp_noise_ratio" : 0.025,
"global_place_flag" : 1,
"legalize_flag" : 1,
"detailed_place_flag" : 0,
"detailed_place_engine" : "thirdparty/ntuplace4h",
"detailed_place_command" : "-nolegal",
"detailed_place_flag" : 1,
"detailed_place_engine" : "",
"detailed_place_command" : "",
"stop_overflow" : 0.10,
"dtype" : "float32",
"plot_flag" : 0,
Expand All @@ -29,7 +29,8 @@
"route_num_bins_x" : 800,
"route_num_bins_y" : 415,
"node_area_adjust_overflow" : 0.20,
"adjust_route_area_flag" : 1,
"adjust_nctugr_area_flag" : 1,
"adjust_rudy_area_flag" : 0,
"adjust_pin_area_flag" : 0,
"area_adjust_stop_ratio" : 0.01,
"route_area_adjust_stop_ratio" : 0.01,
Expand Down
9 changes: 5 additions & 4 deletions test/dac2012/superblue16.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"gp_noise_ratio" : 0.025,
"global_place_flag" : 1,
"legalize_flag" : 1,
"detailed_place_flag" : 0,
"detailed_place_engine" : "thirdparty/ntuplace4h",
"detailed_place_command" : "-nolegal",
"detailed_place_flag" : 1,
"detailed_place_engine" : "",
"detailed_place_command" : "",
"stop_overflow" : 0.10,
"dtype" : "float32",
"plot_flag" : 0,
Expand All @@ -29,7 +29,8 @@
"route_num_bins_x" : 800,
"route_num_bins_y" : 415,
"node_area_adjust_overflow" : 0.20,
"adjust_route_area_flag" : 1,
"adjust_nctugr_area_flag" : 1,
"adjust_rudy_area_flag" : 0,
"adjust_pin_area_flag" : 0,
"area_adjust_stop_ratio" : 0.01,
"route_area_adjust_stop_ratio" : 0.01,
Expand Down
9 changes: 5 additions & 4 deletions test/dac2012/superblue19.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"gp_noise_ratio" : 0.025,
"global_place_flag" : 1,
"legalize_flag" : 1,
"detailed_place_flag" : 0,
"detailed_place_engine" : "thirdparty/ntuplace4h",
"detailed_place_command" : "-nolegal",
"detailed_place_flag" : 1,
"detailed_place_engine" : "",
"detailed_place_command" : "",
"stop_overflow" : 0.10,
"dtype" : "float32",
"plot_flag" : 0,
Expand All @@ -29,7 +29,8 @@
"route_num_bins_x" : 800,
"route_num_bins_y" : 415,
"node_area_adjust_overflow" : 0.20,
"adjust_route_area_flag" : 1,
"adjust_nctugr_area_flag" : 1,
"adjust_rudy_area_flag" : 0,
"adjust_pin_area_flag" : 0,
"area_adjust_stop_ratio" : 0.01,
"route_area_adjust_stop_ratio" : 0.01,
Expand Down
9 changes: 5 additions & 4 deletions test/dac2012/superblue2.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"gp_noise_ratio" : 0.025,
"global_place_flag" : 1,
"legalize_flag" : 1,
"detailed_place_flag" : 0,
"detailed_place_engine" : "thirdparty/ntuplace4h",
"detailed_place_command" : "-nolegal",
"detailed_place_flag" : 1,
"detailed_place_engine" : "",
"detailed_place_command" : "",
"stop_overflow" : 0.10,
"dtype" : "float32",
"plot_flag" : 0,
Expand All @@ -29,7 +29,8 @@
"route_num_bins_x" : 800,
"route_num_bins_y" : 415,
"node_area_adjust_overflow" : 0.20,
"adjust_route_area_flag" : 1,
"adjust_nctugr_area_flag" : 1,
"adjust_rudy_area_flag" : 0,
"adjust_pin_area_flag" : 0,
"area_adjust_stop_ratio" : 0.01,
"route_area_adjust_stop_ratio" : 0.01,
Expand Down
9 changes: 5 additions & 4 deletions test/dac2012/superblue3.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"gp_noise_ratio" : 0.025,
"global_place_flag" : 1,
"legalize_flag" : 1,
"detailed_place_flag" : 0,
"detailed_place_engine" : "thirdparty/ntuplace4h",
"detailed_place_command" : "-nolegal",
"detailed_place_flag" : 1,
"detailed_place_engine" : "",
"detailed_place_command" : "",
"stop_overflow" : 0.10,
"dtype" : "float32",
"plot_flag" : 0,
Expand All @@ -29,7 +29,8 @@
"route_num_bins_x" : 800,
"route_num_bins_y" : 415,
"node_area_adjust_overflow" : 0.20,
"adjust_route_area_flag" : 1,
"adjust_nctugr_area_flag" : 1,
"adjust_rudy_area_flag" : 0,
"adjust_pin_area_flag" : 0,
"area_adjust_stop_ratio" : 0.01,
"route_area_adjust_stop_ratio" : 0.01,
Expand Down
9 changes: 5 additions & 4 deletions test/dac2012/superblue6.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"gp_noise_ratio" : 0.025,
"global_place_flag" : 1,
"legalize_flag" : 1,
"detailed_place_flag" : 0,
"detailed_place_engine" : "thirdparty/ntuplace4h",
"detailed_place_command" : "-nolegal",
"detailed_place_flag" : 1,
"detailed_place_engine" : "",
"detailed_place_command" : "",
"stop_overflow" : 0.10,
"dtype" : "float32",
"plot_flag" : 0,
Expand All @@ -29,7 +29,8 @@
"route_num_bins_x" : 800,
"route_num_bins_y" : 415,
"node_area_adjust_overflow" : 0.20,
"adjust_route_area_flag" : 1,
"adjust_nctugr_area_flag" : 1,
"adjust_rudy_area_flag" : 0,
"adjust_pin_area_flag" : 0,
"area_adjust_stop_ratio" : 0.01,
"route_area_adjust_stop_ratio" : 0.01,
Expand Down
9 changes: 5 additions & 4 deletions test/dac2012/superblue7.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"gp_noise_ratio" : 0.025,
"global_place_flag" : 1,
"legalize_flag" : 1,
"detailed_place_flag" : 0,
"detailed_place_engine" : "thirdparty/ntuplace4h",
"detailed_place_command" : "-nolegal",
"detailed_place_flag" : 1,
"detailed_place_engine" : "",
"detailed_place_command" : "",
"stop_overflow" : 0.10,
"dtype" : "float32",
"plot_flag" : 0,
Expand All @@ -29,7 +29,8 @@
"route_num_bins_x" : 800,
"route_num_bins_y" : 415,
"node_area_adjust_overflow" : 0.20,
"adjust_route_area_flag" : 1,
"adjust_nctugr_area_flag" : 1,
"adjust_rudy_area_flag" : 0,
"adjust_pin_area_flag" : 0,
"area_adjust_stop_ratio" : 0.01,
"route_area_adjust_stop_ratio" : 0.01,
Expand Down
9 changes: 5 additions & 4 deletions test/dac2012/superblue9.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"gp_noise_ratio" : 0.025,
"global_place_flag" : 1,
"legalize_flag" : 1,
"detailed_place_flag" : 0,
"detailed_place_engine" : "thirdparty/ntuplace4h",
"detailed_place_command" : "-nolegal",
"detailed_place_flag" : 1,
"detailed_place_engine" : "",
"detailed_place_command" : "",
"stop_overflow" : 0.10,
"dtype" : "float32",
"plot_flag" : 0,
Expand All @@ -29,7 +29,8 @@
"route_num_bins_x" : 800,
"route_num_bins_y" : 415,
"node_area_adjust_overflow" : 0.20,
"adjust_route_area_flag" : 1,
"adjust_nctugr_area_flag" : 1,
"adjust_rudy_area_flag" : 0,
"adjust_pin_area_flag" : 0,
"area_adjust_stop_ratio" : 0.01,
"route_area_adjust_stop_ratio" : 0.01,
Expand Down

0 comments on commit d5fe491

Please sign in to comment.