Skip to content

Commit 835429f

Browse files
committed
added DMA status
1 parent 2ddcc02 commit 835429f

File tree

5 files changed

+17
-1
lines changed

5 files changed

+17
-1
lines changed

doc/releaseNotes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ This file describes the main feature changes for released versions of ReadoutCar
2727

2828
## next version
2929
- Added glitchCounter to roc-status (all output styles, including monitoring).
30+
- Added DMA status (enabled / disabled) to roc-status (all output styles, including monitoring).

src/CommandLineUtilities/ProgramStatus.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ class ProgramStatus : public Program
198198
std::string userLogic = (reportInfo.userLogicEnabled ? "Enabled" : "Disabled");
199199
std::string runStats = (reportInfo.runStatsEnabled ? "Enabled" : "Disabled");
200200
std::string userAndCommonLogic = (reportInfo.userAndCommonLogicEnabled ? "Enabled" : "Disabled");
201+
std::string dmaStatus = reportInfo.dmaStatus ? "Enabled" : "Disabled";
201202

202203
/* GENERAL PARAMETERS */
203204
if (mOptions.monitoring) {
@@ -210,6 +211,7 @@ class ProgramStatus : public Program
210211
.addValue(reportInfo.runStatsEnabled, "runStats")
211212
.addValue(reportInfo.userAndCommonLogicEnabled, "userAndCommonLogic")
212213
.addValue(reportInfo.timeFrameLength, "timeFrameLength")
214+
.addValue(reportInfo.dmaStatus, "dmaStatus")
213215
.addTag(tags::Key::SerialId, card.serialId.getSerial())
214216
.addTag(tags::Key::Endpoint, card.serialId.getEndpoint())
215217
.addTag(tags::Key::ID, card.sequenceId)
@@ -225,6 +227,7 @@ class ProgramStatus : public Program
225227
root.put("runStats", runStats);
226228
root.put("userAndCommonLogic", userAndCommonLogic);
227229
root.put("timeFrameLength", reportInfo.timeFrameLength);
230+
root.put("dmaStatus", dmaStatus);
228231
} else {
229232
std::cout << "-----------------------------" << std::endl;
230233
std::cout << "CRU ID: " << reportInfo.cruId << std::endl;
@@ -239,6 +242,7 @@ class ProgramStatus : public Program
239242
if (reportInfo.runStatsEnabled) {
240243
std::cout << "Run statistics enabled" << std::endl;
241244
}
245+
std::cout << "DMA: "<< dmaStatus << std::endl;
242246
}
243247

244248
/* ONU PARAMETERS */

src/Cru/Common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ struct ReportInfo {
116116
bool runStatsEnabled;
117117
bool userAndCommonLogicEnabled;
118118
uint16_t timeFrameLength;
119+
bool dmaStatus;
119120
};
120121

121122
struct OnuStickyStatus {

src/Cru/CruBar.cxx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,12 @@ uint32_t CruBar::getPonStatusRegister()
406406
return readRegister((Cru::Registers::ONU_USER_LOGIC.address + 0x0c) / 4);
407407
}
408408

409+
bool CruBar::getDmaStatus()
410+
{
411+
mPdaBar->assertBarIndex(2, "Can only get DMA status register from BAR 2");
412+
return readRegister(Cru::Registers::BSP_USER_CONTROL.index) & 0x1; // DMA enabled = bit 0
413+
}
414+
409415
uint32_t CruBar::getOnuAddress()
410416
{
411417
mPdaBar->assertBarIndex(2, "Can only get PON status register from BAR 2");
@@ -545,6 +551,8 @@ Cru::ReportInfo CruBar::report(bool forConfig)
545551
bool userAndCommonLogicEnabled = datapathWrapper.getUserAndCommonLogicEnabled(mEndpoint);
546552
uint16_t timeFrameLength = getTimeFrameLength();
547553

554+
bool dmaStatus = getDmaStatus();
555+
548556
Cru::ReportInfo reportInfo = {
549557
linkMap,
550558
clock,
@@ -558,7 +566,8 @@ Cru::ReportInfo CruBar::report(bool forConfig)
558566
userLogicEnabled,
559567
runStatsEnabled,
560568
userAndCommonLogicEnabled,
561-
timeFrameLength
569+
timeFrameLength,
570+
dmaStatus
562571
};
563572

564573
return reportInfo;

src/Cru/CruBar.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ class CruBar final : public BarInterfaceBase
135135
uint32_t getFpgaChipLow();
136136
uint32_t getPonStatusRegister();
137137
uint32_t getOnuAddress();
138+
bool getDmaStatus();
138139
bool checkPonUpstreamStatusExpected(uint32_t ponUpstreamRegister, uint32_t onuAddress);
139140
bool checkClockConsistent(std::map<int, Link> linkMap);
140141
void populateLinkMap(std::map<int, Link>& linkMap);

0 commit comments

Comments
 (0)