-
Notifications
You must be signed in to change notification settings - Fork 415
[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 all commits
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
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1400,6 +1400,10 @@ struct t_router_opts { | |
std::string write_intra_cluster_router_lookahead; | ||
std::string read_intra_cluster_router_lookahead; | ||
|
||
///@brief The name of the output .csv file when PROFILE_LOOKAHEAD and --profile_router_lookahead are used. | ||
///If the string is empty, there will be no output. | ||
std::string lookahead_profiling_output; | ||
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. Add doxygen comment for this (can use ///). |
||
|
||
e_heap_type router_heap; | ||
bool exit_after_first_routing_iteration; | ||
|
||
|
@@ -1667,23 +1671,32 @@ constexpr bool is_src_sink(e_rr_type type) { return (type == SOURCE || type == S | |
* @brief Extra information about each rr_node needed only during routing | ||
* (i.e. during the maze expansion). | ||
* | ||
* @param prev_edge ID of the edge (globally unique edge ID in the RR Graph) | ||
* that was used to reach this node from the previous node. | ||
* If there is no predecessor, prev_edge = NO_PREVIOUS. | ||
* @param acc_cost Accumulated cost term from previous Pathfinder iterations. | ||
* @param path_cost Total cost of the path up to and including this node + | ||
* the expected cost to the target if the timing_driven router | ||
* is being used. | ||
* @param backward_path_cost Total cost of the path up to and including this | ||
* node. | ||
* @param occ The current occupancy of the associated rr node | ||
* @param prev_edge ID of the edge (globally unique edge ID in the RR Graph) | ||
* that was used to reach this node from the previous node. | ||
* If there is no predecessor, prev_edge = NO_PREVIOUS. | ||
* @param acc_cost Accumulated cost term from previous Pathfinder iterations. | ||
* @param path_cost Total cost of the path up to and including this node + | ||
* the expected cost to the target if the timing_driven router | ||
* is being used. | ||
* @param backward_path_cost Total cost of the path up to and including | ||
* this node. | ||
* @param occ The current occupancy of the associated rr node | ||
*/ | ||
struct t_rr_node_route_inf { | ||
RREdgeId prev_edge; | ||
|
||
float acc_cost; | ||
float path_cost; | ||
float backward_path_cost; | ||
#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. 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. |
||
// This data is needed for the LookaheadProfiler, when enabled. It is only conditionally | ||
// compiled since this struct is a hot and large data structure. | ||
|
||
///@brief Total delay in the path up to and including this node. | ||
float backward_path_delay; | ||
///@brief Total congestion in the path up to and including this node. | ||
float backward_path_congestion; | ||
nedsels marked this conversation as resolved.
Show resolved
Hide resolved
|
||
#endif | ||
|
||
public: //Accessors | ||
short occ() const { return occ_; } | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,6 +110,22 @@ static void generic_compute_matrix_iterative_astar( | |
const std::set<std::string>& allowed_types, | ||
bool /***/); | ||
|
||
/** | ||
* @brief Compute delta delay matrix using Djikstra's algorithm to find shortest paths from a IPIN at the | ||
* source location to OPINs within (start_x, start_y) to (end_x, end_y). | ||
* | ||
* @param route_profiler Only used to call get_net_list(), which is passed into | ||
* calculate_all_path_delays_from_rr_node(), which is needed for the LookaheadProfiler. | ||
* @param matrix The matrix to be filled. | ||
* @param layer_num The layer of the source and sink nodes to be sampled. | ||
* @param (source_x, source_y) The coordinates of the tile to sample an IPIN at. | ||
* @param (start_x, start_y, end_x, end_y) The bounds within which OPINs should be sampled. | ||
* @param router_opts | ||
* @param measure_directconnect Whether to measure/include direct connects. | ||
* @param allowed_types The allowed tile type names for the source location. If this vector is empty, all | ||
* names are allowed. If the source tile type is not allowed, the matrix is filled with EMPTY_DELTA. | ||
* @param is_flat Whether flat routing is being used. | ||
*/ | ||
static void generic_compute_matrix_dijkstra_expansion( | ||
RouterDelayProfiler& route_profiler, | ||
vtr::Matrix<std::vector<float>>& matrix, | ||
|
@@ -441,7 +457,7 @@ static void add_delay_to_matrix( | |
} | ||
|
||
static void generic_compute_matrix_dijkstra_expansion( | ||
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. It would be good to add a doxygen comment for this, detailing what you know about the function and its arguments (and for sure what the route_profiler does). |
||
RouterDelayProfiler& /*route_profiler*/, | ||
RouterDelayProfiler& route_profiler, | ||
vtr::Matrix<std::vector<float>>& matrix, | ||
int layer_num, | ||
int source_x, | ||
|
@@ -489,7 +505,7 @@ static void generic_compute_matrix_dijkstra_expansion( | |
RRNodeId source_rr_node = device_ctx.rr_graph.node_lookup().find_node(layer_num, source_x, source_y, SOURCE, driver_ptc); | ||
|
||
VTR_ASSERT(source_rr_node != RRNodeId::INVALID()); | ||
auto delays = calculate_all_path_delays_from_rr_node(source_rr_node, router_opts, is_flat); | ||
auto delays = calculate_all_path_delays_from_rr_node(source_rr_node, router_opts, is_flat, route_profiler.get_net_list()); | ||
|
||
bool path_to_all_sinks = true; | ||
for (int sink_x = start_x; sink_x <= end_x; sink_x++) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,15 @@ 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 |
||
// This data is needed for the LookaheadProfiler, when enabled. It is only conditionally | ||
// compiled since there may be many instances of this struct and it is in hot code. | ||
|
||
///@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.; | ||
|
Uh oh!
There was an error while loading. Please reload this page.