diff --git a/vpr/src/draw/draw_mux.cpp b/vpr/src/draw/draw_mux.cpp index 0cccd8e14e..94e7ebdb78 100644 --- a/vpr/src/draw/draw_mux.cpp +++ b/vpr/src/draw/draw_mux.cpp @@ -79,11 +79,10 @@ ezgl::rectangle draw_mux(ezgl::point2d origin, e_side orientation, float height, */ void draw_mux_with_size(ezgl::point2d origin, e_side orientation, float height, int size, int transparency_factor, ezgl::renderer* g) { g->set_color(ezgl::YELLOW, transparency_factor); - auto bounds = draw_mux(origin, orientation, height, g); + ezgl::rectangle bounds = draw_mux(origin, orientation, height, g); g->set_color(ezgl::BLACK, transparency_factor); - g->draw_text(bounds.center(), std::to_string(size), bounds.width(), - bounds.height()); + g->draw_text(bounds.center(), std::to_string(size), bounds.width(), bounds.height()); } #endif diff --git a/vpr/src/draw/draw_rr.cpp b/vpr/src/draw/draw_rr.cpp index 5e87dee7b6..3fb036b103 100644 --- a/vpr/src/draw/draw_rr.cpp +++ b/vpr/src/draw/draw_rr.cpp @@ -51,23 +51,32 @@ void draw_rr(ezgl::renderer* g) { g->set_line_dash(ezgl::line_dash::none); + // Node colors by types + // colors for Source, Sink, IPIN, OPIN, CHANX, CHANY, MUX, CHANZ + constexpr vtr::array 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}; + + // Draw edges first, then nodes, so that nodes (and their muxes) are rendered on top of edges. for (const RRNodeId inode : device_ctx.rr_graph.nodes()) { + draw_rr_edges(inode, g); + } + for (const RRNodeId inode : device_ctx.rr_graph.nodes()) { e_rr_type node_type = rr_graph.node_type(inode); bool inter_cluster_node = is_inter_cluster_node(rr_graph, inode); bool node_highlighted = draw_state->draw_rr_node[inode].node_highlighted; - // Node colors by types - // colors for Source, Sink, IPIN, OPIN, CHANX, CHANY, MUX, CHANZ - constexpr vtr::array 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}; - // Apply color to the node if it is not highlighted if (!node_highlighted) { draw_state->draw_rr_node[inode].color = node_colors.at(node_type); } - draw_rr_edges(inode, g); - if (!node_highlighted) { // Draw channel nodes if enabled if ((node_type == e_rr_type::CHANX || node_type == e_rr_type::CHANY) && !draw_state->draw_channel_nodes) {