@@ -26,7 +26,7 @@ static void dijkstra_flood_to_ipins(RRNodeId node, util::t_chan_ipins_delays& ch
2626 * @param itile
2727 * @return Return the maximum ptc number of the SOURCE/OPINs of a tile type
2828 */
29- static int get_tile_src_opin_max_ptc_from_rr_graph (int itile);
29+ static int get_tile_src_opin_max_ptc (int itile);
3030
3131static t_physical_tile_loc pick_sample_tile (int layer_num, t_physical_tile_type_ptr tile_type, t_physical_tile_loc prev);
3232
@@ -338,7 +338,7 @@ t_src_opin_delays compute_router_src_opin_lookahead(bool is_flat) {
338338
339339 // Get the maximum OPIN ptc for each tile type to reserve src_opin_delays
340340 for (int itile = 0 ; itile < (int )device_ctx.physical_tile_types .size (); itile++) {
341- tile_max_ptc[itile] = get_tile_src_opin_max_ptc_from_rr_graph (itile);
341+ tile_max_ptc[itile] = get_tile_src_opin_max_ptc (itile);
342342 }
343343
344344 // Resize src_opin_delays to accomodate enough ptc and layer
@@ -1114,55 +1114,19 @@ static void dijkstra_flood_to_ipins(RRNodeId node, util::t_chan_ipins_delays& ch
11141114 }
11151115}
11161116
1117- static int get_tile_src_opin_max_ptc_from_rr_graph (int itile) {
1117+ static int get_tile_src_opin_max_ptc (int itile) {
11181118 const auto & device_ctx = g_vpr_ctx.device ();
11191119 const auto & physical_tile = device_ctx.physical_tile_types [itile];
1120- const auto & rr_graph = device_ctx.rr_graph ;
1121- const int num_layers = device_ctx.grid .get_num_layers ();
1122- int max_ptc = OPEN;
1120+ int max_ptc = 0 ;
11231121
1124- // Find a layer that has instances of the tile type
1125- int tile_layer_num = OPEN;
1126- for (int layer_num = 0 ; layer_num < num_layers; layer_num++) {
1127- if (device_ctx.grid .num_instances (&physical_tile, layer_num) > 0 ) {
1128- tile_layer_num = layer_num;
1129- break ;
1122+ // Output pin
1123+ for (const auto & class_inf: physical_tile.class_inf ) {
1124+ if (class_inf.type != e_pin_type::DRIVER) {
1125+ continue ;
11301126 }
1131- }
1132-
1133- if (tile_layer_num == OPEN) {
1134- VTR_LOG_WARN (" Found no sample locations for %s\n " ,
1135- physical_tile.name );
1136- max_ptc = OPEN;
1137- } else {
1138- for (e_rr_type rr_type : {SOURCE, OPIN}) {
1139- t_physical_tile_loc sample_loc (OPEN, OPEN, OPEN);
1140- sample_loc = pick_sample_tile (tile_layer_num, &physical_tile, sample_loc);
1141-
1142- if (sample_loc.x == OPEN && sample_loc.y == OPEN && sample_loc.layer_num == OPEN) {
1143- // No untried instances of the current tile type left
1144- VTR_LOG_WARN (" Found no sample locations for %s in %s\n " ,
1145- rr_node_typename[rr_type],
1146- physical_tile.name );
1147- return OPEN;
1148- }
1149-
1150- const std::vector<RRNodeId>& rr_nodes_at_loc = device_ctx.rr_graph .node_lookup ().find_grid_nodes_at_all_sides (sample_loc.layer_num ,
1151- sample_loc.x ,
1152- sample_loc.y ,
1153- rr_type);
1154- for (RRNodeId node_id : rr_nodes_at_loc) {
1155- int ptc = rr_graph.node_ptc_num (node_id);
1156- // For the time being, we decide to not let the lookahead explore the node inside the clusters
1157- if (!is_inter_cluster_node (&physical_tile,
1158- rr_type,
1159- ptc)) {
1160- continue ;
1161- }
1162-
1163- if (ptc >= max_ptc) {
1164- max_ptc = ptc;
1165- }
1127+ for (const auto & pin_ptc : class_inf.pinlist ) {
1128+ if (pin_ptc > max_ptc) {
1129+ max_ptc = pin_ptc;
11661130 }
11671131 }
11681132 }
0 commit comments