Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
| --------------------- | --------------------- |
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 4 additions & 2 deletions doc/releaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
29 changes: 23 additions & 6 deletions src/CommandLineUtilities/ProgramStatus.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;
Expand All @@ -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;
}
}

Expand Down Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions src/Cru/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -147,6 +149,7 @@ struct OnuStatus {
uint32_t ponQuality;
int ponQualityStatus;
double ponRxPower;
uint32_t glitchCounter;
};

struct FecStatus {
Expand Down
1 change: 1 addition & 0 deletions src/Cru/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
37 changes: 20 additions & 17 deletions src/Cru/CruBar.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down
4 changes: 3 additions & 1 deletion src/Cru/Ttc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -207,7 +208,8 @@ OnuStatus Ttc::onuStatus(bool monitoring)
getOnuStickyStatus(monitoring),
getPonQuality(),
getPonQualityStatus(),
getPonRxPower()
getPonRxPower(),
onuGlitchCounter,
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/ReadoutCardVersion.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include "ReadoutCard/Version.h"

#define O2_READOUTCARD_VERSION "0.42.3"
#define O2_READOUTCARD_VERSION "0.43.0"

namespace o2
{
Expand Down