Skip to content

Commit 5104f2d

Browse files
authored
Merge pull request #413 from sy-c/master
v0.43.0
2 parents 664dc04 + 10a3cae commit 5104f2d

File tree

8 files changed

+59
-27
lines changed

8 files changed

+59
-27
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,7 @@ metric format for the CRORC and the CRU is different, as different parameters ar
611611
| `"mgtRxPllLocked"` | 0/1 (False/True) | int |
612612
| `"ponQualityStatus"` | 0/1 (Bad/Good) | int |
613613
| `"ponRxPower"` | dBm | int |
614+
| `"glitchCounter"` | | int |
614615
615616
| Tag key | Value |
616617
| --------------------- | --------------------- |
@@ -671,6 +672,9 @@ metric format for the CRORC and the CRU is different, as different parameters ar
671672
| `tags::Key::ID` | ID of the link |
672673
| `tags::Key::Type` | `tags::Value::CRU` |
673674
675+
676+
NB: For link 15 (User Logic), when enabled, the list of values exported is a subset of the metrics above: `"orbitSor"`.
677+
674678
Logging
675679
-------------------
676680
Logging is achieved through the use of the [InfoLogger](https://github.com/AliceO2Group/InfoLogger) library.

doc/releaseNotes.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,7 @@ This file describes the main feature changes for released versions of ReadoutCar
4444
## v0.42.3 - 28/04/2023
4545
- Fix for roc-status --monitoring: glitchCounter unsigned.
4646

47-
## next version
48-
- Added some (per link) counters for roc-status --monitoring: pktProcessed, pktErrorProtocol, pktErrorCheck1, pktErrorCheck2, pktErrorOversize, orbitSor
47+
## v0.43.0 - 24/05/2023
48+
- Added some counters for roc-status:
49+
- link (with --monitoring option only): pktProcessed, pktErrorProtocol, pktErrorCheck1, pktErrorCheck2, pktErrorOversize, orbitSor (including for UL link 15)
50+
- onu (with --onu option, all output modes, including --monitoring): glitchCounter

src/CommandLineUtilities/ProgramStatus.cxx

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ class ProgramStatus : public Program
285285
.addValue(onuStatus.mgtRxPllLocked, "mgtRxPllLocked")
286286
.addValue(onuStatus.ponQualityStatus, "ponQualityStatus")
287287
.addValue(onuStatus.ponRxPower, "ponRxPower")
288+
.addValue((uint64_t)onuStatus.glitchCounter, "glitchCounter")
288289
.addTag(tags::Key::SerialId, card.serialId.getSerial())
289290
.addTag(tags::Key::Endpoint, card.serialId.getEndpoint())
290291
.addTag(tags::Key::ID, card.sequenceId)
@@ -303,9 +304,10 @@ class ProgramStatus : public Program
303304
root.put("ONU MGT RX ready", onuStatus.mgtRxReady);
304305
root.put("ONU MGT TX PLL locked", onuStatus.mgtTxPllLocked);
305306
root.put("ONU MGT RX PLL locked", onuStatus.mgtRxPllLocked);
306-
root.put("PON quality", Utilities::toHexString(onuStatus.ponQuality));
307-
root.put("PON quality Status", ponQualityStatusStr);
308-
root.put("PON RX power (dBm)", onuStatus.ponRxPower);
307+
root.put("ONU PON quality", Utilities::toHexString(onuStatus.ponQuality));
308+
root.put("ONU PON quality Status", ponQualityStatusStr);
309+
root.put("ONU PON RX power (dBm)", onuStatus.ponRxPower);
310+
root.put("ONU glitch counter", onuStatus.glitchCounter);
309311
} else {
310312
std::cout << "=============================" << std::endl;
311313
std::cout << "ONU downstream status: \t" << onuDownstreamStatus << std::endl;
@@ -322,9 +324,10 @@ class ProgramStatus : public Program
322324
std::cout << "ONU MGT RX ready: \t" << std::boolalpha << onuStatus.mgtRxReady << std::endl;
323325
std::cout << "ONU MGT TX PLL locked: \t" << std::boolalpha << onuStatus.mgtTxPllLocked << std::endl;
324326
std::cout << "ONU MGT RX PLL locked: \t" << std::boolalpha << onuStatus.mgtRxPllLocked << std::endl;
325-
std::cout << "PON quality: \t\t0x" << std::hex << onuStatus.ponQuality << std::endl;
326-
std::cout << "PON quality status: \t" << ponQualityStatusStr << std::endl;
327-
std::cout << "PON RX power (dBm): \t" << onuStatus.ponRxPower << std::endl;
327+
std::cout << "ONU PON quality: \t\t0x" << std::hex << onuStatus.ponQuality << std::endl;
328+
std::cout << "ONU PON quality status: \t" << ponQualityStatusStr << std::endl;
329+
std::cout << "ONU PON RX power (dBm): \t" << onuStatus.ponRxPower << std::endl;
330+
std::cout << "ONU glitch counter: \t" << onuStatus.glitchCounter << std::endl;
328331
}
329332
}
330333

