@@ -72,7 +72,8 @@ class ProgramStatus : public Program
7272 std::ostringstream table;
7373 std::string formatHeader;
7474 std::string formatRow;
75- std::string header;
75+ std::string header1;
76+ std::string header2;
7677 std::string lineFat;
7778 std::string lineThin;
7879
@@ -91,14 +92,15 @@ class ProgramStatus : public Program
9192 }
9293
9394 if (cardType == CardType::type::Crorc) {
94- formatHeader = " %-9s %-8s %-19s\n " ;
95- formatRow = " %-9s %-8s %-19.1f\n " ;
96- header = (boost::format (formatHeader) % " Link ID" % " Status" % " Optical power(uW)" ).str ();
97- lineFat = std::string (header.length (), ' =' ) + ' \n ' ;
98- lineThin = std::string (header.length (), ' -' ) + ' \n ' ;
95+ formatHeader = " %-6s %-8s %-11s\n " ;
96+ formatRow = " %-6s %-8s %-11.1f\n " ;
97+ header1 = (boost::format (formatHeader) % " Link" % " Status" % " Optical" ).str ();
98+ header2 = (boost::format (formatHeader) % " ID" % " " % " power (uW)" ).str ();
99+ lineFat = std::string (header1.length (), ' =' ) + ' \n ' ;
100+ lineThin = std::string (header1.length (), ' -' ) + ' \n ' ;
99101
100102 if (!mOptions .jsonOut ) {
101- table << lineFat << header << lineThin;
103+ table << lineFat << header1 << header2 << lineThin;
102104 }
103105
104106 auto params = Parameters::makeParameters (cardId, 0 ); // status available on BAR0
@@ -176,19 +178,25 @@ class ProgramStatus : public Program
176178 }
177179 }
178180 } else if (cardType == CardType::type::Cru) {
179- formatHeader = " %-9s %-16s %-10s %-14s %-15s %-10s %-14s %-14s %-8s %-19s %-11s %-7s\n " ;
180- formatRow = " %-9s %-16s %-10s %-14s %-15s %-10s %-14.2f %-14.2f %-8s %-19.1f %-11s %-7s\n " ;
181- header = (boost::format (formatHeader) % " Link ID" % " GBT Mode Tx/Rx" % " Loopback" % " GBT MUX" % " Datapath Mode" % " Datapath" % " RX freq(MHz)" % " TX freq(MHz)" % " Status" % " Optical power(uW)" % " System ID" % " FEE ID" ).str ();
182- lineFat = std::string (header.length (), ' =' ) + ' \n ' ;
183- lineThin = std::string (header.length (), ' -' ) + ' \n ' ;
181+ if (mOptions .fec ) {
182+ formatHeader = " %-6s %-10s %-10s %-14s %-10s %-10s %-8s %-8s %-7s %-7s %-11s %-7s %-7s\n " ;
183+ formatRow = " %-6s %-10s %-10s %-14s %-10s %-10s %-8.2f %-8.2f %-7s %-7s %-11.1f %-7s %-7s\n " ;
184+ } else {
185+ formatHeader = " %-6s %-10s %-10s %-14s %-10s %-10s %-8s %-8s %-7s%-0s %-11s %-7s %-7s\n " ;
186+ formatRow = " %-6s %-10s %-10s %-14s %-10s %-10s %-8.2f %-8.2f %-7s%-0s %-11.1f %-7s %-7s\n " ;
187+ }
188+ header1 = (boost::format (formatHeader) % " Link" % " GBT Mode" % " Loopback" % " GBT MUX" % " Datapath" % " Datapath" % " RX freq" % " TX freq" % " Status" % (mOptions .fec ? " FEC" : " " ) % " Optical" % " System" % " FEE" ).str ();
189+ header2 = (boost::format (formatHeader) % " ID" % " Tx/Rx" % " " % " " % " mode" % " status" % " (MHz)" % " (MHz)" % " " % " " % " power (uW)" % " ID" % " ID" ).str ();
190+ lineFat = std::string (header1.length (), ' =' ) + ' \n ' ;
191+ lineThin = std::string (header2.length (), ' -' ) + ' \n ' ;
184192
185193 auto params = Parameters::makeParameters (cardId, 2 ); // status available on BAR2
186194 params.setLinkMask (Parameters::linkMaskFromString (mOptions .links ));
187195 auto bar2 = ChannelFactory ().getBar (params);
188196 auto cruBar2 = std::dynamic_pointer_cast<CruBar>(bar2);
189197
190198 if (!mOptions .jsonOut ) {
191- table << lineFat << header << lineThin;
199+ table << lineFat << header1 << header2 << lineThin;
192200 }
193201
194202 Cru::ReportInfo reportInfo = cruBar2->report ();
@@ -198,6 +206,7 @@ class ProgramStatus : public Program
198206 std::string userLogic = (reportInfo.userLogicEnabled ? " Enabled" : " Disabled" );
199207 std::string runStats = (reportInfo.runStatsEnabled ? " Enabled" : " Disabled" );
200208 std::string userAndCommonLogic = (reportInfo.userAndCommonLogicEnabled ? " Enabled" : " Disabled" );
209+ std::string dmaStatus = reportInfo.dmaStatus ? " Enabled" : " Disabled" ;
201210
202211 /* GENERAL PARAMETERS */
203212 if (mOptions .monitoring ) {
@@ -210,6 +219,7 @@ class ProgramStatus : public Program
210219 .addValue (reportInfo.runStatsEnabled , " runStats" )
211220 .addValue (reportInfo.userAndCommonLogicEnabled , " userAndCommonLogic" )
212221 .addValue (reportInfo.timeFrameLength , " timeFrameLength" )
222+ .addValue (reportInfo.dmaStatus , " dmaStatus" )
213223 .addTag (tags::Key::SerialId, card.serialId .getSerial ())
214224 .addTag (tags::Key::Endpoint, card.serialId .getEndpoint ())
215225 .addTag (tags::Key::ID, card.sequenceId )
@@ -225,6 +235,7 @@ class ProgramStatus : public Program
225235 root.put (" runStats" , runStats);
226236 root.put (" userAndCommonLogic" , userAndCommonLogic);
227237 root.put (" timeFrameLength" , reportInfo.timeFrameLength );
238+ root.put (" dmaStatus" , dmaStatus);
228239 } else {
229240 std::cout << " -----------------------------" << std::endl;
230241 std::cout << " CRU ID: " << reportInfo.cruId << std::endl;
@@ -239,6 +250,7 @@ class ProgramStatus : public Program
239250 if (reportInfo.runStatsEnabled ) {
240251 std::cout << " Run statistics enabled" << std::endl;
241252 }
253+ std::cout << " DMA: " << dmaStatus << std::endl;
242254 }
243255
244256 /* ONU PARAMETERS */
@@ -379,6 +391,11 @@ class ProgramStatus : public Program
379391
380392 float rxFreq = link.rxFreq ;
381393 float txFreq = link.txFreq ;
394+ uint32_t glitchCounter = link.glitchCounter ;
395+ std::string fecCounter;
396+ if (mOptions .fec ) {
397+ fecCounter = Utilities::toHexString (link.fecCounter );
398+ }
382399
383400 std::string linkStatus;
384401 if (link.stickyBit == Cru::LinkStatus::Up) {
@@ -407,6 +424,7 @@ class ProgramStatus : public Program
407424 .addValue (opticalPower, " opticalPower" )
408425 .addValue (systemId, " systemId" )
409426 .addValue (feeId, " feeId" )
427+ .addValue ((int )glitchCounter, " glitchCounter" )
410428 .addTag (tags::Key::SerialId, card.serialId .getSerial ())
411429 .addTag (tags::Key::Endpoint, card.serialId .getEndpoint ())
412430 .addTag (tags::Key::CRU, card.sequenceId )
@@ -427,11 +445,15 @@ class ProgramStatus : public Program
427445 linkNode.put (" opticalPower" , Utilities::toPreciseString (opticalPower));
428446 linkNode.put (" systemId" , systemId);
429447 linkNode.put (" feeId" , feeId);
448+ linkNode.put (" glitchCounter" , glitchCounter);
449+ if (mOptions .fec ) {
450+ linkNode.put (" fecCounter" , fecCounter);
451+ }
430452
431453 // add the link node to the tree
432454 root.add_child (std::to_string (globalId), linkNode);
433455 } else {
434- auto format = boost::format (formatRow) % globalId % gbtTxRxMode % loopback % gbtMux % datapathMode % enabled % rxFreq % txFreq % linkStatus % opticalPower % systemId % feeId;
456+ auto format = boost::format (formatRow) % globalId % gbtTxRxMode % loopback % gbtMux % datapathMode % enabled % rxFreq % txFreq % linkStatus % fecCounter % opticalPower % systemId % feeId;
435457 table << format;
436458 }
437459 }
@@ -443,7 +465,7 @@ class ProgramStatus : public Program
443465 if (mOptions .jsonOut ) {
444466 pt::write_json (std::cout, root);
445467 } else if (!mOptions .monitoring ) {
446- auto lineFat = std::string (header .length (), ' =' ) + ' \n ' ;
468+ auto lineFat = std::string (header1 .length (), ' =' ) + ' \n ' ;
447469 table << lineFat;
448470 std::cout << table.str ();
449471 }
0 commit comments