4
4
/* Headers from vtrutil library */
5
5
#include " vtr_log.h"
6
6
#include " vtr_assert.h"
7
+ #include " vpr_error.h"
7
8
8
9
#include " tileable_rr_graph_utils.h"
9
10
#include " side_manager.h"
@@ -98,8 +99,7 @@ std::vector<enum e_side> RRGSB::get_cb_ipin_sides(const e_rr_type& cb_type) cons
98
99
ipin_sides.push_back (LEFT);
99
100
break ;
100
101
default :
101
- VTR_LOG (" Invalid type of connection block!\n " );
102
- exit (1 );
102
+ VPR_FATAL_ERROR (VPR_ERROR_ROUTE, " Invalid type of connection block!\n " );
103
103
}
104
104
105
105
return ipin_sides;
@@ -123,8 +123,7 @@ std::vector<enum e_side> RRGSB::get_cb_opin_sides(const e_rr_type& cb_type) cons
123
123
opin_sides.push_back (LEFT);
124
124
break ;
125
125
default :
126
- VTR_LOG (" Invalid type of connection block!\n " );
127
- exit (1 );
126
+ VPR_FATAL_ERROR (VPR_ERROR_ROUTE, " Invalid type of connection block!\n " );
128
127
}
129
128
130
129
return opin_sides;
@@ -381,8 +380,7 @@ int RRGSB::get_node_index(const RRGraphView& rr_graph,
381
380
}
382
381
break ;
383
382
default :
384
- VTR_LOG (" Invalid cur_rr_node type! Should be [CHANX|CHANY|IPIN|OPIN]\n " );
385
- exit (1 );
383
+ VPR_FATAL_ERROR (VPR_ERROR_ROUTE, " Invalid cur_rr_node type! Should be [CHANX|CHANY|IPIN|OPIN]\n " );
386
384
}
387
385
388
386
VTR_ASSERT ((0 == cnt) || (1 == cnt));
@@ -675,8 +673,7 @@ vtr::Point<size_t> RRGSB::get_cb_coordinate(const e_rr_type& cb_type) const {
675
673
case e_rr_type::CHANY:
676
674
return coordinate_;
677
675
default :
678
- VTR_LOG (" Invalid type of connection block!\n " );
679
- exit (1 );
676
+ VPR_FATAL_ERROR (VPR_ERROR_ROUTE, " Invalid type of connection block!\n " );
680
677
}
681
678
}
682
679
@@ -688,8 +685,7 @@ e_side RRGSB::get_cb_chan_side(const e_rr_type& cb_type) const {
688
685
case e_rr_type::CHANY:
689
686
return BOTTOM;
690
687
default :
691
- VTR_LOG (" Invalid type of connection block!\n " );
692
- exit (1 );
688
+ VPR_FATAL_ERROR (VPR_ERROR_ROUTE, " Invalid type of connection block!\n " );
693
689
}
694
690
}
695
691
@@ -705,8 +701,7 @@ e_side RRGSB::get_cb_chan_side(const e_side& ipin_side) const {
705
701
case LEFT:
706
702
return BOTTOM;
707
703
default :
708
- VTR_LOG (" Invalid type of ipin_side!\n " );
709
- exit (1 );
704
+ VPR_FATAL_ERROR (VPR_ERROR_ROUTE, " Invalid type of ipin_side!\n " );
710
705
}
711
706
}
712
707
@@ -735,8 +730,7 @@ vtr::Point<size_t> RRGSB::get_side_block_coordinate(const e_side& side) const {
735
730
/* 4. Channel X [x][y] inputs */
736
731
break ;
737
732
default :
738
- VTR_LOG (" Invalid side!\n " );
739
- exit (1 );
733
+ VPR_FATAL_ERROR (VPR_ERROR_ROUTE, " Invalid side!\n " );
740
734
}
741
735
742
736
return ret;
@@ -752,35 +746,35 @@ vtr::Point<size_t> RRGSB::get_grid_coordinate() const {
752
746
/* get a copy from a source */
753
747
void RRGSB::set (const RRGSB& src) {
754
748
/* Copy coordinate */
755
- this -> set_coordinate (src.get_sb_coordinate ().x (), src.get_sb_coordinate ().y ());
749
+ set_coordinate (src.get_sb_coordinate ().x (), src.get_sb_coordinate ().y ());
756
750
757
751
/* Initialize sides */
758
- this -> init_num_sides (src.get_num_sides ());
752
+ init_num_sides (src.get_num_sides ());
759
753
760
754
/* Copy vectors */
761
755
for (size_t side = 0 ; side < src.get_num_sides (); ++side) {
762
756
SideManager side_manager (side);
763
757
/* Copy chan_nodes */
764
758
/* skip if there is no channel width */
765
759
if (0 < src.get_chan_width (side_manager.get_side ())) {
766
- this -> chan_node_ [side_manager.get_side ()].set (src.chan_node_ [side_manager.get_side ()]);
760
+ chan_node_[side_manager.get_side ()].set (src.chan_node_ [side_manager.get_side ()]);
767
761
/* Copy chan_node_direction_*/
768
- this -> chan_node_direction_ [side_manager.get_side ()].clear ();
762
+ chan_node_direction_[side_manager.get_side ()].clear ();
769
763
for (size_t inode = 0 ; inode < src.get_chan_width (side_manager.get_side ()); ++inode) {
770
- this -> chan_node_direction_ [side_manager.get_side ()].push_back (src.get_chan_node_direction (side_manager.get_side (), inode));
764
+ chan_node_direction_[side_manager.get_side ()].push_back (src.get_chan_node_direction (side_manager.get_side (), inode));
771
765
}
772
766
}
773
767
774
768
/* Copy opin_node and opin_node_grid_side_ */
775
- this -> opin_node_ [side_manager.get_side ()].clear ();
769
+ opin_node_[side_manager.get_side ()].clear ();
776
770
for (size_t inode = 0 ; inode < src.get_num_opin_nodes (side_manager.get_side ()); ++inode) {
777
- this -> opin_node_ [side_manager.get_side ()].push_back (src.get_opin_node (side_manager.get_side (), inode));
771
+ opin_node_[side_manager.get_side ()].push_back (src.get_opin_node (side_manager.get_side (), inode));
778
772
}
779
773
780
774
/* Copy ipin_node and ipin_node_grid_side_ */
781
- this -> ipin_node_ [side_manager.get_side ()].clear ();
775
+ ipin_node_[side_manager.get_side ()].clear ();
782
776
for (size_t inode = 0 ; inode < src.get_num_ipin_nodes (side_manager.get_side ()); ++inode) {
783
- this -> ipin_node_ [side_manager.get_side ()].push_back (src.get_ipin_node (side_manager.get_side (), inode));
777
+ ipin_node_[side_manager.get_side ()].push_back (src.get_ipin_node (side_manager.get_side (), inode));
784
778
}
785
779
}
786
780
}
@@ -863,22 +857,22 @@ void RRGSB::sort_chan_node_in_edges(const RRGraphView& rr_graph,
863
857
864
858
/* Must have valid side and index */
865
859
if (NUM_2D_SIDES == side) {
866
- VTR_LOG (" GSB[%lu][%lu]:\n " , get_x (), get_y ());
867
- VTR_LOG (" ----------------------------------\n " );
868
- VTR_LOG (" SRC node:\n " );
869
- VTR_LOG (" Node info: %s\n " , rr_graph.node_coordinate_to_string (src_node).c_str ());
870
- VTR_LOG (" Node ptc: %d\n " , rr_graph.node_ptc_num (src_node));
871
- VTR_LOG (" Fan-out nodes:\n " );
860
+ VTR_LOG_DEBUG (" GSB[%lu][%lu]:\n " , get_x (), get_y ());
861
+ VTR_LOG_DEBUG (" ----------------------------------\n " );
862
+ VTR_LOG_DEBUG (" SRC node:\n " );
863
+ VTR_LOG_DEBUG (" Node info: %s\n " , rr_graph.node_coordinate_to_string (src_node).c_str ());
864
+ VTR_LOG_DEBUG (" Node ptc: %d\n " , rr_graph.node_ptc_num (src_node));
865
+ VTR_LOG_DEBUG (" Fan-out nodes:\n " );
872
866
for (const auto & temp_edge : rr_graph.edge_range (src_node)) {
873
- VTR_LOG (" \t %s\n " , rr_graph.node_coordinate_to_string (rr_graph.edge_sink_node (temp_edge)).c_str ());
867
+ VTR_LOG_DEBUG (" \t %s\n " , rr_graph.node_coordinate_to_string (rr_graph.edge_sink_node (temp_edge)).c_str ());
874
868
}
875
- VTR_LOG (" \n ----------------------------------\n " );
876
- VTR_LOG (" Channel node:\n " );
877
- VTR_LOG (" Node info: %s\n " , rr_graph.node_coordinate_to_string (chan_node).c_str ());
878
- VTR_LOG (" Node ptc: %d\n " , rr_graph.node_ptc_num (chan_node));
879
- VTR_LOG (" Fan-in nodes:\n " );
869
+ VTR_LOG_DEBUG (" \n ----------------------------------\n " );
870
+ VTR_LOG_DEBUG (" Channel node:\n " );
871
+ VTR_LOG_DEBUG (" Node info: %s\n " , rr_graph.node_coordinate_to_string (chan_node).c_str ());
872
+ VTR_LOG_DEBUG (" Node ptc: %d\n " , rr_graph.node_ptc_num (chan_node));
873
+ VTR_LOG_DEBUG (" Fan-in nodes:\n " );
880
874
for (const auto & temp_edge : rr_graph.node_in_edges (chan_node)) {
881
- VTR_LOG (" \t %s\n " , rr_graph.node_coordinate_to_string (rr_graph.edge_src_node (temp_edge)).c_str ());
875
+ VTR_LOG_DEBUG (" \t %s\n " , rr_graph.node_coordinate_to_string (rr_graph.edge_src_node (temp_edge)).c_str ());
882
876
}
883
877
}
884
878
@@ -979,22 +973,22 @@ void RRGSB::sort_ipin_node_in_edges(const RRGraphView& rr_graph,
979
973
980
974
/* Must have valid side and index */
981
975
if (OPEN == index) {
982
- VTR_LOG (" GSB[%lu][%lu]:\n " , get_x (), get_y ());
983
- VTR_LOG (" ----------------------------------\n " );
984
- VTR_LOG (" SRC node:\n " );
985
- VTR_LOG (" Node info: %s\n " , rr_graph.node_coordinate_to_string (src_node).c_str ());
986
- VTR_LOG (" Node ptc: %d\n " , rr_graph.node_ptc_num (src_node));
987
- VTR_LOG (" Fan-out nodes:\n " );
976
+ VTR_LOG_DEBUG (" GSB[%lu][%lu]:\n " , get_x (), get_y ());
977
+ VTR_LOG_DEBUG (" ----------------------------------\n " );
978
+ VTR_LOG_DEBUG (" SRC node:\n " );
979
+ VTR_LOG_DEBUG (" Node info: %s\n " , rr_graph.node_coordinate_to_string (src_node).c_str ());
980
+ VTR_LOG_DEBUG (" Node ptc: %d\n " , rr_graph.node_ptc_num (src_node));
981
+ VTR_LOG_DEBUG (" Fan-out nodes:\n " );
988
982
for (const auto & temp_edge : rr_graph.edge_range (src_node)) {
989
- VTR_LOG (" \t %s\n " , rr_graph.node_coordinate_to_string (rr_graph.edge_sink_node (temp_edge)).c_str ());
983
+ VTR_LOG_DEBUG (" \t %s\n " , rr_graph.node_coordinate_to_string (rr_graph.edge_sink_node (temp_edge)).c_str ());
990
984
}
991
- VTR_LOG (" \n ----------------------------------\n " );
992
- VTR_LOG (" IPIN node:\n " );
993
- VTR_LOG (" Node info: %s\n " , rr_graph.node_coordinate_to_string (ipin_node).c_str ());
994
- VTR_LOG (" Node ptc: %d\n " , rr_graph.node_ptc_num (ipin_node));
995
- VTR_LOG (" Fan-in nodes:\n " );
985
+ VTR_LOG_DEBUG (" \n ----------------------------------\n " );
986
+ VTR_LOG_DEBUG (" IPIN node:\n " );
987
+ VTR_LOG_DEBUG (" Node info: %s\n " , rr_graph.node_coordinate_to_string (ipin_node).c_str ());
988
+ VTR_LOG_DEBUG (" Node ptc: %d\n " , rr_graph.node_ptc_num (ipin_node));
989
+ VTR_LOG_DEBUG (" Fan-in nodes:\n " );
996
990
for (const auto & temp_edge : rr_graph.node_in_edges (ipin_node)) {
997
- VTR_LOG (" \t %s\n " , rr_graph.node_coordinate_to_string (rr_graph.edge_src_node (temp_edge)).c_str ());
991
+ VTR_LOG_DEBUG (" \t %s\n " , rr_graph.node_coordinate_to_string (rr_graph.edge_src_node (temp_edge)).c_str ());
998
992
}
999
993
}
1000
994
@@ -1020,22 +1014,22 @@ void RRGSB::sort_ipin_node_in_edges(const RRGraphView& rr_graph,
1020
1014
VTR_ASSERT ((-1 != cb_opin_index) && (NUM_2D_SIDES != cb_opin_side));
1021
1015
/* Must have valid side and index */
1022
1016
if (OPEN == cb_opin_index || NUM_2D_SIDES == cb_opin_side) {
1023
- VTR_LOG (" GSB[%lu][%lu]:\n " , get_x (), get_y ());
1024
- VTR_LOG (" ----------------------------------\n " );
1025
- VTR_LOG (" SRC node:\n " );
1026
- VTR_LOG (" Node info: %s\n " , rr_graph.node_coordinate_to_string (src_node).c_str ());
1027
- VTR_LOG (" Node ptc: %d\n " , rr_graph.node_ptc_num (src_node));
1028
- VTR_LOG (" Fan-out nodes:\n " );
1017
+ VTR_LOG_DEBUG (" GSB[%lu][%lu]:\n " , get_x (), get_y ());
1018
+ VTR_LOG_DEBUG (" ----------------------------------\n " );
1019
+ VTR_LOG_DEBUG (" SRC node:\n " );
1020
+ VTR_LOG_DEBUG (" Node info: %s\n " , rr_graph.node_coordinate_to_string (src_node).c_str ());
1021
+ VTR_LOG_DEBUG (" Node ptc: %d\n " , rr_graph.node_ptc_num (src_node));
1022
+ VTR_LOG_DEBUG (" Fan-out nodes:\n " );
1029
1023
for (const auto & temp_edge : rr_graph.edge_range (src_node)) {
1030
- VTR_LOG (" \t %s\n " , rr_graph.node_coordinate_to_string (rr_graph.edge_sink_node (temp_edge)).c_str ());
1024
+ VTR_LOG_DEBUG (" \t %s\n " , rr_graph.node_coordinate_to_string (rr_graph.edge_sink_node (temp_edge)).c_str ());
1031
1025
}
1032
- VTR_LOG (" \n ----------------------------------\n " );
1033
- VTR_LOG (" IPIN node:\n " );
1034
- VTR_LOG (" Node info: %s\n " , rr_graph.node_coordinate_to_string (ipin_node).c_str ());
1035
- VTR_LOG (" Node ptc: %d\n " , rr_graph.node_ptc_num (ipin_node));
1036
- VTR_LOG (" Fan-in nodes:\n " );
1026
+ VTR_LOG_DEBUG (" \n ----------------------------------\n " );
1027
+ VTR_LOG_DEBUG (" IPIN node:\n " );
1028
+ VTR_LOG_DEBUG (" Node info: %s\n " , rr_graph.node_coordinate_to_string (ipin_node).c_str ());
1029
+ VTR_LOG_DEBUG (" Node ptc: %d\n " , rr_graph.node_ptc_num (ipin_node));
1030
+ VTR_LOG_DEBUG (" Fan-in nodes:\n " );
1037
1031
for (const auto & temp_edge : rr_graph.node_in_edges (ipin_node)) {
1038
- VTR_LOG (" \t %s\n " , rr_graph.node_coordinate_to_string (rr_graph.edge_src_node (temp_edge)).c_str ());
1032
+ VTR_LOG_DEBUG (" \t %s\n " , rr_graph.node_coordinate_to_string (rr_graph.edge_src_node (temp_edge)).c_str ());
1039
1033
}
1040
1034
}
1041
1035
from_opin_edge_map[size_t (cb_opin_side)][cb_opin_index] = edge;
@@ -1095,14 +1089,14 @@ void RRGSB::build_cb_opin_nodes(const RRGraphView& rr_graph) {
1095
1089
get_node_side_and_index (rr_graph, cand_node, IN_PORT, cb_opin_side,
1096
1090
cb_opin_index);
1097
1091
if ((-1 == cb_opin_index) || (NUM_2D_SIDES == cb_opin_side)) {
1098
- VTR_LOG (" GSB[%lu][%lu]:\n " , get_x (), get_y ());
1099
- VTR_LOG (" ----------------------------------\n " );
1100
- VTR_LOG (" SRC node:\n " );
1101
- VTR_LOG (" Node info: %s\n " , rr_graph.node_coordinate_to_string (cand_node).c_str ());
1102
- VTR_LOG (" Node ptc: %d\n " , rr_graph.node_ptc_num (cand_node));
1103
- VTR_LOG (" Fan-out nodes:\n " );
1092
+ VTR_LOG_DEBUG (" GSB[%lu][%lu]:\n " , get_x (), get_y ());
1093
+ VTR_LOG_DEBUG (" ----------------------------------\n " );
1094
+ VTR_LOG_DEBUG (" SRC node:\n " );
1095
+ VTR_LOG_DEBUG (" Node info: %s\n " , rr_graph.node_coordinate_to_string (cand_node).c_str ());
1096
+ VTR_LOG_DEBUG (" Node ptc: %d\n " , rr_graph.node_ptc_num (cand_node));
1097
+ VTR_LOG_DEBUG (" Fan-out nodes:\n " );
1104
1098
for (const auto & temp_edge : rr_graph.edge_range (cand_node)) {
1105
- VTR_LOG (" \t %s\n " , rr_graph.node_coordinate_to_string (rr_graph.edge_sink_node (temp_edge)).c_str ());
1099
+ VTR_LOG_DEBUG (" \t %s\n " , rr_graph.node_coordinate_to_string (rr_graph.edge_sink_node (temp_edge)).c_str ());
1106
1100
}
1107
1101
}
1108
1102
VTR_ASSERT ((-1 != cb_opin_index) && (NUM_2D_SIDES != cb_opin_side));
0 commit comments