clear up look ahead profiling: removed NETWISELOOKAHEADEVAL, moved profile code out to profile_lookahead.c
diff --git a/vpr/SRC/route/profile_lookahead.c b/vpr/SRC/route/profile_lookahead.c
index 38e3651..a8b93f9 100644
--- a/vpr/SRC/route/profile_lookahead.c
+++ b/vpr/SRC/route/profile_lookahead.c
@@ -3,7 +3,6 @@
using namespace std;
void print_start_end_to_sink(bool is_start, int itry, int inet, int target_node, int itarget) {
-#if DEBUGEXPANSIONRATIO == 1
if (itry == DB_ITRY && target_node == DB_TARGET_NODE){
if (is_start) {
printf("\n**** itry %d\tSTART ROUTE TO net %d\ttarget %d\tinode %d\n",
@@ -14,7 +13,6 @@
itry, inet, itarget, target_node);
}
}
-#endif
}
void print_expand_neighbours(bool is_parent, int inode, int target_node,
@@ -105,3 +103,68 @@
//printf("\n");
}
+
+void print_critical_path_from_rt(struct s_heap *hptr, float target_criticality, int new_nodes_count, float actual_Tdel) {
+ int target_node = hptr->index;
+ if (target_node == DB_TARGET_NODE && itry_share == DB_ITRY) {
+ int inode = hptr->u.prev_node;
+ printf("CRITICAL PATH %d: back trace start\tcrit: %fNEW NODES %d\n", target_node, target_criticality, new_nodes_count);
+ while (rr_node_route_inf[inode].prev_node != NO_PREVIOUS) {
+ // this is backtrace, so print in anti-direction order
+ int ix_s, ix_e, iy_s, iy_e;
+ get_unidir_seg_end(inode, &ix_s, &iy_s);
+ get_unidir_seg_start(inode, &ix_e, &iy_e);
+ int prev_inode = rr_node_route_inf[inode].prev_node;
+ float bTdel = rr_node_route_inf[inode].back_Tdel;
+ float bbTdel = rr_node_route_inf[prev_inode].back_Tdel;
+ int wire_type = rr_indexed_data[rr_node[inode].get_cost_index()].seg_index;
+ float dummy, basecost = 0;
+ printf("\tid:%d - %d\tstart(%d,%d)\tend(%d,%d)\tbackTdel:%einodeTdel:%e\tactual future Tdel:%.3f\test future Tdel:%.3f\n",
+ inode, wire_type, ix_s, iy_s, ix_e, iy_e,
+ bTdel, (bTdel - bbTdel),
+ (actual_Tdel - bTdel) * pow(10, 10),
+ get_timing_driven_future_Tdel(inode, target_node, &dummy, &basecost) * pow(10, 10));
+ inode = prev_inode;
+ }
+ }
+}
+
+void setup_new_lookahead_dev(int furthest_wire_inode, int target_node, float total_Tdel, int new_nodes_count) {
+ /*
+ float estimated_future_cost = rr_node_route_inf[inode].path_cost
+ - rr_node_route_inf[inode].backward_path_cost;
+ float actual_future_cost = actual_tot_cost
+ - rr_node_route_inf[inode].backward_path_cost;
+ */
+ float new_nodes_dev = 0.;
+ float estimated_future_cost, actual_future_cost;
+ float c_downstream, basecost;
+ estimated_future_cost = get_timing_driven_future_Tdel(furthest_wire_inode, target_node, &c_downstream, &basecost);
+ actual_future_cost = total_Tdel - rr_node_route_inf[furthest_wire_inode].back_Tdel;
+
+ if (subtree_count.count(new_nodes_count) <= 0) {
+ subtree_count[new_nodes_count] = 0;
+ subtree_size_avg[new_nodes_count] = 0;
+ subtree_est_dev_avg[new_nodes_count] = 0;
+ }
+ if (actual_future_cost != 0) {
+ new_nodes_dev = (estimated_future_cost / actual_future_cost - 1);
+ }
+ subtree_count[new_nodes_count] ++;
+ int tree_counter = subtree_count[new_nodes_count];
+ // running avg: geo mean for subtree size; arithmetic mean for dev
+ if (subtree_size_avg[new_nodes_count] == 0) {
+ subtree_size_avg[new_nodes_count] = subtree_size_avg[0];
+ } else {
+ float temp = pow(subtree_size_avg[new_nodes_count], (tree_counter - 1) / (float)tree_counter);
+ subtree_size_avg[new_nodes_count] = temp * pow(subtree_size_avg[0], 1.0/(float)tree_counter);
+ }
+ if (target_node == DB_TARGET_NODE) {
+ print_db_node_inf(DB_TARGET_NODE);
+ }
+ float cur_dev = new_nodes_dev;
+ if (cur_dev < -0.6 && new_nodes_count > 10)
+ printf("\nXXXXX TARGET NODE %d\n\n", target_node);
+ subtree_est_dev_avg[new_nodes_count] = ((tree_counter - 1) * subtree_est_dev_avg[new_nodes_count]
+ + cur_dev) / (float)tree_counter;
+}
diff --git a/vpr/SRC/route/profile_lookahead.h b/vpr/SRC/route/profile_lookahead.h
index 2d9c3b3..048fac2 100644
--- a/vpr/SRC/route/profile_lookahead.h
+++ b/vpr/SRC/route/profile_lookahead.h
@@ -16,13 +16,10 @@
#include "route_common.h"
#include "route_tree_timing.h"
#include "route_timing.h"
-#include "heapsort.h"
#include "path_delay.h"
#include "net_delay.h"
#include "stats.h"
-#include "ReadOptions.h"
-using namespace std;
/* to be called in timing_driven_expand_neighbours */
void print_start_end_to_sink(bool is_start, int itry, int inet, int target_node, int itarget);
void print_expand_neighbours(bool is_parent, int inode, int target_node,
@@ -31,3 +28,5 @@
float cur_basecost, float cong_cost);
void setup_max_min_criticality(float &max_crit, float &min_crit,
int &max_inet, int &min_inet, int &max_ipin, int &min_ipin, t_slack * slacks);
+void print_critical_path_from_rt(struct s_heap *hptr, float target_criticality, int new_nodes_count, float actual_Tdel);
+void setup_new_lookahead_dev(int furthest_wire_inode, int target_node, float total_Tdel, int new_nodes_count);
diff --git a/vpr/SRC/route/route_common.c b/vpr/SRC/route/route_common.c
index c9c5631..e01e637 100755
--- a/vpr/SRC/route/route_common.c
+++ b/vpr/SRC/route/route_common.c
@@ -42,24 +42,18 @@
int itry_share = 0;
float opin_penalty = OPIN_INIT_PENALTY;
float future_cong_penalty = 1.0;
-int node_on_path = 0;
-int node_expanded_per_net = 0;
int node_expanded_per_sink = 0;
-float estimated_cost_deviation = 0;
-float estimated_cost_deviation_abs = 0;
int total_nodes_expanded = 0;
+/* potentially used for condition of turning on new look ahead */
int nodes_expanded_cur_itr = UNDEFINED;
int nodes_expanded_1st_itr = UNDEFINED;
int nodes_expanded_pre_itr = UNDEFINED;
int nodes_expanded_max_itr = UNDEFINED;
float cong_cur_itr = UNDEFINED;
float cong_pre_itr = UNDEFINED;
-#if DEPTHWISELOOKAHEADEVAL == 1
map<int, int> subtree_count;
map<int, float> subtree_size_avg;
map<int, float> subtree_est_dev_avg;
-map<int, float> subtree_est_dev_abs_avg;
-#endif
#if LOOKAHEADBYHISTORY == 1
/* these arrays are initialized in alloc_and_load_rr_graph() */
float **max_cost_by_relative_pos = NULL;
diff --git a/vpr/SRC/route/route_common.h b/vpr/SRC/route/route_common.h
index e2bbbc0..0f00f05 100755
--- a/vpr/SRC/route/route_common.h
+++ b/vpr/SRC/route/route_common.h
@@ -4,8 +4,6 @@
#include <map>
#define DEBUGEXPANSIONRATIO 0
-#define DEPTHWISELOOKAHEADEVAL 1
-#define NETWISELOOKAHEADEVAL 0
#define LOOKAHEADBYHISTORY 0
// turn this on together with the LOOKAHEADCONGMAP in expand_neighbours
#define CONGESTIONBYCHIPAREA 0
@@ -25,7 +23,7 @@
#define OPIN_DECAY_RATE 0.9
#define ALLOWED_HEAP_ERR 0.02 /* for the new get heap head method (take into account (x,y)) */
#define DB_ITRY 5
-#define DB_TARGET_NODE 102804
+#define DB_TARGET_NODE -1
using namespace std;
#if SPACEDRIVENHEAP == 1
extern float heap_min_cost;
@@ -105,12 +103,10 @@
extern int itry_share;
extern float opin_penalty;
extern float future_cong_penalty;
-extern int node_on_path;
-extern int node_expanded_per_net;
extern int node_expanded_per_sink;
-extern float estimated_cost_deviation;
-extern float estimated_cost_deviation_abs;
/*
+ * The following are used for evaluating the quality of look ahead:
+ *
* subtree: the subtree built when routing a SOURCE to a SINK, consisting of nodes expanded
* map key: depth of the subtree
* map value:
@@ -118,7 +114,6 @@
* subtree_size_avg: average number of nodes on the subtree of that depth
subtree_size_avg[0] is storing the number of expanded nodes of current routing
* subtree_est_dev_avg: average deviation of estimated lookahead cost and actual future path cost of this depth subtree
- * subtree_est_dev_abs_avg: the absolute deviation
*
*/
extern int total_nodes_expanded;
@@ -128,12 +123,10 @@
extern int nodes_expanded_max_itr;
extern float cong_cur_itr;
extern float cong_pre_itr;
-#if DEPTHWISELOOKAHEADEVAL == 1
extern map<int, int> subtree_count;
extern map<int, float> subtree_size_avg;
extern map<int, float> subtree_est_dev_avg;
-extern map<int, float> subtree_est_dev_abs_avg;
-#endif
+
#if LOOKAHEADBYHISTORY == 1
/*
* the below 4 2D arrays are indexed by relative position between
diff --git a/vpr/SRC/route/route_timing.c b/vpr/SRC/route/route_timing.c
index 268cc58..7dc17b3 100755
--- a/vpr/SRC/route/route_timing.c
+++ b/vpr/SRC/route/route_timing.c
@@ -228,15 +228,12 @@
#if OPINPENALTY == 1
opin_penalty *= OPIN_DECAY_RATE;
#endif
-#if DEPTHWISELOOKAHEADEVAL == 1
if (router_opts.lookahead_eval) {
subtree_count.clear();
subtree_size_avg.clear();
subtree_est_dev_avg.clear();
- subtree_est_dev_abs_avg.clear();
subtree_size_avg[0] = 0;
}
-#endif
/* Reset "is_routed" and "is_fixed" flags to indicate nets not pre-routed (yet) */
for (unsigned int inet = 0; inet < g_clbs_nlist.net.size(); ++inet) {
g_clbs_nlist.net[inet].is_routed = false;
@@ -694,10 +691,6 @@
rt_root = init_route_tree_to_source(inet);
- node_expanded_per_net = 0;
- node_on_path = 0;
- estimated_cost_deviation = 0;
- estimated_cost_deviation_abs = 0;
// explore in order of decreasing criticality
for (itarget = 1; itarget <= num_sinks; itarget++) {
target_pin = sink_order[itarget];
@@ -742,9 +735,9 @@
inode = cheapest->index;
node_expanded_per_sink = 0;
-
+#if DEBUGEXPANSIONRATIO == 1
print_start_end_to_sink(true, itry, inet, target_node, itarget);
-
+#endif
while (inode != target_node) {
old_total_cost = rr_node_route_inf[inode].path_cost;
new_total_cost = cheapest->cost;
@@ -804,15 +797,16 @@
* all take a traceback structure as input. Before this routine exits the *
* route_tree structure is destroyed; only the traceback is needed at that *
* point. */
-#if DEPTHWISELOOKAHEADEVAL == 1
- subtree_size_avg[0] = node_expanded_per_sink;
-#endif
+ if (lookahead_eval)
+ subtree_size_avg[0] = node_expanded_per_sink;
rr_node_route_inf[inode].target_flag--; /* Connected to this SINK. */
new_route_start_tptr = update_traceback(cheapest, inet);
rt_node_of_sink[target_pin] = update_route_tree(cheapest, lookahead_eval, target_criticality);
free_heap_data(cheapest);
pathfinder_update_one_cost(new_route_start_tptr, 1, pres_fac);
+#if DEBUGEXPANSIONRATIO == 1
print_start_end_to_sink(false, itry, inet, target_node, itarget);
+#endif
empty_heap();
reset_path_costs();
}
@@ -974,11 +968,8 @@
node_to_heap(to_node, new_tot_cost, inode, iconn, new_back_pcost,
new_R_upstream, Tdel + current->back_Tdel);
#endif
- if (lookahead_eval) {
- if (new_tot_cost < rr_node_route_inf[to_node].path_cost) {
- node_expanded_per_net ++;
- node_expanded_per_sink ++;
- }
+ if (lookahead_eval && new_tot_cost < rr_node_route_inf[to_node].path_cost) {
+ node_expanded_per_sink ++;
}
#if DEBUGEXPANSIONRATIO == 1
if (new_tot_cost < rr_node_route_inf[to_node].path_cost) {
@@ -1389,6 +1380,11 @@
/****************************** END function definition for new look ahead *************************************/
float get_timing_driven_cong_penalty (int inode, int target_node) {
+ /*
+ * NOTE:
+ * this function could be ignored, as the result of adding
+ * congestion penalty is not satisfying
+ */
float penalty = 1.0;
#if CONGESTIONBYCHIPAREA == 1
int to_x_mid = (rr_node[inode].get_xhigh() + rr_node[inode].get_xlow()) / 2;
diff --git a/vpr/SRC/route/route_tree_timing.c b/vpr/SRC/route/route_tree_timing.c
index 28c359f..b397636 100755
--- a/vpr/SRC/route/route_tree_timing.c
+++ b/vpr/SRC/route/route_tree_timing.c
@@ -219,36 +219,7 @@
return (sink_rt_node);
}
-#if LOOKAHEADBYHISTORY == 1
-/*
- * util function called by add_path_to_route_tree
- */
-static void get_rt_subtree_bb_coord (int inode, int *bb_coord_x, int *bb_coord_y) {
- int type = rr_node[inode].type;
- int dir = rr_node[inode].get_direction();
- int xhigh = rr_node[inode].get_xhigh();
- int xlow = rr_node[inode].get_xlow();
- int yhigh = rr_node[inode].get_yhigh();
- int ylow = rr_node[inode].get_ylow();
- if (type == CHANX || type == CHANY) {
- if (dir == INC_DIRECTION) {
- *bb_coord_x = xlow;
- *bb_coord_x = ylow;
- } else if (dir == DEC_DIRECTION) {
- *bb_coord_x = xlow;
- *bb_coord_y = ylow;
- } else {
- // Bi-directional
- *bb_coord_x = (xhigh + xlow) / 2;
- *bb_coord_y = (yhigh + ylow) / 2;
- }
- } else {
- // OPIN
- *bb_coord_x = (xhigh + xlow) / 2;
- *bb_coord_y = (yhigh + ylow) / 2;
- }
-}
-#endif
+
static t_rt_node *
add_path_to_route_tree(struct s_heap *hptr, t_rt_node ** sink_rt_node_ptr, bool lookahead_eval, float target_criticality) {
@@ -319,11 +290,7 @@
/* For all "new" nodes in the path */
int new_nodes_count = 0;
- float new_nodes_dev = 0;
new_nodes_count += 0;
- new_nodes_dev += 0;
- float new_nodes_abs_dev = 0;
- new_nodes_abs_dev += 0;
float total_Tdel = rr_node_route_inf[inode].back_Tdel;
total_Tdel += 0.;
@@ -334,30 +301,6 @@
|| rr_node[inode].type == CHANY)
furthest_wire_inode = inode;
new_nodes_count ++;
- if (lookahead_eval) {
-#if NETWISELOOKAHEADEVAL == 1 || DEPTHWISELOOKAHEADEVAL == 1
- float estimated_future_cost, c_downstream, basecost = 0;
- estimated_future_cost = get_timing_driven_future_Tdel(inode, target_node, &c_downstream, &basecost);
- float actual_future_cost = total_Tdel - rr_node_route_inf[inode].back_Tdel;
- estimated_future_cost += 0.0;
- actual_future_cost += 0.0;
-#endif
-#if NETWISELOOKAHEADEVAL == 1
- node_on_path ++;
- if ( actual_future_cost != 0 ) {
- estimated_cost_deviation += (estimated_future_cost / actual_future_cost - 1);
- estimated_cost_deviation_abs += abs(estimated_future_cost / actual_future_cost - 1);
- }
-#endif
-#if DEPTHWISELOOKAHEADEVAL == 1
- /*
- if (actual_future_cost != 0) {
- new_nodes_dev += (estimated_future_cost / total_Tdel - 1);
- new_nodes_abs_dev += abs(estimated_future_cost / total_Tdel - 1);
- }
- */
-#endif
- }
linked_rt_edge = alloc_linked_rt_edge();
linked_rt_edge->child = downstream_rt_node;
linked_rt_edge->iswitch = iswitch;
@@ -401,29 +344,9 @@
inode = rr_node_route_inf[inode].prev_node;
iswitch = rr_node[inode].switches[iedge];
}
- // XXX: only print out for critical path
#if PRINTCRITICALPATH == 1
- if (target_node == DB_TARGET_NODE && itry_share == DB_ITRY) {
- int iinode = hptr->u.prev_node;
- printf("CRITICAL PATH %d: back trace start\tcrit: %fNEW NODES %d\n", target_node, target_criticality, new_nodes_count);
- while (rr_node_route_inf[iinode].prev_node != NO_PREVIOUS) {
- // this is backtrace, so print in anti-direction order
- int ix_s, ix_e, iy_s, iy_e;
- get_unidir_seg_end(iinode, &ix_s, &iy_s);
- get_unidir_seg_start(iinode, &ix_e, &iy_e);
- int prev_iinode = rr_node_route_inf[iinode].prev_node;
- float bTdel = rr_node_route_inf[iinode].back_Tdel;
- float bbTdel = rr_node_route_inf[prev_iinode].back_Tdel;
- int wire_type = rr_indexed_data[rr_node[iinode].get_cost_index()].seg_index;
- float dummy, basecost = 0;
- printf("\tid:%d - %d\tstart(%d,%d)\tend(%d,%d)\tbackTdel:%einodeTdel:%e\tactual future Tdel:%.3f\test future Tdel:%.3f\n",
- iinode, wire_type, ix_s, iy_s, ix_e, iy_e,
- bTdel, (bTdel - bbTdel),
- (actual_Tdel - bTdel) * pow(10, 10),
- get_timing_driven_future_Tdel(iinode, target_node, &dummy, &basecost) * pow(10, 10));
- iinode = prev_iinode;
- }
- }
+ // only critical path is printed out
+ print_critical_path_from_rt(hptr, target_criticality, new_nodes_count, actual_Tdel);
#endif
/* Inode is the join point to the old routing */
if (rr_node[inode].type == CHANX
@@ -443,86 +366,11 @@
downstream_rt_node->parent_switch = iswitch;
new_nodes_count ++ ;
- // new_nodes_count ++ / node_on_path ++ accouts for the intersection node
- //if (new_nodes_count == 14)
- // printf("TARGET NODE %d\n", target_node);
if (lookahead_eval){
-#if NETWISELOOKAHEADEVAL == 1 || DEPTHWISELOOKAHEADEVAL == 1
- /*
- float estimated_future_cost = rr_node_route_inf[inode].path_cost
- - rr_node_route_inf[inode].backward_path_cost;
- float actual_future_cost = actual_tot_cost
- - rr_node_route_inf[inode].backward_path_cost;
- */
- float estimated_future_cost, c_downstream, basecost = 0;
- estimated_future_cost = get_timing_driven_future_Tdel(furthest_wire_inode, target_node, &c_downstream, &basecost);
- float actual_future_cost = total_Tdel - rr_node_route_inf[furthest_wire_inode].back_Tdel;
-
-#endif
-#if NETWISELOOKAHEADEVAL == 1
- // netwise lookahead_eval finishing up
- node_on_path ++;
- if ( actual_future_cost != 0 ) {
- estimated_cost_deviation += (estimated_future_cost / actual_future_cost - 1);
- estimated_cost_deviation_abs += abs(estimated_future_cost / actual_future_cost - 1);
- }
-#endif
-#if DEPTHWISELOOKAHEADEVAL == 1
- // depthwise lookahead_eval setting up
- if (subtree_count.count(new_nodes_count) <= 0) {
- subtree_count[new_nodes_count] = 0;
- subtree_size_avg[new_nodes_count] = 0;
- subtree_est_dev_avg[new_nodes_count] = 0;
- subtree_est_dev_abs_avg[new_nodes_count] = 0;
- }
- if (actual_future_cost != 0) {
- new_nodes_dev += (estimated_future_cost / actual_future_cost - 1);
- new_nodes_abs_dev += abs(estimated_future_cost / actual_future_cost - 1);
- }
- subtree_count[new_nodes_count] ++;
- int tree_counter = subtree_count[new_nodes_count];
- // running avg
- // arithmetic avg
- //subtree_size_avg[new_nodes_count] = ((tree_counter - 1) * subtree_size_avg[new_nodes_count]
- // + subtree_size_avg[0]) / (float)tree_counter;
- // geometric avg
- if (subtree_size_avg[new_nodes_count] == 0) {
- subtree_size_avg[new_nodes_count] = subtree_size_avg[0];
- /*
- if (new_nodes_count == 19)
- printf("\nitry %d\tTARGET NODE %d\tsubtree count %d\tsubtree expanded nodes %f\n", itry_share, target_node, subtree_count[19], subtree_size_avg[0]);
- */
- if (target_node == DB_TARGET_NODE) {
- print_db_node_inf(DB_TARGET_NODE);
- print_db_node_inf(hptr->u.prev_node);
- }
- } else {
- float temp = pow(subtree_size_avg[new_nodes_count], (tree_counter - 1) / (float)tree_counter);
- subtree_size_avg[new_nodes_count] = temp * pow(subtree_size_avg[0], 1.0/(float)tree_counter);
- }
- float cur_dev = new_nodes_dev; // / new_nodes_count;
- /*
- if (cur_dev == -1) {
- printf("@@@@@@@\titry %d\ttarget_node %d\tnew nodes count %d\n", itry_share, target_node, new_nodes_count);
- assert(cur_dev != -1);
- }
- */
- if (cur_dev < -0.6 && new_nodes_count > 10)
- printf("\nXXXXX TARGET NODE %d\n\n", target_node);
- float cur_dev_abs = new_nodes_abs_dev / new_nodes_count;
- subtree_est_dev_avg[new_nodes_count] = ((tree_counter - 1) * subtree_est_dev_avg[new_nodes_count]
- + cur_dev) / (float)tree_counter;
- //subtree_est_dev_abs_avg[new_nodes_count] = ((tree_counter - 1) * subtree_est_dev_abs_avg[new_nodes_count]
- // + cur_dev_abs) / (float)tree_counter;
- if (subtree_est_dev_abs_avg[new_nodes_count] == 0) {
- subtree_est_dev_abs_avg[new_nodes_count] = cur_dev_abs;
- } else {
- float temp = pow(subtree_est_dev_abs_avg[new_nodes_count], (tree_counter - 1) / (float)tree_counter);
- subtree_est_dev_abs_avg[new_nodes_count] = temp * pow(cur_dev_abs, 1.0/(float)tree_counter);
- }
-#endif
+ setup_new_lookahead_dev(furthest_wire_inode, target_node, total_Tdel, new_nodes_count);
}
+
*sink_rt_node_ptr = sink_rt_node;
return (downstream_rt_node);
}
diff --git a/vpr/SRC/util/vpr_utils.c b/vpr/SRC/util/vpr_utils.c
index 3d9ca21..5818aa2 100755
--- a/vpr/SRC/util/vpr_utils.c
+++ b/vpr/SRC/util/vpr_utils.c
@@ -1456,16 +1456,14 @@
}
void print_lookahead_eval() {
-#if DEPTHWISELOOKAHEADEVAL == 1
map<int, int>::iterator itr;
for (itr = subtree_count.begin(); itr != subtree_count.end(); itr++) {
int tree_depth = itr->first;
float expand_ratio = subtree_size_avg[tree_depth] / tree_depth;
float dev = subtree_est_dev_avg[tree_depth];
- float dev_abs = subtree_est_dev_abs_avg[tree_depth];
- printf("-- subtree depth: %d\tcount: %d\texpand ratio (geo): %.3f\tdev: %.4f\tdev abs (geo): %.4f\n", tree_depth, itr->second, expand_ratio, dev, dev_abs);
+ printf("-- subtree depth: %d\tcount: %d\texpand ratio (geo): %.3f\tdev: %.4f\n",
+ tree_depth, itr->second, expand_ratio, dev);
}
-#endif
}
void print_lookahead_by_history() {
@@ -1604,45 +1602,4 @@
rr_node[inode].get_xlow(), rr_node[inode].get_ylow(),
rr_node[inode].get_xhigh(), rr_node[inode].get_yhigh());
}
-/*
- * Motivation:
- * to see what portion of long wires are utilized
- * potentially a good measure for router look ahead quality
- */
-/*
-void print_usage_by_wire_length() {
- map<int, int> used_wire_count;
- map<int, int> total_wire_count;
- for (int inode = 0; inode < num_rr_nodes; inode++) {
- if (rr_node[inode].type == CHANX || rr_node[inode].type == CHANY) {
- //int length = abs(rr_node[inode].get_xhigh() + rr_node[inode].get_yhigh()
- // - rr_node[inode].get_xlow() - rr_node[inode].get_ylow());
- int length = rr_node[inode].get_length();
- if (rr_node[inode].get_occ() > 0) {
- if (used_wire_count.count(length) == 0)
- used_wire_count[length] = 0;
- used_wire_count[length] ++;
- }
- if (total_wire_count.count(length) == 0)
- total_wire_count[length] = 0;
- total_wire_count[length] ++;
- }
- }
- int total_wires = 0;
- map<int, int>::iterator itr;
- for (itr = total_wire_count.begin(); itr != total_wire_count.end(); itr++) {
- total_wires += itr->second;
- }
- printf("\n\t-=-=-=-=-=-=-=-=-=-=- wire usage stats -=-=-=-=-=-=-=-=-=-=-\n");
- for (itr = total_wire_count.begin(); itr != total_wire_count.end(); itr++)
- printf("\ttotal number: wire of length %d, ratio to all length of wires: %g\n", itr->first, ((float)itr->second) / total_wires);
- for (itr = used_wire_count.begin(); itr != used_wire_count.end(); itr++) {
- float ratio_to_same_type_total = ((float)itr->second) / total_wire_count[itr->first];
- float ratio_to_all_type_total = ((float)itr->second) / total_wires;
- printf("\t\tratio to same type of wire: %g\tratio to all types of wire: %g\n", ratio_to_same_type_total, ratio_to_all_type_total);
- }
- printf("\n\t-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n");
- used_wire_count.clear();
- total_wire_count.clear();
-}
-*/
+