@@ -393,13 +393,27 @@ class t_rr_graph_storage {
393393 * This method should generally not be used, and instead first_edge and
394394 * last_edge should be used.
395395 */
396- RREdgeId edge_id (const RRNodeId& id, t_edge_size iedge) const {
396+ RREdgeId edge_id (RRNodeId id, t_edge_size iedge) const {
397397 RREdgeId first_edge = this ->first_edge (id);
398398 RREdgeId ret (size_t (first_edge) + iedge);
399399 VTR_ASSERT_SAFE (ret < last_edge (id));
400400 return ret;
401401 }
402402
403+ /* *
404+ * @brief Retrieve the RREdgeId that connects the given source and sink nodes.
405+ * If the given source/sink nodes are not connected, RREdgeId::INVALID() is returned.
406+ */
407+ RREdgeId edge_id (RRNodeId src, RRNodeId sink) const {
408+ for (RREdgeId outgoing_edge_id : edge_range (src)) {
409+ if (edge_sink_node (outgoing_edge_id) == sink) {
410+ return outgoing_edge_id;
411+ }
412+ }
413+
414+ return RREdgeId::INVALID ();
415+ }
416+
403417 /* * @brief Get the source node for the specified edge. */
404418 RRNodeId edge_src_node (const RREdgeId& edge) const {
405419 VTR_ASSERT_DEBUG (edge.is_valid ());
@@ -448,7 +462,7 @@ class t_rr_graph_storage {
448462 *
449463 * The following methods implement an interface that appears to be
450464 * equivalent to the interface exposed by std::vector<t_rr_node>.
451- * This was done for backwards compability . See t_rr_node for more details.
465+ * This was done for backwards compatibility . See t_rr_node for more details.
452466 *
453467 * Proxy methods:
454468 *
@@ -483,8 +497,8 @@ class t_rr_graph_storage {
483497 ***************************/
484498
485499 /* * @brief
486- * Makes room in storage for RRNodeId in amoritized O(1) fashion.
487- * This results in an allocation pattern similiar to what would happen
500+ * Makes room in storage for RRNodeId in amortized O(1) fashion.
501+ * This results in an allocation pattern similar to what would happen
488502 * if push_back(x) / emplace_back() were used if underlying storage
489503 * was not pre-allocated.
490504 */
@@ -616,8 +630,8 @@ class t_rr_graph_storage {
616630 void set_node_direction (RRNodeId, Direction new_direction);
617631
618632 /* * @brief
619- * Add a side to the node abbributes
620- * This is the function to use when you just add a new side WITHOUT reseting side attributes
633+ * Add a side to the node attributes
634+ * This is the function to use when you just add a new side WITHOUT resetting side attributes
621635 */
622636 void add_node_side (RRNodeId, e_side new_side);
623637
@@ -707,9 +721,8 @@ class t_rr_graph_storage {
707721 *
708722 * init_fan_in does not need to be invoked before this method.
709723 */
710- size_t count_rr_switches (
711- const std::vector<t_arch_switch_inf>& arch_switch_inf,
712- t_arch_switch_fanin& arch_switch_fanins);
724+ size_t count_rr_switches (const std::vector<t_arch_switch_inf>& arch_switch_inf,
725+ t_arch_switch_fanin& arch_switch_fanins);
713726
714727 /* * @brief Maps arch_switch_inf indicies to rr_switch_inf indicies.
715728 *
@@ -731,6 +744,10 @@ class t_rr_graph_storage {
731744 */
732745 void partition_edges (const vtr::vector<RRSwitchId, t_rr_switch_inf>& rr_switches);
733746
747+ /* * @brief Overrides the associated switch for a given edge by
748+ * updating the edge to use the passed in switch. */
749+ void override_edge_switch (RREdgeId edge_id, RRSwitchId switch_id);
750+
734751 /* * @brief Validate that edge data is partitioned correctly.*/
735752 bool validate_node (RRNodeId node_id, const vtr::vector<RRSwitchId, t_rr_switch_inf>& rr_switches) const ;
736753 bool validate (const vtr::vector<RRSwitchId, t_rr_switch_inf>& rr_switches) const ;
0 commit comments