Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions vpr/src/draw/draw_mux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
21 changes: 15 additions & 6 deletions vpr/src/draw/draw_rr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<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};

// 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<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};

// 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) {
Expand Down