Skip to content

Commit 45b7aca

Browse files
committed
added roc-status onu glitch counter
1 parent 3b98562 commit 45b7aca

File tree

6 files changed

+12
-2
lines changed

6 files changed

+12
-2
lines changed

README.md

Lines changed: 1 addition & 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
| --------------------- | --------------------- |

doc/releaseNotes.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,6 @@ This file describes the main feature changes for released versions of ReadoutCar
4545
- Fix for roc-status --monitoring: glitchCounter unsigned.
4646

4747
## next version
48-
- Added some (per link) counters for roc-status --monitoring: pktProcessed, pktErrorProtocol, pktErrorCheck1, pktErrorCheck2, pktErrorOversize, orbitSor
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: 3 additions & 0 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)
@@ -306,6 +307,7 @@ class ProgramStatus : public Program
306307
root.put("PON quality", Utilities::toHexString(onuStatus.ponQuality));
307308
root.put("PON quality Status", ponQualityStatusStr);
308309
root.put("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;
@@ -325,6 +327,7 @@ class ProgramStatus : public Program
325327
std::cout << "PON quality: \t\t0x" << std::hex << onuStatus.ponQuality << std::endl;
326328
std::cout << "PON quality status: \t" << ponQualityStatusStr << std::endl;
327329
std::cout << "PON RX power (dBm): \t" << onuStatus.ponRxPower << std::endl;
330+
std::cout << "ONU glitch counter: \t" << onuStatus.glitchCounter << std::endl;
328331
}
329332
}
330333

src/Cru/Common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ struct OnuStatus {
149149
uint32_t ponQuality;
150150
int ponQualityStatus;
151151
double ponRxPower;
152+
uint32_t glitchCounter;
152153
};
153154

154155
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/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

0 commit comments

Comments
 (0)