@@ -51,23 +51,32 @@ void draw_rr(ezgl::renderer* g) {
5151
5252 g->set_line_dash (ezgl::line_dash::none);
5353
54+ // Node colors by types
55+ // colors for Source, Sink, IPIN, OPIN, CHANX, CHANY, MUX, CHANZ
56+ constexpr vtr::array<e_rr_type, ezgl::color, (size_t )e_rr_type::NUM_RR_TYPES> node_colors{DEFAULT_RR_NODE_COLOR,
57+ DEFAULT_RR_NODE_COLOR,
58+ ezgl::PURPLE,
59+ ezgl::PINK,
60+ DEFAULT_RR_NODE_COLOR,
61+ DEFAULT_RR_NODE_COLOR,
62+ DEFAULT_RR_NODE_COLOR,
63+ DEFAULT_RR_NODE_COLOR};
64+
65+ // Draw edges first, then nodes, so that nodes (and their muxes) are rendered on top of edges.
5466 for (const RRNodeId inode : device_ctx.rr_graph .nodes ()) {
67+ draw_rr_edges (inode, g);
68+ }
5569
70+ for (const RRNodeId inode : device_ctx.rr_graph .nodes ()) {
5671 e_rr_type node_type = rr_graph.node_type (inode);
5772 bool inter_cluster_node = is_inter_cluster_node (rr_graph, inode);
5873 bool node_highlighted = draw_state->draw_rr_node [inode].node_highlighted ;
5974
60- // Node colors by types
61- // colors for Source, Sink, IPIN, OPIN, CHANX, CHANY, MUX, CHANZ
62- constexpr vtr::array<e_rr_type, ezgl::color, (size_t )e_rr_type::NUM_RR_TYPES> node_colors{DEFAULT_RR_NODE_COLOR, DEFAULT_RR_NODE_COLOR, ezgl::PURPLE, ezgl::PINK, DEFAULT_RR_NODE_COLOR, DEFAULT_RR_NODE_COLOR, DEFAULT_RR_NODE_COLOR, DEFAULT_RR_NODE_COLOR};
63-
6475 // Apply color to the node if it is not highlighted
6576 if (!node_highlighted) {
6677 draw_state->draw_rr_node [inode].color = node_colors.at (node_type);
6778 }
6879
69- draw_rr_edges (inode, g);
70-
7180 if (!node_highlighted) {
7281 // Draw channel nodes if enabled
7382 if ((node_type == e_rr_type::CHANX || node_type == e_rr_type::CHANY) && !draw_state->draw_channel_nodes ) {
0 commit comments