@@ -264,6 +264,18 @@ static void connect_tile_src_sink_to_pins(RRGraphBuilder& rr_graph_builder,
264
264
const int delayless_switch,
265
265
t_physical_tile_type_ptr physical_type_ptr);
266
266
267
+ /* *
268
+ * Add the edges between IPIN to SINK and SOURCE to OPIN to rr_edges_to_create
269
+ * @param rr_graph_builder RR Graph Bulder object which contain the RR Graph storage
270
+ * @param class_num_vec Class physical numbers to add the edges connected to them
271
+ * @param layer The layer number of the block to add the SINK/SRC connections of it.
272
+ * @param i The x location of the block to add the SINK/SRC connections of it.
273
+ * @param j The y location of the block to add the SINK/SRC connections of it
274
+ * @param rr_edges_to_create An object which store all of the edges created in this function.
275
+ * @param delayless_switch Switch ID of the delayless switch.
276
+ * @param physical_type_ptr A pointer to the physical type of the block for which the edges are created.
277
+ * @param switches_remapped A flag to indicate whether edge switch IDs are remapped
278
+ */
267
279
static void connect_src_sink_to_pins (RRGraphBuilder& rr_graph_builder,
268
280
const std::vector<int >& class_num_vec,
269
281
const int layer,
@@ -659,6 +671,9 @@ static void build_intra_cluster_rr_graph(const t_graph_type graph_type,
659
671
bool is_flat,
660
672
bool load_rr_graph);
661
673
674
+ static short get_delayless_switch_id (t_det_routing_arch* det_routing_arch,
675
+ bool load_rr_graph);
676
+
662
677
/* ****************** Subroutine definitions *******************************/
663
678
664
679
void create_rr_graph (const t_graph_type graph_type,
@@ -744,19 +759,7 @@ void create_rr_graph(const t_graph_type graph_type,
744
759
}
745
760
746
761
if (is_flat) {
747
- short delayless_switch = OPEN;
748
- if (load_rr_graph) {
749
- const auto & rr_switches = device_ctx.rr_graph .rr_switch ();
750
- for (int switch_id = 0 ; switch_id < static_cast <int >(rr_switches.size ()); switch_id++){
751
- const auto & rr_switch = rr_switches[RRSwitchId (switch_id)];
752
- if (rr_switch.name .find (" delayless" ) != std::string::npos) {
753
- delayless_switch = static_cast <short >(switch_id);
754
- break ;
755
- }
756
- }
757
- } else {
758
- delayless_switch = det_routing_arch->delayless_switch ;
759
- }
762
+ short delayless_switch = get_delayless_switch_id (det_routing_arch, load_rr_graph);
760
763
VTR_ASSERT (delayless_switch != OPEN);
761
764
build_intra_cluster_rr_graph (graph_type,
762
765
grid,
@@ -1529,6 +1532,26 @@ static void build_intra_cluster_rr_graph(const t_graph_type graph_type,
1529
1532
is_flat);
1530
1533
}
1531
1534
1535
+ static short get_delayless_switch_id (t_det_routing_arch* det_routing_arch,
1536
+ bool load_rr_graph) {
1537
+ const auto & device_ctx = g_vpr_ctx.device ();
1538
+ short delayless_switch;
1539
+ if (load_rr_graph) {
1540
+ const auto & rr_switches = device_ctx.rr_graph .rr_switch ();
1541
+ for (int switch_id = 0 ; switch_id < static_cast <int >(rr_switches.size ()); switch_id++){
1542
+ const auto & rr_switch = rr_switches[RRSwitchId (switch_id)];
1543
+ if (rr_switch.name .find (" delayless" ) != std::string::npos) {
1544
+ delayless_switch = static_cast <short >(switch_id);
1545
+ break ;
1546
+ }
1547
+ }
1548
+ } else {
1549
+ delayless_switch = det_routing_arch->delayless_switch ;
1550
+ }
1551
+
1552
+ return delayless_switch;
1553
+ }
1554
+
1532
1555
void build_tile_rr_graph (RRGraphBuilder& rr_graph_builder,
1533
1556
const t_det_routing_arch& det_routing_arch,
1534
1557
t_physical_tile_type_ptr physical_tile,
0 commit comments