diff --git a/README.md b/README.md index 3b776333..c4705fd3 100644 --- a/README.md +++ b/README.md @@ -611,6 +611,7 @@ metric format for the CRORC and the CRU is different, as different parameters ar | `"mgtRxPllLocked"` | 0/1 (False/True) | int | | `"ponQualityStatus"` | 0/1 (Bad/Good) | int | | `"ponRxPower"` | dBm | int | +| `"glitchCounter"` | | int | | Tag key | Value | | --------------------- | --------------------- | @@ -671,6 +672,9 @@ metric format for the CRORC and the CRU is different, as different parameters ar | `tags::Key::ID` | ID of the link | | `tags::Key::Type` | `tags::Value::CRU` | + +NB: For link 15 (User Logic), when enabled, the list of values exported is a subset of the metrics above: `"orbitSor"`. + Logging ------------------- Logging is achieved through the use of the [InfoLogger](https://github.com/AliceO2Group/InfoLogger) library. diff --git a/doc/releaseNotes.md b/doc/releaseNotes.md index 7d2adea6..1580f1b3 100644 --- a/doc/releaseNotes.md +++ b/doc/releaseNotes.md @@ -44,5 +44,7 @@ This file describes the main feature changes for released versions of ReadoutCar ## v0.42.3 - 28/04/2023 - Fix for roc-status --monitoring: glitchCounter unsigned. -## next version -- Added some (per link) counters for roc-status --monitoring: pktProcessed, pktErrorProtocol, pktErrorCheck1, pktErrorCheck2, pktErrorOversize, orbitSor +## v0.43.0 - 24/05/2023 +- Added some counters for roc-status: + - link (with --monitoring option only): pktProcessed, pktErrorProtocol, pktErrorCheck1, pktErrorCheck2, pktErrorOversize, orbitSor (including for UL link 15) + - onu (with --onu option, all output modes, including --monitoring): glitchCounter diff --git a/src/CommandLineUtilities/ProgramStatus.cxx b/src/CommandLineUtilities/ProgramStatus.cxx index 4966a3d8..6674f376 100644 --- a/src/CommandLineUtilities/ProgramStatus.cxx +++ b/src/CommandLineUtilities/ProgramStatus.cxx @@ -285,6 +285,7 @@ class ProgramStatus : public Program .addValue(onuStatus.mgtRxPllLocked, "mgtRxPllLocked") .addValue(onuStatus.ponQualityStatus, "ponQualityStatus") .addValue(onuStatus.ponRxPower, "ponRxPower") + .addValue((uint64_t)onuStatus.glitchCounter, "glitchCounter") .addTag(tags::Key::SerialId, card.serialId.getSerial()) .addTag(tags::Key::Endpoint, card.serialId.getEndpoint()) .addTag(tags::Key::ID, card.sequenceId) @@ -303,9 +304,10 @@ class ProgramStatus : public Program root.put("ONU MGT RX ready", onuStatus.mgtRxReady); root.put("ONU MGT TX PLL locked", onuStatus.mgtTxPllLocked); root.put("ONU MGT RX PLL locked", onuStatus.mgtRxPllLocked); - root.put("PON quality", Utilities::toHexString(onuStatus.ponQuality)); - root.put("PON quality Status", ponQualityStatusStr); - root.put("PON RX power (dBm)", onuStatus.ponRxPower); + root.put("ONU PON quality", Utilities::toHexString(onuStatus.ponQuality)); + root.put("ONU PON quality Status", ponQualityStatusStr); + root.put("ONU PON RX power (dBm)", onuStatus.ponRxPower); + root.put("ONU glitch counter", onuStatus.glitchCounter); } else { std::cout << "=============================" << std::endl; std::cout << "ONU downstream status: \t" << onuDownstreamStatus << std::endl; @@ -322,9 +324,10 @@ class ProgramStatus : public Program std::cout << "ONU MGT RX ready: \t" << std::boolalpha << onuStatus.mgtRxReady << std::endl; std::cout << "ONU MGT TX PLL locked: \t" << std::boolalpha << onuStatus.mgtTxPllLocked << std::endl; std::cout << "ONU MGT RX PLL locked: \t" << std::boolalpha << onuStatus.mgtRxPllLocked << std::endl; - std::cout << "PON quality: \t\t0x" << std::hex << onuStatus.ponQuality << std::endl; - std::cout << "PON quality status: \t" << ponQualityStatusStr << std::endl; - std::cout << "PON RX power (dBm): \t" << onuStatus.ponRxPower << std::endl; + std::cout << "ONU PON quality: \t\t0x" << std::hex << onuStatus.ponQuality << std::endl; + std::cout << "ONU PON quality status: \t" << ponQualityStatusStr << std::endl; + std::cout << "ONU PON RX power (dBm): \t" << onuStatus.ponRxPower << std::endl; + std::cout << "ONU glitch counter: \t" << onuStatus.glitchCounter << std::endl; } } @@ -466,6 +469,20 @@ class ProgramStatus : public Program table << format; } } + + /* PARAMETERS FOR USER LOGIC */ + if (reportInfo.userLogicEnabled) { + if (mOptions.monitoring) { + monitoring->send(Metric{ "link" } + .addValue((uint64_t)reportInfo.userLogicOrbitSor, "orbitSor") + .addTag(tags::Key::SerialId, card.serialId.getSerial()) + .addTag(tags::Key::Endpoint, card.serialId.getEndpoint()) + .addTag(tags::Key::CRU, card.sequenceId) + .addTag(tags::Key::ID, reportInfo.userLogicLinkId) + .addTag(tags::Key::Type, tags::Value::CRU)); + } + } + } else { std::cout << "Invalid card type" << std::endl; return; diff --git a/src/Cru/Common.h b/src/Cru/Common.h index 6f617666..a6ab671c 100644 --- a/src/Cru/Common.h +++ b/src/Cru/Common.h @@ -120,6 +120,8 @@ struct ReportInfo { uint32_t triggerWindowSize; bool gbtEnabled; bool userLogicEnabled; + uint32_t userLogicLinkId; + uint32_t userLogicOrbitSor; bool runStatsEnabled; bool userAndCommonLogicEnabled; uint16_t timeFrameLength; @@ -147,6 +149,7 @@ struct OnuStatus { uint32_t ponQuality; int ponQualityStatus; double ponRxPower; + uint32_t glitchCounter; }; struct FecStatus { diff --git a/src/Cru/Constants.h b/src/Cru/Constants.h index 147a3b18..a3f95fe0 100644 --- a/src/Cru/Constants.h +++ b/src/Cru/Constants.h @@ -201,6 +201,7 @@ static constexpr uint32_t DATA_MIDTRG(0x2);*/ /// Registers for getting TTC info static constexpr Register TTC_ONU_STICKY(0x00200014); static constexpr Register TTC_ONU_STICKY_MON(0x00200014); +static constexpr Register TTC_ONU_GLITCH_COUNTER(0x00200020); static constexpr Register TTC_PON_QUALITY(0x0010000C); /// Registers used for TTC calibration diff --git a/src/Cru/CruBar.cxx b/src/Cru/CruBar.cxx index 2d1cd28f..4b3d52e9 100644 --- a/src/Cru/CruBar.cxx +++ b/src/Cru/CruBar.cxx @@ -545,10 +545,12 @@ Cru::ReportInfo CruBar::report(bool forConfig) bool dynamicOffset = datapathWrapper.getDynamicOffsetEnabled(mEndpoint); uint32_t triggerWindowSize = datapathWrapper.getTriggerWindowSize(mEndpoint); + uint32_t userLogicLinkId = 15; Link userLogicLink; userLogicLink.dwrapper = mEndpoint; - userLogicLink.dwrapperId = 15; + userLogicLink.dwrapperId = userLogicLinkId; bool userLogicEnabled = datapathWrapper.isLinkEnabled(userLogicLink); + uint32_t userLogicOrbitSor = datapathWrapper.getLinkRegister(userLogicLink, Cru::Registers::DATALINK_ORBIT_SOR); Link runStatsLink; runStatsLink.dwrapper = mEndpoint; @@ -560,22 +562,23 @@ Cru::ReportInfo CruBar::report(bool forConfig) bool dmaStatus = getDmaStatus(); - Cru::ReportInfo reportInfo = { - linkMap, - clock, - downstreamData, - ponStatusRegister, - onuAddress, - cruId, - dynamicOffset, - triggerWindowSize, - gbtEnabled, - userLogicEnabled, - runStatsEnabled, - userAndCommonLogicEnabled, - timeFrameLength, - dmaStatus - }; + Cru::ReportInfo reportInfo; + reportInfo.linkMap = linkMap; + reportInfo.ttcClock = clock; + reportInfo.downstreamData = downstreamData; + reportInfo.ponStatusRegister = ponStatusRegister; + reportInfo.onuAddress = onuAddress; + reportInfo.cruId = cruId; + reportInfo.dynamicOffset = dynamicOffset; + reportInfo.triggerWindowSize = triggerWindowSize; + reportInfo.gbtEnabled = gbtEnabled; + reportInfo.userLogicEnabled = userLogicEnabled; + reportInfo.userLogicLinkId = userLogicLinkId; + reportInfo.userLogicOrbitSor = userLogicOrbitSor; + reportInfo.runStatsEnabled = runStatsEnabled; + reportInfo.userAndCommonLogicEnabled = userAndCommonLogicEnabled; + reportInfo.timeFrameLength = timeFrameLength; + reportInfo.dmaStatus = dmaStatus; return reportInfo; } diff --git a/src/Cru/Ttc.cxx b/src/Cru/Ttc.cxx index 45876556..261eaa3c 100644 --- a/src/Cru/Ttc.cxx +++ b/src/Cru/Ttc.cxx @@ -193,6 +193,7 @@ OnuStatus Ttc::onuStatus(bool monitoring) { uint32_t calStatus = mBar->readRegister(Cru::Registers::ONU_USER_LOGIC.index + 0xc / 4); uint32_t onuAddress = mBar->readRegister(Cru::Registers::ONU_USER_LOGIC.index) >> 1; + uint32_t onuGlitchCounter = mBar->readRegister(Cru::Registers::TTC_ONU_GLITCH_COUNTER.index); return { onuAddress, @@ -207,7 +208,8 @@ OnuStatus Ttc::onuStatus(bool monitoring) getOnuStickyStatus(monitoring), getPonQuality(), getPonQualityStatus(), - getPonRxPower() + getPonRxPower(), + onuGlitchCounter, }; } diff --git a/src/ReadoutCardVersion.cxx b/src/ReadoutCardVersion.cxx index 8694dafb..53ae036c 100644 --- a/src/ReadoutCardVersion.cxx +++ b/src/ReadoutCardVersion.cxx @@ -11,7 +11,7 @@ #include "ReadoutCard/Version.h" -#define O2_READOUTCARD_VERSION "0.42.3" +#define O2_READOUTCARD_VERSION "0.43.0" namespace o2 {