-
Notifications
You must be signed in to change notification settings - Fork 423
[WIP] Router Lookahead Profiler #2683
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
739029b
aa5570b
c88364a
d406c57
c86ff7c
ddf34eb
0826ad7
e8ea974
0b5a752
cbe1334
80086ff
c747096
e753094
d9f4ee3
dfab0a8
c9801b7
7fe0b55
c8b196e
ed4460d
ab2c731
2db5325
17ab565
595af59
2f10ec5
9bcad70
c05e498
643811b
1c9bb58
deddc8a
971eebc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -239,12 +239,21 @@ t_heap* ConnectionRouter<Heap>::timing_driven_route_connection_from_heap(RRNodeI | |
// This is then placed into the traceback so that the correct path is returned | ||
// TODO: This can be eliminated by modifying the actual traceback function in route_timing | ||
if (rcv_path_manager.is_enabled()) { | ||
#ifdef PROFILE_LOOKAHEAD | ||
rcv_path_manager.insert_backwards_path_into_traceback(cheapest->path_data, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is PROFILE_LOOKAHEAD tested with rcv? If not, we could just choose to not support PROFILE_LOOKAHEAD with RCV to simplify the code a little. |
||
cheapest->cost, | ||
cheapest->backward_path_cost, | ||
cheapest->backward_path_delay, | ||
cheapest->backward_path_congestion, | ||
route_ctx); | ||
#else | ||
rcv_path_manager.insert_backwards_path_into_traceback(cheapest->path_data, | ||
cheapest->cost, | ||
cheapest->backward_path_cost, | ||
/*backward_path_delay=*/0.f, | ||
/*backward_path_congestion=*/0.f, | ||
route_ctx); | ||
#endif | ||
} | ||
VTR_LOGV_DEBUG(router_debug_, " Found target %8d (%s)\n", inode, describe_rr_node(device_ctx.rr_graph, device_ctx.grid, device_ctx.rr_indexed_data, inode, is_flat_).c_str()); | ||
break; | ||
|
@@ -557,8 +566,10 @@ void ConnectionRouter<Heap>::timing_driven_add_to_heap(const t_conn_cost_params& | |
// Costs initialized to current | ||
next.cost = std::numeric_limits<float>::infinity(); //Not used directly | ||
next.backward_path_cost = current->backward_path_cost; | ||
#ifdef PROFILE_LOOKAHEAD | ||
next.backward_path_delay = current->backward_path_delay; | ||
next.backward_path_congestion = current->backward_path_congestion; | ||
#endif | ||
|
||
// path_data variables are initialized to current values | ||
if (rcv_path_manager.is_enabled() && current->path_data) { | ||
|
@@ -604,8 +615,10 @@ void ConnectionRouter<Heap>::timing_driven_add_to_heap(const t_conn_cost_params& | |
next_ptr->cost = next.cost; | ||
next_ptr->R_upstream = next.R_upstream; | ||
next_ptr->backward_path_cost = next.backward_path_cost; | ||
#ifdef PROFILE_LOOKAHEAD | ||
next_ptr->backward_path_delay = next.backward_path_delay; | ||
next_ptr->backward_path_congestion = next.backward_path_congestion; | ||
#endif | ||
next_ptr->index = to_node; | ||
next_ptr->set_prev_edge(from_edge); | ||
|
||
|
@@ -793,8 +806,10 @@ void ConnectionRouter<Heap>::evaluate_timing_driven_node_costs(t_heap* to, | |
//Update the backward cost (upstream already included) | ||
to->backward_path_cost += (1. - cost_params.criticality) * cong_cost; //Congestion cost | ||
to->backward_path_cost += cost_params.criticality * Tdel; //Delay cost | ||
#ifdef PROFILE_LOOKAHEAD | ||
to->backward_path_delay += Tdel; | ||
to->backward_path_congestion += cong_cost; | ||
#endif | ||
|
||
if (cost_params.bend_cost != 0.) { | ||
t_rr_type from_type = rr_graph_->node_type(from_node); | ||
|
@@ -843,8 +858,10 @@ void ConnectionRouter<Heap>::empty_heap_annotating_node_route_inf() { | |
|
||
rr_node_route_inf_[tmp->index].path_cost = tmp->cost; | ||
rr_node_route_inf_[tmp->index].backward_path_cost = tmp->backward_path_cost; | ||
#ifdef PROFILE_LOOKAHEAD | ||
rr_node_route_inf_[tmp->index].backward_path_delay = tmp->backward_path_delay; | ||
rr_node_route_inf_[tmp->index].backward_path_congestion = tmp->backward_path_congestion; | ||
#endif | ||
modified_rr_node_inf_.push_back(tmp->index); | ||
|
||
rcv_path_manager.free_path_struct(tmp->path_data); | ||
|
@@ -905,8 +922,10 @@ void ConnectionRouter<Heap>::add_route_tree_node_to_heap( | |
const auto& device_ctx = g_vpr_ctx.device(); | ||
const RRNodeId inode = rt_node.inode; | ||
float backward_path_cost = cost_params.criticality * rt_node.Tdel; | ||
#ifdef PROFILE_LOOKAHEAD | ||
float backward_path_delay = rt_node.Tdel; | ||
float backward_path_congestion = 0.0; | ||
#endif | ||
float R_upstream = rt_node.R_upstream; | ||
|
||
/* Don't push to heap if not in bounding box: no-op for serial router, important for parallel router */ | ||
|
@@ -928,6 +947,7 @@ void ConnectionRouter<Heap>::add_route_tree_node_to_heap( | |
tot_cost, | ||
describe_rr_node(device_ctx.rr_graph, device_ctx.grid, device_ctx.rr_indexed_data, inode, is_flat_).c_str()); | ||
|
||
#ifdef PROFILE_LOOKAHEAD | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could reverse the order of these two pieces of code with an ifndef so the default flow comes first. Small tweak, but might be a little more user friendly. |
||
push_back_node(&heap_, | ||
rr_node_route_inf_, | ||
inode, | ||
|
@@ -937,6 +957,17 @@ void ConnectionRouter<Heap>::add_route_tree_node_to_heap( | |
backward_path_delay, | ||
backward_path_congestion, | ||
R_upstream); | ||
#else | ||
push_back_node(&heap_, | ||
rr_node_route_inf_, | ||
inode, | ||
tot_cost, | ||
/*prev_edge=*/RREdgeId::INVALID(), | ||
backward_path_cost, | ||
/*backward_path_delay=*/0.f, | ||
/*backward_path_congestion=*/0.f, | ||
R_upstream); | ||
#endif | ||
} else { | ||
float expected_total_cost = compute_node_cost_using_rcv(cost_params, inode, target_node, rt_node.Tdel, 0, R_upstream); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,10 +18,12 @@ struct t_heap { | |
///@brief The "known" cost of the path up to and including this node. Used only by the timing-driven router. In this case, the | ||
///.cost member contains not only the known backward cost but also an expected cost to the target. | ||
float backward_path_cost = 0.; | ||
#ifdef PROFILE_LOOKAHEAD | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggest adding a comment saying the number of instances of this data structure can be large and it is in hot code, so extra data only needed to profile/verify the lookahead is #ifdef'd |
||
///@brief The "known" delay in the path up to and including this node. Recorded for LookaheadProfiler during routing. | ||
float backward_path_delay = 0.; | ||
///@brief The "known" congestion in the path up to and including this node. Recorded for LookaheadProfiler during routing. | ||
float backward_path_congestion = 0.; | ||
nedsels marked this conversation as resolved.
Show resolved
Hide resolved
|
||
#endif | ||
///@brief Used only by the timing-driven router. Stores the upstream resistance to ground from this node, including the resistance | ||
/// of the node itself (device_ctx.rr_nodes[index].R). | ||
float R_upstream = 0.; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add a brief comment saying why this extra data is needed for PROFILE_LOOKAHEAD, and that we conditionally compile it because this is a hot and large data structure.