34GBTLink::GBTLink(uint16_t _cru, uint16_t _fee, uint8_t _ep, uint8_t _idInCru, uint16_t _chan) : idInCRU(_idInCru), cruID(_cru), feeID(_fee), endPointID(_ep),
channelID(_chan)
44 std::string ss = fmt::format(
"link cruID:{:#06x}/lID{} feeID:{:#06x}",
cruID,
int(
idInCRU),
feeID);
46 ss += fmt::format(
" lanes {}", std::bitset<28>(
lanes).to_string());
81void GBTLink::printTrigger(
const GBTTrigger* gbtTrg,
int offs)
84 LOG(info) <<
"Offs: " << offs <<
" Trigger : Orbit " << gbtTrg->
orbit <<
" BC: " << gbtTrg->
bc <<
" Trigger: " << trb <<
" noData:"
90void GBTLink::printCalibrationWord(
const GBTCalibration* gbtCal,
int offs)
92 LOGP(info,
"Offs: {} Calibration word {:5} | user_data {:#08x} on {}", offs, gbtCal->calibCounter, gbtCal->calibUserField,
describe());
100 LOG(info) <<
"Offs: " << offs <<
" Header : Active Lanes " << LA <<
" on " <<
describe();
108 LOG(info) <<
"Offs: " << offs <<
" HeaderL : Active Lanes " << LA <<
" on " <<
describe();
116 LOG(info) <<
"Offs: " << offs <<
" Trailer: Done=" << gbtT->
packetDone <<
" Lanes TO: " << LT <<
" | Lanes ST: " << LS <<
" on " <<
describe();
121void GBTLink::printDiagnostic(
const GBTDiagnostic* gbtD,
int offs)
123 LOG(info) <<
"Offs: " << offs <<
" Diagnostic word on " <<
describe();
130 LOGP(info,
"Diagnostic for {} Lane {} | errorID: {} data {:#018x} on {}", gbtD->
isIB() ?
"IB" :
"OB", gbtD->getCableID(), gbtD->laneErrorID, gbtD->diagnosticData,
describe());
137 LOGP(info,
"Status data, not processed at the moment, on {}",
describe());
143#ifdef _RAW_READER_ERROR_CHECKS_
147uint8_t GBTLink::checkErrorsRDH(
const RDH& rdh)
183uint8_t GBTLink::checkErrorsAlignmentPadding()
202uint8_t GBTLink::checkErrorsRDHStop(
const RDH& rdh)
205 if (
lastRDH && RDHUtils::getHeartBeatOrbit(*
lastRDH) != RDHUtils::getHeartBeatOrbit(rdh)
206 && !RDHUtils::getStop(*
lastRDH)) {
223uint8_t GBTLink::checkErrorsRDHStopPageEmpty(
const RDH& rdh)
226 if (RDHUtils::getStop(rdh) && RDHUtils::getMemorySize(rdh) !=
sizeof(
RDH) +
wordLength) {
303 int cnt = RDHUtils::getPageCounter(*
lastRDH);
310 << gbtH->
packetIdx <<
" and RDH page " << cnt <<
" counters";
325 <<
": Non-0 page counter (" << cnt <<
") while all lanes were stopped";
337uint8_t GBTLink::checkErrorsActiveLanes(
int cbl)
346 << gotL <<
" vs " << expectL <<
" skip page";
357uint8_t GBTLink::checkErrorsGBTData(
int cablePos)
441uint8_t GBTLink::checkErrorsLanesStops()
452 <<
" | active: " <<
active <<
" stopped: " << stopped;
466 <<
" | with data: " << withData <<
" active: " <<
active <<
" timeOut: " << timeOut;
496uint8_t GBTLink::checkErrorsCableID(
const GBTData* gbtD, uint8_t cableSW)
499 if (cableSW == 0xff) {
515uint8_t GBTLink::checkErrorsIRNotExtracted()
class for the ALPIDE data decoding/encoding
Definition of the 32 Central Trigger System (CTS) Trigger Types defined in https://twiki....
Declarations of helper classes for the ITS/MFT raw data decoding.
uint8_t itsSharedClusterMap uint8_t
static int getCableID(uint8_t v)
@ ErrGBTWordNotRecognized
@ ErrMissingDiagnosticWord
@ ErrNonZeroPageAfterStop
static constexpr std::array< std::string_view, NErrorsDefined > ErrNames
std::array< uint32_t, NErrorsDefined > errorCounts
CollectedDataStatus status
bool needToPrintError(uint32_t count)
static constexpr int CRUPageAlignment
std::string describe() const
void accountLinkRecovery(o2::InteractionRecord ir)
GBTLinkDecodingStat statistics
void clear(bool resetStat=true, bool resetTFRaw=false)
CollectedDataStatus statusInTF
std::vector< PhysTrigger > * extTrigVec
o2::InteractionRecord irHBF
uint64_t continuation
13 No data expected (too close to previous trigger or error)
uint64_t activeLanesL
0:15 Index of Data Packet within trigger
uint64_t lanesTimeout
0:27 Bit map of “Valid Lane stops received”, 1 bit per lane, NOT USED
uint64_t noData
12 Used in Continuous Mode for internally generated trigger
uint64_t internal
0:11 12 lowest bits of trigger type received from CTP
uint64_t orbit
28:31 reserved
bool isTriggerWord() const
check if the GBT Header corresponds to GBT trigger word
void printX(bool padded=true, std::string com="") const
bool isDataHeader() const
check if the GBT Header corresponds to GBT payload header
bool isDataTrailer() const
check if the GBT Header corresponds to GBT payload trailer
bool isDiagnosticWord() const
check if the GBT Header corresponds to Diagnostic data
bool isCableDiagnostic() const
bool isData() const
check if the GBT Header corresponds to ITS IB or OB data (header is combined with lanes/connector inf...
uint64_t packetDone
56:63 reserved
static void printRDH(const RDHv4 &rdh)
static bool checkRDH(const RDHv4 &rdh, bool verbose=true, bool checkZeros=false)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
o2::InteractionRecord ir(0, 0)