@@ -131,40 +131,60 @@ void draw_highlight_blocks_color(t_logical_block_type_ptr type,
131131/* If an rr_node has been clicked on, it will be highlighted in MAGENTA.
132132 * If so, and toggle nets is selected, highlight the whole net in that colour.
133133 */
134- void highlight_nets (char * message, RRNodeId hit_node, bool is_flat ) {
134+ void highlight_net (char * message, RRNodeId hit_node) {
135135 auto & cluster_ctx = g_vpr_ctx.clustering ();
136+ auto & atom_ctx = g_vpr_ctx.atom ();
136137 auto & route_ctx = g_vpr_ctx.routing ();
137138
138139 /* Don't crash if there's no routing */
139140 if (route_ctx.route_trees .empty ())
140141 return ;
141142
143+ if (route_ctx.is_flat ){
144+ for (auto net_id : atom_ctx.netlist ().nets ()){
145+ check_node_highlight_net (message, net_id, hit_node);
146+ }
147+
148+ } else {
149+ for (auto net_id : cluster_ctx.clb_nlist .nets ()) {
150+ check_node_highlight_net (message, net_id, hit_node);
151+ }
152+ }
153+
154+ application.update_message (message);
155+ }
156+
157+ void check_node_highlight_net (char * message, ParentNetId parent_id,
158+ RRNodeId hit_node) {
159+ auto & route_ctx = g_vpr_ctx.routing ();
142160 t_draw_state* draw_state = get_draw_state_vars ();
143161
144- for (auto net_id : cluster_ctx.clb_nlist .nets ()) {
145- ParentNetId parent_id = get_cluster_net_parent_id (g_vpr_ctx.atom ().lookup (), net_id, is_flat);
146- if (!route_ctx.route_trees [parent_id])
147- continue ;
162+ if (!route_ctx.route_trees [parent_id])
163+ return ;
148164
149- for (auto & rt_node : route_ctx.route_trees [parent_id].value ().all_nodes ()) {
150- RRNodeId inode = rt_node.inode ;
151- if (draw_state->draw_rr_node [inode].color == ezgl::MAGENTA) {
152- draw_state->net_color [net_id] = draw_state->draw_rr_node [inode].color ;
153- if (inode == hit_node) {
154- std::string orig_msg (message);
155- sprintf (message, " %s || Net: %zu (%s)" , orig_msg.c_str (),
156- size_t (net_id),
157- cluster_ctx.clb_nlist .net_name (net_id).c_str ());
165+ for (auto & rt_node : route_ctx.route_trees [parent_id].value ().all_nodes ()) {
166+ RRNodeId inode = rt_node.inode ;
167+ if (draw_state->draw_rr_node [inode].color == ezgl::MAGENTA) {
168+ draw_state->net_color [parent_id] = draw_state->draw_rr_node [inode].color ;
169+ if (inode == hit_node) {
170+ std::string orig_msg (message);
171+ std::string net_name;
172+ if (!route_ctx.is_flat ){
173+ net_name = g_vpr_ctx.clustering ().clb_nlist .net_name (convert_to_cluster_net_id (parent_id));
174+ } else {
175+ net_name = g_vpr_ctx.atom ().netlist ().net_name (convert_to_atom_net_id (parent_id));
158176 }
159- } else if (draw_state->draw_rr_node [inode].color
160- == ezgl::WHITE) {
161- // If node is de-selected.
162- draw_state->net_color [net_id] = ezgl::BLACK;
163- break ;
177+ sprintf (message, " %s || Net: %zu (%s)" , orig_msg.c_str (),
178+ size_t (parent_id),
179+ net_name.c_str ());
164180 }
181+ } else if (draw_state->draw_rr_node [inode].color
182+ == ezgl::WHITE) {
183+ // If node is de-selected.
184+ draw_state->net_color [parent_id] = ezgl::BLACK;
185+ break ;
165186 }
166187 }
167- application.update_message (message);
168188}
169189
170190/* If an rr_node has been clicked on, it will be either highlighted in MAGENTA,
0 commit comments