@@ -485,7 +485,7 @@ class t_rr_graph_storage {
485485 return edge_source_node (edge_id (id, iedge));
486486 }
487487
488- std::string edge_sw_template_id (RREdgeId edge) const {
488+ const std::optional<std:: string>& edge_sw_template_id (RREdgeId edge) const {
489489 return edge_sw_template_id_[edge];
490490 }
491491
@@ -833,7 +833,11 @@ class t_rr_graph_storage {
833833 * of the node. Also, the information about switches is fly-weighted and are accessible with IDs. Thus,
834834 * the number of rr switch types can be higher than the number of arch switch types.
835835 */
836- void emplace_back_edge (RRNodeId src, RRNodeId dest, short edge_switch, bool remapped, std::string sw_template_id);
836+ void emplace_back_edge (RRNodeId src,
837+ RRNodeId dest,
838+ short edge_switch,
839+ bool remapped,
840+ std::optional<std::string> sw_template_id);
837841
838842 /* * @brief Adds a batch of edges.*/
839843 void alloc_and_load_edges (const t_rr_edge_info_set* rr_edges_to_create);
@@ -933,7 +937,7 @@ class t_rr_graph_storage {
933937 array_rearrange (edge_src_node_, RRNodeId::INVALID ());
934938 array_rearrange (edge_dest_node_, RRNodeId::INVALID ());
935939 array_rearrange (edge_switch_, LIBRRGRAPH_UNDEFINED_VAL);
936- array_rearrange (edge_sw_template_id_, " " );
940+ array_rearrange (edge_sw_template_id_, std:: nullopt );
937941 array_rearrange (edge_remapped_, false );
938942 }
939943
@@ -1112,7 +1116,7 @@ class t_rr_graph_storage {
11121116 * This information can be used for various analyses, such as identifying
11131117 * which edges within each pattern are used most or least frequently.
11141118 */
1115- vtr::vector<RREdgeId, std::string> edge_sw_template_id_;
1119+ vtr::vector<RREdgeId, std::optional<std:: string> > edge_sw_template_id_;
11161120
11171121 /* * @brief
11181122 * The following data structures are only used for tileable routing resource graph.
@@ -1178,7 +1182,7 @@ class t_rr_graph_view {
11781182 const vtr::array_view_id<RREdgeId, const RRNodeId> edge_src_node,
11791183 const vtr::array_view_id<RREdgeId, const RRNodeId> edge_dest_node,
11801184 const vtr::array_view_id<RREdgeId, const short > edge_switch,
1181- const vtr::array_view_id<RREdgeId, const std::string> edge_sw_template_id,
1185+ const vtr::array_view_id<RREdgeId, const std::optional<std:: string> > edge_sw_template_id,
11821186 const std::unordered_map<std::string, RRNodeId>& virtual_clock_network_root_idx,
11831187 const vtr::array_view_id<RRNodeId, const int16_t > node_bend_start,
11841188 const vtr::array_view_id<RRNodeId, const int16_t > node_bend_end)
@@ -1380,7 +1384,7 @@ class t_rr_graph_view {
13801384 return edge_switch_[edge];
13811385 }
13821386
1383- std::string edge_sw_template_id (RREdgeId edge) const {
1387+ std::optional<std:: string> edge_sw_template_id (RREdgeId edge) const {
13841388 return edge_sw_template_id_[edge];
13851389 }
13861390
@@ -1402,7 +1406,7 @@ class t_rr_graph_view {
14021406 vtr::array_view_id<RREdgeId, const RRNodeId> edge_src_node_;
14031407 vtr::array_view_id<RREdgeId, const RRNodeId> edge_dest_node_;
14041408 vtr::array_view_id<RREdgeId, const short > edge_switch_;
1405- vtr::array_view_id<RREdgeId, const std::string> edge_sw_template_id_;
1409+ vtr::array_view_id<RREdgeId, const std::optional<std:: string> > edge_sw_template_id_;
14061410 const std::unordered_map<std::string, RRNodeId>& virtual_clock_network_root_idx_;
14071411
14081412 vtr::array_view_id<RRNodeId, const int16_t > node_bend_start_;
0 commit comments