Skip to content

Commit 798055c

Browse files
committed
[vpr][pack] polish load_trace_to_pb_route
1 parent 86491fd commit 798055c

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

vpr/src/pack/cluster_router.cpp

+13-3
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,17 @@ static bool is_route_success(t_lb_router_data* router_data);
108108
static t_lb_trace* find_node_in_rt(t_lb_trace* rt, int rt_index);
109109
static void reset_explored_node_tb(t_lb_router_data* router_data);
110110
static void save_and_reset_lb_route(t_lb_router_data* router_data);
111+
112+
/**
113+
* @brief Recurse through route tree trace to populate pb pin to atom net lookup array.
114+
*
115+
* @param pb_route Array of pb pin to atom net lookup to be populated in this routine.
116+
* @param net_id Atom net ID of the current net.
117+
* @param prev_pin_id ID of the previous pin in the route tree trace.
118+
* @param trace Current trace node in the route tree.
119+
* @param logic_block_type Logic block type of the current cluster.
120+
* @param intra_lb_pb_pin_lookup Intra-logic block pin lookup to get t_pb_graph_pin from a pin ID.
121+
*/
111122
static void load_trace_to_pb_route(t_pb_routes& pb_route,
112123
const AtomNetId net_id,
113124
const int prev_pin_id,
@@ -585,7 +596,6 @@ void free_intra_lb_nets(std::vector<t_intra_lb_net>* intra_lb_nets) {
585596
* Internal Functions
586597
****************************************************************************/
587598

588-
/* Recurse through route tree trace to populate pb pin to atom net lookup array */
589599
static void load_trace_to_pb_route(t_pb_routes& pb_route,
590600
const AtomNetId net_id,
591601
const int prev_pin_id,
@@ -609,8 +619,8 @@ static void load_trace_to_pb_route(t_pb_routes& pb_route,
609619
VTR_ASSERT(pb_route[cur_pin_id].atom_net_id == net_id);
610620
}
611621
}
612-
for (int itrace = 0; itrace < (int)trace->next_nodes.size(); itrace++) {
613-
load_trace_to_pb_route(pb_route, net_id, cur_pin_id, &trace->next_nodes[itrace], logic_block_type, intra_lb_pb_pin_lookup);
622+
for (const auto& trace : trace->next_nodes) {
623+
load_trace_to_pb_route(pb_route, net_id, cur_pin_id, &trace, logic_block_type, intra_lb_pb_pin_lookup);
614624
}
615625
}
616626

0 commit comments

Comments
 (0)