Skip to content

Commit 571e50d

Browse files
committed
added arrows
1 parent 18c377f commit 571e50d

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

vpr/src/draw/draw_rr_edges.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,10 @@ void draw_intrapin_to_intrapin(RRNodeId inode, RRNodeId prev_node, ezgl::rendere
294294
ezgl::point2d p2 = draw_coords->get_absolute_pin_location(blk_id_pin_id2.first, blk_id_pin_id2.second);
295295

296296
g->draw_line(p1, p2);
297+
298+
float xend = p2.x + (p1.x - p2.x) / 10.;
299+
float yend = p2.y + (p1.y - p2.y) / 10.;
300+
draw_triangle_along_line(g, xend, yend, p1.x, p2.x, p1.y, p2.y);
297301
}
298302

299303
void draw_intrapin_to_pin(RRNodeId inode, RRNodeId prev_node, ezgl::renderer* g) {
@@ -305,9 +309,11 @@ void draw_intrapin_to_pin(RRNodeId inode, RRNodeId prev_node, ezgl::renderer* g)
305309
}
306310
const auto& rr_graph = g_vpr_ctx.device().rr_graph;
307311

312+
bool swapped = false;
308313
if (!is_inter_cluster_node(rr_graph, inode) && is_inter_cluster_node(rr_graph, prev_node)) {
309314
//Swap the nodes so that the inter-cluster node is always the current node
310315
std::swap(inode, prev_node);
316+
swapped = true;
311317
}
312318

313319
auto blk_id_pin_id = get_rr_node_cluster_blk_id_pb_graph_pin(prev_node);
@@ -320,7 +326,16 @@ void draw_intrapin_to_pin(RRNodeId inode, RRNodeId prev_node, ezgl::renderer* g)
320326
continue;
321327
}
322328
draw_get_rr_pin_coords(inode, &x1, &y1, pin_side);
323-
g->draw_line({x1, y1}, p2);
329+
ezgl::point2d p1 = {x1, y1};
330+
331+
if (swapped) {
332+
std::swap(p1, p2);
333+
}
334+
335+
g->draw_line(p1, p2);
336+
float xend = p2.x + (p1.x - p2.x) / 10.;
337+
float yend = p2.y + (p1.y - p2.y) / 10.;
338+
draw_triangle_along_line(g, xend, yend, p1.x, p2.x, p1.y, p2.y);
324339
}
325340

326341
}

0 commit comments

Comments
 (0)