Skip to content

Commit a9c0364

Browse files
committed
format
1 parent 5e32302 commit a9c0364

File tree

3 files changed

+22
-26
lines changed

3 files changed

+22
-26
lines changed

vpr/src/draw/draw_basic.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,11 +624,9 @@ void draw_partial_route(const std::vector<RRNodeId>& rr_nodes_to_draw, ezgl::ren
624624
RRNodeId prev_node = rr_nodes_to_draw[i - 1];
625625

626626
draw_rr_edge(inode, prev_node, draw_state->draw_rr_node[inode].color, g);
627-
628627
}
629628
}
630629

631-
632630
/* Helper function that checks whether the edges between the current and previous nodes can be drawn
633631
* based on whether the cross-layer connections option is enabled and whether the layer on which the
634632
* nodes are located are enabled.

vpr/src/draw/draw_rr.cpp

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ void draw_rr(ezgl::renderer* g) {
8181

8282
draw_rr_edges(inode, g);
8383
draw_rr_node(inode, draw_state->draw_rr_node[inode].color, g);
84-
8584
}
8685

8786
drawroute(HIGHLIGHTED, g);
@@ -241,7 +240,7 @@ void draw_rr_edges(RRNodeId inode, ezgl::renderer* g) {
241240
e_rr_type from_type, to_type;
242241

243242
from_type = rr_graph.node_type(inode);
244-
if(from_type == e_rr_type::SOURCE || from_type == e_rr_type::SINK || !is_inter_cluster_node(rr_graph, inode)) {
243+
if (from_type == e_rr_type::SOURCE || from_type == e_rr_type::SINK || !is_inter_cluster_node(rr_graph, inode)) {
245244
return;
246245
}
247246

@@ -256,35 +255,35 @@ void draw_rr_edges(RRNodeId inode, ezgl::renderer* g) {
256255
to_type = rr_graph.node_type(to_node);
257256
bool edge_configurable = rr_graph.edge_is_configurable(inode, iedge);
258257

259-
if(to_type == e_rr_type::SOURCE || to_type == e_rr_type::SINK || !is_inter_cluster_node(rr_graph, to_node)) {
258+
if (to_type == e_rr_type::SOURCE || to_type == e_rr_type::SINK || !is_inter_cluster_node(rr_graph, to_node)) {
260259
continue;
261260
}
262261

263262
ezgl::color color = DEFAULT_RR_NODE_COLOR;
264263
// Determine the color based on the type of the edge
265264
switch (from_type) {
266265
case e_rr_type::OPIN:
267-
if(to_type == e_rr_type::CHANX || to_type == e_rr_type::CHANY) {
266+
if (to_type == e_rr_type::CHANX || to_type == e_rr_type::CHANY) {
268267
color = ezgl::PINK;
269-
} else if (to_type == e_rr_type::IPIN){
268+
} else if (to_type == e_rr_type::IPIN) {
270269
color = ezgl::MEDIUM_PURPLE;
271270
} else {
272271
vpr_throw(VPR_ERROR_OTHER, __FILE__, __LINE__,
273-
"in draw_rr_edges: node %d (type: %d) connects to node %d (type: %d).\n",
274-
inode, from_type, to_node, to_type);
272+
"in draw_rr_edges: node %d (type: %d) connects to node %d (type: %d).\n",
273+
inode, from_type, to_node, to_type);
275274
}
276-
break;
275+
break;
277276
case e_rr_type::CHANX:
278277
case e_rr_type::CHANY:
279-
if(to_type == e_rr_type::IPIN) {
278+
if (to_type == e_rr_type::IPIN) {
280279
color = blk_LIGHTSKYBLUE;
281280
if (draw_state->draw_rr_node[to_node].node_highlighted && draw_state->draw_rr_node[inode].color == DEFAULT_RR_NODE_COLOR) {
282-
// If the IPIN is clicked on, draw connection to all the CHANX
283-
// wire segments fanning into the pin. If a CHANX wire is clicked
284-
// on, draw only the connection between that wire and the IPIN, with
285-
// the pin fanning out from the wire.
286-
color = ezgl::MAGENTA;
287-
}
281+
// If the IPIN is clicked on, draw connection to all the CHANX
282+
// wire segments fanning into the pin. If a CHANX wire is clicked
283+
// on, draw only the connection between that wire and the IPIN, with
284+
// the pin fanning out from the wire.
285+
color = ezgl::MAGENTA;
286+
}
288287
} else if (to_type == e_rr_type::CHANX || to_type == e_rr_type::CHANY) {
289288
if (edge_configurable) {
290289
color = blk_DARKGREEN;
@@ -293,24 +292,24 @@ void draw_rr_edges(RRNodeId inode, ezgl::renderer* g) {
293292
}
294293
} else {
295294
vpr_throw(VPR_ERROR_OTHER, __FILE__, __LINE__,
296-
"in draw_rr_edges: node %d (type: %d) connects to node %d (type: %d).\n",
297-
inode, from_type, to_node, to_type);
295+
"in draw_rr_edges: node %d (type: %d) connects to node %d (type: %d).\n",
296+
inode, from_type, to_node, to_type);
298297
}
299-
break;
298+
break;
300299
default:
301-
break;
300+
break;
302301
}
303302

304303
if (rgb_is_same(draw_state->draw_rr_node[inode].color, ezgl::MAGENTA) || rgb_is_same(draw_state->draw_rr_node[to_node].color, ezgl::MAGENTA)) {
305304
color = draw_state->draw_rr_node[to_node].color;
306305
}
307306

308-
draw_rr_edge(to_node, inode, color, g);
309-
307+
draw_rr_edge(to_node, inode, color, g);
308+
310309
} /* End of for each edge loop */
311310
}
312311

313-
void draw_rr_node(RRNodeId inode, const ezgl::color color, ezgl::renderer* g){
312+
void draw_rr_node(RRNodeId inode, const ezgl::color color, ezgl::renderer* g) {
314313
t_draw_state* draw_state = get_draw_state_vars();
315314
auto& device_ctx = g_vpr_ctx.device();
316315
const auto& rr_graph = device_ctx.rr_graph;

vpr/src/draw/draw_rr_edges.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ void draw_pin_to_chan_edge(RRNodeId pin_node, RRNodeId chan_node, ezgl::renderer
620620
}
621621
}
622622

623-
void draw_rr_edge(RRNodeId inode, RRNodeId prev_node, ezgl::color color, ezgl::renderer* g){
623+
void draw_rr_edge(RRNodeId inode, RRNodeId prev_node, ezgl::color color, ezgl::renderer* g) {
624624
auto& device_ctx = g_vpr_ctx.device();
625625
auto& rr_graph = device_ctx.rr_graph;
626626
t_draw_state* draw_state = get_draw_state_vars();
@@ -665,7 +665,6 @@ void draw_rr_edge(RRNodeId inode, RRNodeId prev_node, ezgl::color color, ezgl::r
665665
draw_inter_cluster_rr_edge(inode, prev_node, rr_type, prev_type, g);
666666
}
667667

668-
669668
void draw_inter_cluster_rr_edge(RRNodeId inode, RRNodeId prev_node, e_rr_type rr_type, e_rr_type prev_type, ezgl::renderer* g) {
670669
const RRGraphView& rr_graph = g_vpr_ctx.device().rr_graph;
671670
t_edge_size iedge = find_edge(prev_node, inode);

0 commit comments

Comments
 (0)