@@ -466,6 +469,20 @@ class ProgramStatus : public Program
466469
table << format;
467470
}
468471
}
472+
473+
/* PARAMETERS FOR USER LOGIC */
474+
if (reportInfo.userLogicEnabled) {
475+
if (mOptions.monitoring) {
476+
monitoring->send(Metric{ "link" }
477+
.addValue((uint64_t)reportInfo.userLogicOrbitSor, "orbitSor")
478+
.addTag(tags::Key::SerialId, card.serialId.getSerial())
479+
.addTag(tags::Key::Endpoint, card.serialId.getEndpoint())
480+
.addTag(tags::Key::CRU, card.sequenceId)
481+
.addTag(tags::Key::ID, reportInfo.userLogicLinkId)
482+
.addTag(tags::Key::Type, tags::Value::CRU));
483+
}
484+
}
485+
469486
} else {
470487
std::cout << "Invalid card type" << std::endl;
471488
return;

src/Cru/Common.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ struct ReportInfo {
120120
uint32_t triggerWindowSize;
121121
bool gbtEnabled;
122122
bool userLogicEnabled;
123+
uint32_t userLogicLinkId;
124+
uint32_t userLogicOrbitSor;
123125
bool runStatsEnabled;
124126
bool userAndCommonLogicEnabled;
125127
uint16_t timeFrameLength;
@@ -147,6 +149,7 @@ struct OnuStatus {
147149
uint32_t ponQuality;
148150
int ponQualityStatus;
149151
double ponRxPower;
152+
uint32_t glitchCounter;
150153
};
151154

152155
struct FecStatus {

src/Cru/Constants.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ static constexpr uint32_t DATA_MIDTRG(0x2);*/
201201
/// Registers for getting TTC info
202202
static constexpr Register TTC_ONU_STICKY(0x00200014);
203203
static constexpr Register TTC_ONU_STICKY_MON(0x00200014);
204+
static constexpr Register TTC_ONU_GLITCH_COUNTER(0x00200020);
204205
static constexpr Register TTC_PON_QUALITY(0x0010000C);
205206

206207
/// Registers used for TTC calibration

src/Cru/CruBar.cxx

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -545,10 +545,12 @@ Cru::ReportInfo CruBar::report(bool forConfig)
545545
bool dynamicOffset = datapathWrapper.getDynamicOffsetEnabled(mEndpoint);
546546
uint32_t triggerWindowSize = datapathWrapper.getTriggerWindowSize(mEndpoint);
547547

548+
uint32_t userLogicLinkId = 15;
548549
Link userLogicLink;
549550
userLogicLink.dwrapper = mEndpoint;
550-
userLogicLink.dwrapperId = 15;
551+
userLogicLink.dwrapperId = userLogicLinkId;
551552
bool userLogicEnabled = datapathWrapper.isLinkEnabled(userLogicLink);
553+
uint32_t userLogicOrbitSor = datapathWrapper.getLinkRegister(userLogicLink, Cru::Registers::DATALINK_ORBIT_SOR);
552554

553555
Link runStatsLink;
554556
runStatsLink.dwrapper = mEndpoint;
@@ -560,22 +562,23 @@ Cru::ReportInfo CruBar::report(bool forConfig)
560562

561563
bool dmaStatus = getDmaStatus();
562564

563-
Cru::ReportInfo reportInfo = {
564-
linkMap,
565-
clock,
566-
downstreamData,
567-
ponStatusRegister,
568-
onuAddress,
569-
cruId,
570-
dynamicOffset,
571-
triggerWindowSize,
572-
gbtEnabled,
573-
userLogicEnabled,
574-
runStatsEnabled,
575-
userAndCommonLogicEnabled,
576-
timeFrameLength,
577-
dmaStatus
578-
};
565+
Cru::ReportInfo reportInfo;
566+
reportInfo.linkMap = linkMap;
567+
reportInfo.ttcClock = clock;
568+
reportInfo.downstreamData = downstreamData;
569+
reportInfo.ponStatusRegister = ponStatusRegister;
570+
reportInfo.onuAddress = onuAddress;
571+
reportInfo.cruId = cruId;
572+
reportInfo.dynamicOffset = dynamicOffset;
573+
reportInfo.triggerWindowSize = triggerWindowSize;
574+
reportInfo.gbtEnabled = gbtEnabled;
575+
reportInfo.userLogicEnabled = userLogicEnabled;
576+
reportInfo.userLogicLinkId = userLogicLinkId;
577+
reportInfo.userLogicOrbitSor = userLogicOrbitSor;
578+
reportInfo.runStatsEnabled = runStatsEnabled;
579+
reportInfo.userAndCommonLogicEnabled = userAndCommonLogicEnabled;
580+
reportInfo.timeFrameLength = timeFrameLength;
581+
reportInfo.dmaStatus = dmaStatus;
579582

580583
return reportInfo;
581584
}

src/Cru/Ttc.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ OnuStatus Ttc::onuStatus(bool monitoring)
193193
{
194194
uint32_t calStatus = mBar->readRegister(Cru::Registers::ONU_USER_LOGIC.index + 0xc / 4);
195195
uint32_t onuAddress = mBar->readRegister(Cru::Registers::ONU_USER_LOGIC.index) >> 1;
196+
uint32_t onuGlitchCounter = mBar->readRegister(Cru::Registers::TTC_ONU_GLITCH_COUNTER.index);
196197

197198
return {
198199
onuAddress,
@@ -207,7 +208,8 @@ OnuStatus Ttc::onuStatus(bool monitoring)
207208
getOnuStickyStatus(monitoring),
208209
getPonQuality(),
209210
getPonQualityStatus(),
210-
getPonRxPower()
211+
getPonRxPower(),
212+
onuGlitchCounter,
211213
};
212214
}
213215

src/ReadoutCardVersion.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#include "ReadoutCard/Version.h"
1313

14-
#define O2_READOUTCARD_VERSION "0.42.3"
14+
#define O2_READOUTCARD_VERSION "0.43.0"
1515

1616
namespace o2
1717
{

0 commit comments

Comments
 (0)