@@ -393,13 +393,27 @@ class t_rr_graph_storage {
393
393
* This method should generally not be used, and instead first_edge and
394
394
* last_edge should be used.
395
395
*/
396
- RREdgeId edge_id (const RRNodeId& id, t_edge_size iedge) const {
396
+ RREdgeId edge_id (RRNodeId id, t_edge_size iedge) const {
397
397
RREdgeId first_edge = this ->first_edge (id);
398
398
RREdgeId ret (size_t (first_edge) + iedge);
399
399
VTR_ASSERT_SAFE (ret < last_edge (id));
400
400
return ret;
401
401
}
402
402
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
+
403
417
/* * @brief Get the source node for the specified edge. */
404
418
RRNodeId edge_src_node (const RREdgeId& edge) const {
405
419
VTR_ASSERT_DEBUG (edge.is_valid ());
@@ -448,7 +462,7 @@ class t_rr_graph_storage {
448
462
*
449
463
* The following methods implement an interface that appears to be
450
464
* 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.
452
466
*
453
467
* Proxy methods:
454
468
*
@@ -483,8 +497,8 @@ class t_rr_graph_storage {
483
497
***************************/
484
498
485
499
/* * @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
488
502
* if push_back(x) / emplace_back() were used if underlying storage
489
503
* was not pre-allocated.
490
504
*/
@@ -616,8 +630,8 @@ class t_rr_graph_storage {
616
630
void set_node_direction (RRNodeId, Direction new_direction);
617
631
618
632
/* * @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
621
635
*/
622
636
void add_node_side (RRNodeId, e_side new_side);
623
637
@@ -707,9 +721,8 @@ class t_rr_graph_storage {
707
721
*
708
722
* init_fan_in does not need to be invoked before this method.
709
723
*/
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);
713
726
714
727
/* * @brief Maps arch_switch_inf indicies to rr_switch_inf indicies.
715
728
*
@@ -731,6 +744,10 @@ class t_rr_graph_storage {
731
744
*/
732
745
void partition_edges (const vtr::vector<RRSwitchId, t_rr_switch_inf>& rr_switches);
733
746
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
+
734
751
/* * @brief Validate that edge data is partitioned correctly.*/
735
752
bool validate_node (RRNodeId node_id, const vtr::vector<RRSwitchId, t_rr_switch_inf>& rr_switches) const ;
736
753
bool validate (const vtr::vector<RRSwitchId, t_rr_switch_inf>& rr_switches) const ;
0 commit comments