diff --git a/src/Cru/CruBar.cxx b/src/Cru/CruBar.cxx index 50b10de3..1f55fd4a 100644 --- a/src/Cru/CruBar.cxx +++ b/src/Cru/CruBar.cxx @@ -168,6 +168,18 @@ uint32_t CruBar::getSuperpageSize(uint32_t link) superpageSizeIndex = Utilities::getBits(superpageSizeFifo, 24, 31); } + uint32_t superpageSizeFifoCopy = readRegister(Cru::Registers::LINK_SUPERPAGE_SIZE.get(link).index); + uint32_t superpageSizeCopy = Utilities::getBits(superpageSizeFifoCopy, 0, 23); + if (superpageSizeCopy != superpageSize) { + log("superpageSize inconsistent: 1st read = " + std::to_string(superpageSize) + " != " + std::to_string(superpageSizeCopy) + "2nd read", LogWarningDevel_(4600)); + log("superpageSizeIndex = " + std::to_string(superpageSizeIndex) + ", mSuperpageSizeIndexCounter[ " + std::to_string(link) + "] = " + std::to_string(mSuperpageSizeIndexCounter[link]), LogWarningDevel_(4600)); + } + uint32_t superpageSizeFifoCopy2 = readRegister(Cru::Registers::LINK_SUPERPAGE_SIZE.get(link).index); + uint32_t superpageSizeCopy2 = Utilities::getBits(superpageSizeFifoCopy2, 0, 23); + if (superpageSizeCopy2 != superpageSizeCopy) { + log("superpageSize inconsistent: 2nd read = " + std::to_string(superpageSizeCopy) + " != " + std::to_string(superpageSizeCopy2) + "3rd read", LogWarningDevel_(4600)); + } + mSuperpageSizeIndexCounter[link] = (superpageSizeIndex + 1) % 256; return superpageSize;