Skip to content

Commit e83e47c

Browse files
Fix edge cutting
1 parent bf156bf commit e83e47c

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

vpr/src/route/rr_graph_generation/interposer_cut.cpp

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,7 @@
1414

1515
#include "interposer_cut.h"
1616

17-
static bool should_cut_edge(int src_start_loc, int sink_start_loc, int cut_loc) {
18-
int src_delta = src_start_loc - cut_loc;
19-
int sink_delta = sink_start_loc - cut_loc;
20-
21-
// Same sign means that both sink and source are on the same side of this cut
22-
if ((src_delta < 0 && sink_delta < 0) || (src_delta >= 0 && sink_delta >= 0)) {
23-
return false;
24-
} else {
25-
return true;
26-
}
27-
}
28-
29-
static bool should_cut_node(int src_start_loc, int sink_start_loc, int cut_loc) {
17+
static bool should_cut(int src_start_loc, int sink_start_loc, int cut_loc) {
3018
int src_delta = src_start_loc - cut_loc;
3119
int sink_delta = sink_start_loc - cut_loc;
3220

@@ -127,7 +115,7 @@ std::vector<RREdgeId> mark_interposer_cut_edges_for_removal(const RRGraphView& r
127115
int src_start_loc_y = node_ystart(rr_graph, src_node);
128116
int sink_start_loc_y = node_ystart(rr_graph, sink_node);
129117

130-
if (should_cut_edge(src_start_loc_y, sink_start_loc_y, cut_loc_y)) {
118+
if (should_cut(src_start_loc_y, sink_start_loc_y, cut_loc_y)) {
131119
edges_to_be_removed.push_back(edge_id);
132120
}
133121
}
@@ -136,7 +124,7 @@ std::vector<RREdgeId> mark_interposer_cut_edges_for_removal(const RRGraphView& r
136124
int src_start_loc_x = node_xstart(rr_graph, src_node);
137125
int sink_start_loc_x = node_xstart(rr_graph, sink_node);
138126

139-
if (should_cut_edge(src_start_loc_x, sink_start_loc_x, cut_loc_x)) {
127+
if (should_cut(src_start_loc_x, sink_start_loc_x, cut_loc_x)) {
140128
edges_to_be_removed.push_back(edge_id);
141129
}
142130
}
@@ -177,7 +165,7 @@ void update_interposer_crossing_nodes_in_spatial_lookup_and_rr_graph_storage(con
177165
continue;
178166
}
179167

180-
if (!should_cut_node(y_low, y_high, cut_loc_y)) {
168+
if (!should_cut(y_low, y_high, cut_loc_y)) {
181169
continue;
182170
}
183171

0 commit comments

Comments
 (0)