@@ -29,7 +29,7 @@ static float get_delay_normalization_fac(const vtr::vector<RRIndexedDataId, t_rr
29
29
30
30
static void load_rr_indexed_data_T_values (const RRGraphView& rr_graph, vtr::vector<RRIndexedDataId, t_rr_indexed_data>& rr_indexed_data);
31
31
32
- static void calculate_average_switch (const RRGraphView& rr_graph, int inode, double & avg_switch_R, double & avg_switch_T, double & avg_switch_Cinternal, int & num_switches, short & buffered, vtr::vector<RRNodeId, std::vector<RREdgeId>>& fan_in_list);
32
+ static void calculate_average_switch (const RRGraphView& rr_graph, int inode, double & avg_switch_R, double & avg_switch_T, double & avg_switch_Cinternal, int & num_switches, int & num_shorts, short & buffered, vtr::vector<RRNodeId, std::vector<RREdgeId>>& fan_in_list);
33
33
34
34
static void fixup_rr_indexed_data_T_values (vtr::vector<RRIndexedDataId, t_rr_indexed_data>& rr_indexed_data, size_t num_segment);
35
35
@@ -541,15 +541,18 @@ static void load_rr_indexed_data_T_values(const RRGraphView& rr_graph,
541
541
double avg_switch_T = 0 ;
542
542
double avg_switch_Cinternal = 0 ;
543
543
int num_switches = 0 ;
544
+ int num_shorts = 0 ;
544
545
short buffered = UNDEFINED;
545
- calculate_average_switch (rr_graph, (size_t )rr_id, avg_switch_R, avg_switch_T, avg_switch_Cinternal, num_switches, buffered, fan_in_list);
546
+ calculate_average_switch (rr_graph, (size_t )rr_id, avg_switch_R, avg_switch_T, avg_switch_Cinternal, num_switches, num_shorts, buffered, fan_in_list);
546
547
547
548
if (num_switches == 0 ) {
548
- VTR_LOG_WARN (" Node: %d with RR_type: %s at Location:%s, had no incoming switches\n " , rr_id,
549
- rr_graph.node_type_string (rr_id), node_cords.c_str ());
549
+ if (num_shorts == 0 ) {
550
+ VTR_LOG_WARN (" Node: %d with RR_type: %s at Location:%s, had no out-going switches\n " , rr_id,
551
+ rr_graph.node_type_string (rr_id), node_cords.c_str ());
552
+ }
550
553
continue ;
551
- }
552
- VTR_ASSERT (num_switches > 0 );
554
+ }
555
+ VTR_ASSERT (num_switches > 0 || num_shorts > 0 );
553
556
554
557
num_nodes_of_index[cost_index]++;
555
558
C_total[cost_index].push_back (rr_graph.node_C (rr_id));
@@ -633,20 +636,24 @@ static void load_rr_indexed_data_T_values(const RRGraphView& rr_graph,
633
636
* It is not safe to assume that each node of the same wire type has the same switches with the same
634
637
* delays, therefore we take their average to take into account the possible differences
635
638
*/
636
- static void calculate_average_switch (const RRGraphView& rr_graph, int inode, double & avg_switch_R, double & avg_switch_T, double & avg_switch_Cinternal, int & num_switches, short & buffered, vtr::vector<RRNodeId, std::vector<RREdgeId>>& fan_in_list) {
639
+ static void calculate_average_switch (const RRGraphView& rr_graph, int inode, double & avg_switch_R, double & avg_switch_T, double & avg_switch_Cinternal, int & num_switches, int & num_shorts, short & buffered, vtr::vector<RRNodeId, std::vector<RREdgeId>>& fan_in_list) {
637
640
auto node = RRNodeId (inode);
638
641
639
642
avg_switch_R = 0 ;
640
643
avg_switch_T = 0 ;
641
644
avg_switch_Cinternal = 0 ;
642
645
num_switches = 0 ;
646
+ num_shorts = 0 ;
643
647
buffered = UNDEFINED;
644
648
for (const auto & edge : fan_in_list[node]) {
645
649
/* want to get C/R/Tdel/Cinternal of switches that connect this track segment to other track segments */
646
650
if (rr_graph.node_type (node) == CHANX || rr_graph.node_type (node) == CHANY) {
647
651
int switch_index = rr_graph.rr_nodes ().edge_switch (edge);
648
652
649
- if (rr_graph.rr_switch_inf (RRSwitchId (switch_index)).type () == SwitchType::SHORT) continue ;
653
+ if (rr_graph.rr_switch_inf (RRSwitchId (switch_index)).type () == SwitchType::SHORT) {
654
+ num_shorts++;
655
+ continue ;
656
+ }
650
657
651
658
avg_switch_R += rr_graph.rr_switch_inf (RRSwitchId (switch_index)).R ;
652
659
avg_switch_T += rr_graph.rr_switch_inf (RRSwitchId (switch_index)).Tdel ;
0 commit comments