Skip to content

Commit b705394

Browse files
committed
[crorc] Add pushed Superpage counter check function
1 parent 9be411d commit b705394

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

src/Crorc/CrorcBar.cxx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,5 +404,21 @@ Crorc::PacketMonitoringInfo CrorcBar::monitorPackets()
404404
return { acquisitionRate, packetsReceived };
405405
}
406406

407+
bool CrorcBar::isASuperpageAvailable()
408+
{
409+
static uint32_t previousAvailable = 0x0;
410+
uint32_t currentAvailable = readRegister(0x30 / 4);
411+
uint32_t diff;
412+
if (currentAvailable < previousAvailable) { // warped
413+
diff = (0x100000000 - 0xffffffff) + currentAvailable;
414+
} else {
415+
diff = currentAvailable - previousAvailable;
416+
}
417+
418+
previousAvailable = currentAvailable;
419+
420+
return diff > 0;
421+
}
422+
407423
} // namespace roc
408424
} // namespace o2

src/Crorc/CrorcBar.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ class CrorcBar final : public BarInterfaceBase
6969
void setSiuLoopback();
7070
Crorc::PacketMonitoringInfo monitorPackets();
7171

72+
bool isASuperpageAvailable();
73+
7274
private:
7375
std::map<int, Crorc::Link> initializeLinkMap();
7476

src/Crorc/CrorcDmaChannel.cxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@ void CrorcDmaChannel::fillSuperpages()
299299

300300
while (mFreeFifoSize > 0) {
301301
if (isArrived(mFreeFifoBack)) {
302-
//size_t superpageFilled = SUPERPAGE_SIZE; // Get the length before updating our descriptor index
303302
size_t superpageFilled = getLength(mFreeFifoBack); // Get the length before updating our descriptor index
304303
resetDescriptor(mFreeFifoBack);
305304

0 commit comments

Comments
 (0)