Skip to content

Commit 78b4555

Browse files
authored
Now direct connection builder checks the port name of destination subtile (#3320)
* [test] add new test case to validate direct connection from two identify source subtile to single destination subtile * [core] now to_port name is also checked in building direction connection * [core] typo * [test] debug * [test] update golden * [core] code comments format
1 parent c22df01 commit 78b4555

File tree

8 files changed

+1084
-2
lines changed

8 files changed

+1084
-2
lines changed

vpr/src/route/rr_graph_generation/clb2clb_directs.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ std::vector<t_clb_to_clb_directs> alloc_and_load_clb_to_clb_directs(const std::v
6262
clb_to_clb_directs[i].to_clb_type = physical_tile;
6363

6464
tile_port = find_tile_port_by_name(physical_tile, port_name);
65+
// Cache the destination port name as the pin index is not enough to identify if the destination subtile is the one we want
66+
clb_to_clb_directs[i].to_port = port_name;
6567

6668
if (start_pin_index == UNDEFINED) {
6769
VTR_ASSERT(start_pin_index == end_pin_index);

vpr/src/route/rr_graph_generation/clb2clb_directs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ struct t_clb_to_clb_directs {
1717
int from_clb_pin_start_index;
1818
int from_clb_pin_end_index;
1919
t_physical_tile_type_ptr to_clb_type;
20+
std::string to_port;
2021
int to_clb_pin_start_index;
2122
int to_clb_pin_end_index;
2223
int switch_index; //The switch type used by this direct connection

vpr/src/route/rr_graph_generation/tileable_rr_graph/tileable_rr_graph_gsb.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,7 +1763,7 @@ void build_direct_connections_for_one_gsb(const RRGraphView& rr_graph,
17631763
int to_subtile_cap = z + directs[i].sub_tile_offset;
17641764
/* If the destination subtile is out of range, there is no qualified IPINs */
17651765
if (to_subtile_cap < 0 || to_subtile_cap >= to_grid_type->capacity) {
1766-
continue;
1766+
continue;
17671767
}
17681768
/* Iterate over all sub_tiles to get the sub_tile which the target_cap belongs to. */
17691769
const t_sub_tile* to_sub_tile = nullptr;
@@ -1774,6 +1774,15 @@ void build_direct_connections_for_one_gsb(const RRGraphView& rr_graph,
17741774
}
17751775
}
17761776
VTR_ASSERT(to_sub_tile != nullptr);
1777+
// Check if the to port is the one from the subtile, if not, pass as this is not the destination
1778+
bool port_match = false;
1779+
for (auto to_sub_tile_port : to_sub_tile->ports) {
1780+
if (std::string(to_sub_tile_port.name) == clb_to_clb_directs[i].to_port) {
1781+
port_match = true;
1782+
break;
1783+
}
1784+
}
1785+
if (!port_match) continue;
17771786
if (relative_ipin >= to_sub_tile->num_phy_pins) continue;
17781787
// If this block has capacity > 1 then the pins of z position > 0 are offset
17791788
// by the number of pins per capacity instance
@@ -1792,7 +1801,7 @@ void build_direct_connections_for_one_gsb(const RRGraphView& rr_graph,
17921801
to_grid_coordinate.y() + to_grid_type->pin_height_offset[ipin],
17931802
e_rr_type::IPIN, ipin, ipin_grid_side[0]);
17941803

1795-
/* add edges to the opin_node */
1804+
// add edges to the opin_node */
17961805
if (!opin_node_id) {
17971806
VTR_ASSERT(opin_node_id);
17981807
}

0 commit comments

Comments
 (0)