Skip to content

Commit 7da51f7

Browse files
authored
Merge pull request #2146 from verilog-to-routing/fix_rr_graph_direct_link
Fix rr_graph direct link
2 parents 5794fab + dfbb236 commit 7da51f7

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

vpr/src/route/rr_graph.cpp

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2962,12 +2962,24 @@ static int get_opin_direct_connections(RRGraphBuilder& rr_graph_builder,
29622962
}
29632963
}
29642964

2965-
int target_sub_tile = z + directs[i].sub_tile_offset;
2966-
if (relative_ipin >= target_type->sub_tiles[target_sub_tile].num_phy_pins) continue;
2965+
//directs[i].sub_tile_offset is added to from_capacity(z) to get the
2966+
// target_capacity
2967+
int target_cap = z + directs[i].sub_tile_offset;
2968+
2969+
// Iterate over all sub_tiles to get the sub_tile which the target_cap belongs to.
2970+
const t_sub_tile* target_sub_tile = nullptr;
2971+
for (const auto& sub_tile : target_type->sub_tiles) {
2972+
if (sub_tile.capacity.is_in_range(target_cap)) {
2973+
target_sub_tile = &sub_tile;
2974+
break;
2975+
}
2976+
}
2977+
VTR_ASSERT(target_sub_tile != nullptr);
2978+
if (relative_ipin >= target_sub_tile->num_phy_pins) continue;
29672979

29682980
//If this block has capacity > 1 then the pins of z position > 0 are offset
29692981
//by the number of pins per capacity instance
2970-
int ipin = get_physical_pin_from_capacity_location(target_type, relative_ipin, target_sub_tile);
2982+
int ipin = get_physical_pin_from_capacity_location(target_type, relative_ipin, target_cap);
29712983

29722984
/* Add new ipin edge to list of edges */
29732985
std::vector<RRNodeId> inodes;

0 commit comments

Comments
 (0)