Skip to content

Commit 165670d

Browse files
committed
fix FEC registers cf ORC-490
1 parent dbea997 commit 165670d

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

doc/releaseNotes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,6 @@ This file describes the main feature changes for released versions of ReadoutCar
6161

6262
## v0.44.2 - 23/06/2023
6363
- Added a workaround to avoid HW lock issues for CRORC: prevent concurrency in the calls to feed superpages to the card. Added a check to detect write discrepencies.
64+
65+
##
66+
- Fix registers for FEC status counters.

src/Cru/Constants.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,9 @@ static constexpr Register CLOCK_PLL_CONTROL_ONU(0x00240018);
215215
static constexpr Register ONU_USER_LOGIC(0x0022a000);
216216

217217
/// Register for getting FEC status
218-
static constexpr Register ONU_FEC_COUNTERS(0x0022200c);
218+
static constexpr Register ONU_FEC_COUNTERS_STATUS(0x0022A004);
219+
static constexpr Register ONU_FEC_COUNTERS_SERR(0x0022A020);
220+
static constexpr Register ONU_FEC_COUNTERS_DERR(0x0022A028);
219221

220222
/// Registers for setting the Ref Gen
221223
static constexpr Register ONU_USER_REFGEN(0x0022c000);

src/Cru/Ttc.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,14 @@ OnuStatus Ttc::onuStatus(bool monitoring)
215215

216216
FecStatus Ttc::fecStatus()
217217
{
218-
uint32_t fecStatus = mBar->readRegister(Cru::Registers::ONU_FEC_COUNTERS.index);
218+
uint32_t fecStatus = mBar->readRegister(Cru::Registers::ONU_FEC_COUNTERS_STATUS.index);
219219
return {
220220
Utilities::getBit(fecStatus, 0) == 1,
221221
Utilities::getBit(fecStatus, 1) == 1,
222-
Utilities::getBit(fecStatus, 7) == 1,
223-
(uint8_t)Utilities::getBits(fecStatus, 8, 15),
224-
(uint8_t)Utilities::getBits(fecStatus, 16, 23),
225-
(uint8_t)Utilities::getBits(fecStatus, 24, 31)
222+
0, // meaningless, kept for compatibility
223+
(uint8_t)mBar->readRegister(Cru::Registers::ONU_FEC_COUNTERS_SERR.index),
224+
(uint8_t)mBar->readRegister(Cru::Registers::ONU_FEC_COUNTERS_DERR.index),
225+
0 // meaningless, kept for compatibility
226226
};
227227
}
228228

0 commit comments

Comments
 (0)