@@ -758,23 +758,27 @@ namespace xdp {
758
758
std::vector<std::vector<std::string>> metrics (metricsSettings.size ());
759
759
760
760
// Pass 1 : process only "all" metric setting
761
+ // all:<metric>[:<channel0>[:<channel1>]]
761
762
for (size_t i = 0 ; i < metricsSettings.size (); ++i) {
762
763
// Split done only in Pass 1
763
764
boost::split (metrics[i], metricsSettings[i], boost::is_any_of (" :" ));
764
765
765
766
if (metrics[i][0 ].compare (" all" ) != 0 )
766
767
continue ;
767
768
768
- uint8_t channelId = (metrics[i].size () < 3 ) ? 0 : aie::convertStringToUint8 (metrics[i][2 ]);
769
- auto tiles = metadataReader->getInterfaceTiles (" all" , " all" , metrics[i][1 ], channelId);
769
+ uint8_t channelId0 = (metrics[i].size () < 3 ) ? 0 : aie::convertStringToUint8 (metrics[i][2 ]);
770
+ uint8_t channelId1 = (metrics[i].size () < 4 ) ? channelId0 : aie::convertStringToUint8 (metrics[i][3 ]);
771
+ auto tiles = metadataReader->getInterfaceTiles (" all" , " all" , metrics[i][1 ], channelId0);
770
772
771
773
for (auto & t : tiles) {
772
774
configMetrics[moduleIdx][t] = metrics[i][1 ];
773
- configChannel0[t] = channelId;
775
+ configChannel0[t] = channelId0;
776
+ configChannel1[t] = channelId1;
774
777
}
775
778
} // Pass 1
776
779
777
780
// Pass 2 : process only range of tiles metric setting
781
+ // <minclumn>:<maxcolumn>:<metric>[:<channel0>[:<channel1>]]
778
782
for (size_t i = 0 ; i < metricsSettings.size (); ++i) {
779
783
if ((metrics[i][0 ].compare (" all" ) == 0 ) || (metrics[i].size () < 3 ))
780
784
continue ;
@@ -803,11 +807,13 @@ namespace xdp {
803
807
continue ;
804
808
}
805
809
806
- uint8_t channelId = 0 ;
810
+ uint8_t channelId0 = 0 ;
811
+ uint8_t channelId1 = 0 ;
807
812
808
- if (metrics[i].size () = = 4 ) {
813
+ if (metrics[i].size () > = 4 ) {
809
814
try {
810
- channelId = aie::convertStringToUint8 (metrics[i][3 ]);
815
+ channelId0 = aie::convertStringToUint8 (metrics[i][3 ]);
816
+ channelId1 = (metrics[i].size () == 4 ) ? channelId0 : aie::convertStringToUint8 (metrics[i][4 ]);
811
817
}
812
818
catch (std::invalid_argument const &) {
813
819
// Expected channel Id is not an integer, give warning and ignore
@@ -818,15 +824,17 @@ namespace xdp {
818
824
}
819
825
}
820
826
821
- auto tiles = metadataReader->getInterfaceTiles (" all" , " all" , metrics[i][2 ], channelId , true , minCol, maxCol);
827
+ auto tiles = metadataReader->getInterfaceTiles (" all" , " all" , metrics[i][2 ], channelId0 , true , minCol, maxCol);
822
828
823
829
for (auto & t : tiles) {
824
830
configMetrics[moduleIdx][t] = metrics[i][2 ];
825
- configChannel0[t] = channelId;
831
+ configChannel0[t] = channelId0;
832
+ configChannel1[t] = channelId1;
826
833
}
827
834
} // Pass 2
828
835
829
836
// Pass 3 : process only single tile metric setting
837
+ // <singleColumn>:<metric>[:<channel0>[:<channel1>]]
830
838
for (size_t i = 0 ; i < metricsSettings.size (); ++i) {
831
839
// Skip range specification, invalid format, or already processed
832
840
if ((metrics[i].size () == 4 ) || (metrics[i].size () < 2 ) || (metrics[i][0 ].compare (" all" ) == 0 ))
@@ -850,11 +858,13 @@ namespace xdp {
850
858
continue ;
851
859
}
852
860
853
- uint8_t channelId = 0 ;
861
+ uint8_t channelId0 = 0 ;
862
+ uint8_t channelId1 = 0 ;
854
863
855
- if (metrics[i].size () = = 3 ) {
864
+ if (metrics[i].size () > = 3 ) {
856
865
try {
857
- channelId = aie::convertStringToUint8 (metrics[i][2 ]);
866
+ channelId0 = aie::convertStringToUint8 (metrics[i][2 ]);
867
+ channelId1 = (metrics[i].size () == 3 ) ? channelId0 : aie::convertStringToUint8 (metrics[i][3 ]);
858
868
}
859
869
catch (std::invalid_argument const &) {
860
870
// Expected channel Id is not an integer, give warning and ignore
@@ -865,11 +875,12 @@ namespace xdp {
865
875
}
866
876
}
867
877
868
- auto tiles = metadataReader->getInterfaceTiles (" all" , " all" , metrics[i][1 ], channelId , true , col, col);
878
+ auto tiles = metadataReader->getInterfaceTiles (" all" , " all" , metrics[i][1 ], channelId0 , true , col, col);
869
879
870
880
for (auto & t : tiles) {
871
881
configMetrics[moduleIdx][t] = metrics[i][1 ];
872
- configChannel0[t] = channelId;
882
+ configChannel0[t] = channelId0;
883
+ configChannel1[t] = channelId1;
873
884
}
874
885
}
875
886
} // Pass 3
0 commit comments