Skip to content

Commit 79fcd5f

Browse files
author
Nathan Shreve
committed
Fixed bug and eliminated SINK error checking
1 parent 6988bf5 commit 79fcd5f

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

libs/librrgraph/src/base/check_rr_graph.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -394,10 +394,10 @@ void check_rr_node(const RRGraphView& rr_graph,
394394
VPR_FATAL_ERROR(VPR_ERROR_ROUTE,
395395
"in check_rr_node: node %d (type %d) is at an illegal clb location (%d, %d).\n", inode, rr_type, xlow, ylow);
396396
}
397-
if (xlow != (xhigh - type->width + 1) || ylow != (yhigh - type->height + 1)) {
398-
VPR_FATAL_ERROR(VPR_ERROR_ROUTE,
399-
"in check_rr_node: node %d (type %d) has endpoints (%d,%d) and (%d,%d)\n", inode, rr_type, xlow, ylow, xhigh, yhigh);
400-
}
397+
// if (xlow != (xhigh - type->width + 1) || ylow != (yhigh - type->height + 1)) {
398+
// VPR_FATAL_ERROR(VPR_ERROR_ROUTE,
399+
// "in check_rr_node: node %d (type %d) has endpoints (%d,%d) and (%d,%d)\n", inode, rr_type, xlow, ylow, xhigh, yhigh);
400+
// }
401401
break;
402402
case IPIN:
403403
case OPIN:

libs/librrgraph/src/base/rr_graph_utils.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ static void walk_cluster_recursive(const RRGraphView& rr_graph,
1717
std::unordered_map<RRNodeId, std::unordered_set<RRNodeId>>& sink_ipins,
1818
RRNodeId curr,
1919
RRNodeId origin) {
20-
// Check that curr is SINK in the same cluster as origin
20+
// Make sure SINK in the same cluster as origin. This might not be the case when we have direct-connect between blocks
2121
int curr_x = rr_graph.node_xlow(curr);
2222
int curr_y = rr_graph.node_ylow(curr);
23-
VTR_ASSERT_SAFE(!((curr_x < rr_graph.node_xlow(origin)) || (curr_x > rr_graph.node_xhigh(origin)) || (curr_y < rr_graph.node_ylow(origin)) || (curr_y > rr_graph.node_yhigh(origin))));
23+
if ((curr_x < rr_graph.node_xlow(origin)) || (curr_x > rr_graph.node_xhigh(origin)) || (curr_y < rr_graph.node_ylow(origin)) || (curr_y > rr_graph.node_yhigh(origin)))
24+
return;
25+
2426
VTR_ASSERT_SAFE(rr_graph.node_type(origin) == e_rr_type::SINK);
2527

2628
// We want to go "backward" to the cluster IPINs connected to the origin node
@@ -174,16 +176,16 @@ void set_sink_locs(const RRGraphView& rr_graph, RRGraphBuilder& rr_graph_builder
174176
walk_cluster_recursive(rr_graph, node_fanins, sink_ipins, node_id, node_id);
175177
}
176178

177-
// Set SINK locations based on "cluster-edge" OPINs and IPINs
179+
// Set SINK locations based on "cluster-edge" IPINs
178180
for (const auto& node_pins : sink_ipins) {
179181
const auto& pin_set = node_pins.second;
180182

181183
if (pin_set.empty())
182184
continue;
183185

184186
// Use float so that we can take average later
185-
std::vector<float> x_coords(pin_set.size());
186-
std::vector<float> y_coords(pin_set.size());
187+
std::vector<float> x_coords;
188+
std::vector<float> y_coords;
187189

188190
// Add coordinates of each "cluster-edge" pin to vectors
189191
for (const auto& pin : pin_set) {

vpr/src/route/rr_graph.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1437,7 +1437,7 @@ static void build_rr_graph(const t_graph_type graph_type,
14371437
delete[] clb_to_clb_directs;
14381438
}
14391439

1440-
// Get better locations for SOURCE and SINK nodes
1440+
// Get better locations for SINK nodes
14411441
set_sink_locs(rr_graph, device_ctx.rr_graph_builder);
14421442

14431443
// We are done with building the RR Graph. Thus, we can clear the storages only used

0 commit comments

Comments
 (0)