@@ -486,13 +486,22 @@ void RouteTree::print(void) const {
486
486
* This routine returns a tuple: RouteTreeNode of the branch it adds to the route tree and
487
487
* RouteTreeNode of the SINK it adds to the routing. */
488
488
std::tuple<vtr::optional<const RouteTreeNode&>, vtr::optional<const RouteTreeNode&>>
489
- RouteTree::update_from_heap (t_heap* hptr, int target_net_pin_index, SpatialRouteTreeLookup* spatial_rt_lookup, bool is_flat, const RouterLookahead& router_lookahead, const t_conn_cost_params cost_params, const int itry, const Netlist<>& net_list, const ParentNetId& net_id) {
489
+ RouteTree::update_from_heap (t_heap* hptr,
490
+ int target_net_pin_index,
491
+ SpatialRouteTreeLookup* spatial_rt_lookup,
492
+ bool is_flat,
493
+ const RouterLookahead& router_lookahead,
494
+ const t_conn_cost_params cost_params,
495
+ const Netlist<>& net_list,
496
+ const ParentNetId& net_id,
497
+ const int itry,
498
+ bool profile_lookahead) {
490
499
/* Lock the route tree for writing. At least on Linux this shouldn't have an impact on single-threaded code */
491
500
std::unique_lock<std::mutex> write_lock (_write_mutex);
492
501
493
502
// Create a new subtree from the target in hptr to existing routing
494
503
vtr::optional<RouteTreeNode&> start_of_new_subtree_rt_node, sink_rt_node;
495
- std::tie (start_of_new_subtree_rt_node, sink_rt_node) = add_subtree_from_heap (hptr, target_net_pin_index, is_flat, router_lookahead, cost_params, itry, net_list, net_id);
504
+ std::tie (start_of_new_subtree_rt_node, sink_rt_node) = add_subtree_from_heap (hptr, target_net_pin_index, is_flat, router_lookahead, cost_params, itry, net_list, net_id, profile_lookahead );
496
505
497
506
if (!start_of_new_subtree_rt_node)
498
507
return {vtr::nullopt, *sink_rt_node};
@@ -515,7 +524,15 @@ RouteTree::update_from_heap(t_heap* hptr, int target_net_pin_index, SpatialRoute
515
524
* to the SINK indicated by hptr. Returns the first (most upstream) new rt_node,
516
525
* and the rt_node of the new SINK. Traverses up from SINK */
517
526
std::tuple<vtr::optional<RouteTreeNode&>, vtr::optional<RouteTreeNode&>>
518
- RouteTree::add_subtree_from_heap (t_heap* hptr, int target_net_pin_index, bool is_flat, const RouterLookahead& router_lookahead, const t_conn_cost_params cost_params, const int itry, const Netlist<>& net_list, const ParentNetId& net_id) {
527
+ RouteTree::add_subtree_from_heap (t_heap* hptr,
528
+ int target_net_pin_index,
529
+ bool is_flat,
530
+ const RouterLookahead& router_lookahead,
531
+ const t_conn_cost_params cost_params,
532
+ const int itry,
533
+ const Netlist<>& net_list,
534
+ const ParentNetId& net_id,
535
+ bool profile_lookahead) {
519
536
auto & device_ctx = g_vpr_ctx.device ();
520
537
const auto & rr_graph = device_ctx.rr_graph ;
521
538
auto & route_ctx = g_vpr_ctx.routing ();
@@ -549,12 +566,15 @@ RouteTree::add_subtree_from_heap(t_heap* hptr, int target_net_pin_index, bool is
549
566
}
550
567
new_branch_iswitches.push_back (new_iswitch);
551
568
552
- g_vpr_ctx.mutable_routing ().lookahead_profiler .record (itry,
553
- target_net_pin_index,
554
- cost_params,
555
- router_lookahead,
556
- net_id,
557
- net_list, std::vector<RRNodeId>());
569
+ if (profile_lookahead) {
570
+ g_vpr_ctx.mutable_routing ().lookahead_profiler .record (itry,
571
+ target_net_pin_index,
572
+ cost_params,
573
+ router_lookahead,
574
+ net_id,
575
+ net_list,
576
+ new_branch_inodes);
577
+ }
558
578
559
579
/* Build the new tree branch starting from the existing node we found */
560
580
RouteTreeNode* last_node = _rr_node_to_rt_node[new_inode];
0 commit comments