@@ -233,14 +233,11 @@ void draw_rr_chan(RRNodeId inode, const ezgl::color color, ezgl::renderer* g) {
233233 g->set_color (color, transparency_factor); // Ensure color is still set correctly if we drew any arrows/text
234234}
235235
236- /* Draws all the edges that the user wants shown between inode and what it
237- * connects to. inode is assumed to be a CHANX, CHANY, or IPIN. */
238236void draw_rr_edges (RRNodeId inode, ezgl::renderer* g) {
239237 t_draw_state* draw_state = get_draw_state_vars ();
240238 const DeviceContext& device_ctx = g_vpr_ctx.device ();
241239 const RRGraphView& rr_graph = device_ctx.rr_graph ;
242240
243- e_rr_type to_type;
244241 e_rr_type from_type = rr_graph.node_type (inode);
245242
246243 // Currently don't visualize source or sinks.
@@ -250,7 +247,7 @@ void draw_rr_edges(RRNodeId inode, ezgl::renderer* g) {
250247
251248 for (t_edge_size iedge = 0 , l = rr_graph.num_edges (inode); iedge < l; iedge++) {
252249 RRNodeId to_node = rr_graph.edge_sink_node (inode, iedge);
253- to_type = rr_graph.node_type (to_node);
250+ e_rr_type to_type = rr_graph.node_type (to_node);
254251 bool edge_configurable = rr_graph.edge_is_configurable (inode, iedge);
255252
256253 // Currently don't visualize source or sinks.
@@ -259,36 +256,14 @@ void draw_rr_edges(RRNodeId inode, ezgl::renderer* g) {
259256 }
260257
261258 ezgl::color color = DEFAULT_RR_NODE_COLOR;
262- e_edge_type edge_type;
263259 bool draw_edge = true ;
264260 bool inode_inter_cluster = is_inter_cluster_node (rr_graph, inode);
265261 bool to_node_inter_cluster = is_inter_cluster_node (rr_graph, to_node);
266262
267- // Color map for edges based on {from_type, to_type}
268- const std::map<std::pair<e_rr_type, e_rr_type>, e_edge_type> edge_type_map = {
269- // Pin to pin connections
270- {{e_rr_type::IPIN, e_rr_type::IPIN}, e_edge_type::PIN_TO_IPIN},
271- {{e_rr_type::OPIN, e_rr_type::IPIN}, e_edge_type::PIN_TO_IPIN},
272- {{e_rr_type::OPIN, e_rr_type::OPIN}, e_edge_type::PIN_TO_OPIN},
273- {{e_rr_type::IPIN, e_rr_type::OPIN}, e_edge_type::PIN_TO_OPIN},
274-
275- // Channel to pin connections
276- {{e_rr_type::OPIN, e_rr_type::CHANX}, e_edge_type::OPIN_TO_CHAN},
277- {{e_rr_type::OPIN, e_rr_type::CHANY}, e_edge_type::OPIN_TO_CHAN},
278- {{e_rr_type::CHANX, e_rr_type::IPIN}, e_edge_type::CHAN_TO_IPIN},
279- {{e_rr_type::CHANY, e_rr_type::IPIN}, e_edge_type::CHAN_TO_IPIN},
280-
281- // Channel to channel connections
282- {{e_rr_type::CHANX, e_rr_type::CHANX}, e_edge_type::CHAN_TO_CHAN},
283- {{e_rr_type::CHANX, e_rr_type::CHANY}, e_edge_type::CHAN_TO_CHAN},
284- {{e_rr_type::CHANY, e_rr_type::CHANY}, e_edge_type::CHAN_TO_CHAN},
285- {{e_rr_type::CHANY, e_rr_type::CHANX}, e_edge_type::CHAN_TO_CHAN},
286- };
287-
288- if (edge_type_map.find ({from_type, to_type}) == edge_type_map.end ()) {
263+ if (EDGE_TYPE_COLOR_MAP.find ({from_type, to_type}) == EDGE_TYPE_COLOR_MAP.end ()) {
289264 continue ; // Unsupported edge type
290265 }
291- edge_type = edge_type_map .at ({from_type, to_type});
266+ e_edge_type edge_type = EDGE_TYPE_COLOR_MAP .at ({from_type, to_type});
292267
293268 // Determine whether to draw the edge based on user options
294269
0 commit comments