Skip to content

Commit 6bce687

Browse files
committed
[cru] Improve roc-config logging verbosity
1 parent 9965909 commit 6bce687

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

src/CommandLineUtilities/ProgramConfig.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ class ProgramConfig : public Program
241241
return;
242242
}
243243

244-
Logger::get() << "Configuring with command line arguments" << LogDebugOps << endm;
244+
Logger::get() << "Configuring card " << cardId << " with command line arguments" << LogDebugOps << endm;
245245
try {
246246
CardConfigurator(params, mOptions.forceConfig);
247247
} catch (const std::runtime_error& e) {
@@ -252,7 +252,7 @@ class ProgramConfig : public Program
252252
throw;
253253
}
254254
} else {
255-
Logger::get() << "Configuring with config uri" << LogDebugOps << endm;
255+
Logger::get() << "Configuring card " << cardId << " with config uri: " << mOptions.configUri << LogDebugOps << endm;
256256
try {
257257
CardConfigurator(cardId, mOptions.configUri, mOptions.forceConfig);
258258
} catch (const std::runtime_error& e) {

src/Cru/CruBar.cxx

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -737,10 +737,9 @@ void CruBar::configure(bool force)
737737

738738
/* TTC */
739739
if (static_cast<uint32_t>(mClock) != reportInfo.ttcClock /*|| !checkClockConsistent(reportInfo.linkMap)*/ || force) {
740-
log("Setting the clock", LogInfoDevel);
740+
log("Setting the clock to " + Clock::toString(mClock), LogInfoDevel);
741741
ttc.setClock(mClock);
742742

743-
log("Calibrating TTC", LogInfoDevel);
744743
if (mClock == Clock::Ttc) {
745744
ttc.calibrateTtc();
746745

@@ -753,7 +752,6 @@ void CruBar::configure(bool force)
753752
}
754753

755754
if (mGbtEnabled /*|| !checkClockConsistent(reportInfo.linkMap)*/) {
756-
log("Calibrating the fPLLs", LogInfoDevel);
757755
Gbt gbt = Gbt(mPdaBar, mLinkMap, mWrapperCount, mEndpoint);
758756
gbt.calibrateGbt(mLinkMap);
759757
Cru::fpllref(mLinkMap, mPdaBar, 2);
@@ -763,7 +761,7 @@ void CruBar::configure(bool force)
763761
}
764762

765763
if (static_cast<uint32_t>(mDownstreamData) != reportInfo.downstreamData || force) {
766-
log("Setting downstream data", LogInfoDevel);
764+
log("Setting downstream data: " + DownstreamData::toString(mDownstreamData), LogInfoDevel);
767765
ttc.selectDownstreamData(mDownstreamData);
768766
}
769767

@@ -785,7 +783,10 @@ void CruBar::configure(bool force)
785783
//datapathWrapper.setLinksEnabled(0, 0x0);
786784
//datapathWrapper.setLinksEnabled(1, 0x0);
787785

788-
log("Enabling links and setting datapath mode and flow control", LogInfoDevel);
786+
log("System ID: " + Utilities::toHexString(mSystemId), LogInfoDevel);
787+
log("Allow rejection enabled: " + Utilities::toBoolString(mAllowRejection), LogInfoDevel);
788+
log("DatapathMode: " + DatapathMode::toString(mDatapathMode), LogInfoDevel);
789+
log("Enabling links:", LogInfoDevel);
789790
for (auto const& el : mLinkMap) {
790791
auto& link = el.second;
791792
auto& linkPrevState = reportInfo.linkMap.at(el.first);
@@ -805,47 +806,52 @@ void CruBar::configure(bool force)
805806
datapathWrapper.setFlowControl(link.dwrapper, mAllowRejection); //Set flow control anyway as it's per dwrapper
806807
datapathWrapper.setSystemId(link, mSystemId);
807808
datapathWrapper.setFeeId(link, link.feeId);
809+
if (link.enabled) {
810+
std::stringstream linkLog;
811+
linkLog << "Link #" << el.first << " | GBT MUX: " << GbtMux::toString(link.gbtMux) << " | FEE ID: " << Utilities::toHexString(link.feeId);
812+
log(linkLog.str(), LogInfoDevel);
813+
}
808814
}
809815
}
810816

811817
/* USER LOGIC */
812818
if (mUserLogicEnabled != reportInfo.userLogicEnabled || force) {
813-
log("Toggling the User Logic link", LogInfoDevel);
819+
log("User Logic enabled: " + Utilities::toBoolString(mUserLogicEnabled), LogInfoDevel);
814820
toggleUserLogicLink(mUserLogicEnabled);
815821
}
816822

817823
/* RUN STATS */
818824
if (mRunStatsEnabled != reportInfo.runStatsEnabled || force) {
819-
log("Toggling the Run Statistics link", LogInfoDevel);
825+
log("Run Statistics link enabled: " + Utilities::toBoolString(mRunStatsEnabled), LogInfoDevel);
820826
toggleRunStatsLink(mRunStatsEnabled);
821827
}
822828

823829
setVirtualLinksIds(mSystemId);
824830

825831
/* UL + CL */
826832
if (mUserAndCommonLogicEnabled != reportInfo.userAndCommonLogicEnabled || force) {
827-
log("Toggling User and Common Logic", LogInfoDevel);
833+
log("User and Common Logic enabled: " + Utilities::toBoolString(mUserAndCommonLogicEnabled), LogInfoDevel);
828834
datapathWrapper.toggleUserAndCommonLogic(mUserAndCommonLogicEnabled, mEndpoint);
829835
}
830836

831837
/* BSP */
832838
if (mCruId != reportInfo.cruId || force) {
833-
log("Setting the CRU ID", LogInfoDevel);
839+
log("Setting the CRU ID: " + Utilities::toHexString(mCruId), LogInfoDevel);
834840
setCruId(mCruId);
835841
}
836842

837843
if (mTriggerWindowSize != reportInfo.triggerWindowSize || force) {
838-
log("Setting trigger window size", LogInfoDevel);
844+
log("Setting trigger window size: " + std::to_string(mTriggerWindowSize), LogInfoDevel);
839845
datapathWrapper.setTriggerWindowSize(mEndpoint, mTriggerWindowSize);
840846
}
841847

842848
if (mDynamicOffset != reportInfo.dynamicOffset || force) {
843-
log("Toggling fixed/dynamic offset", LogInfoDevel);
849+
log("Dynamic offset enabled: " + Utilities::toBoolString(mDynamicOffset), LogInfoDevel);
844850
datapathWrapper.setDynamicOffset(mEndpoint, mDynamicOffset);
845851
}
846852

847853
if (mTimeFrameLength != reportInfo.timeFrameLength || force) {
848-
log("Setting Time Frame length", LogInfoDevel);
854+
log("Setting Time Frame length: " + std::to_string(mTimeFrameLength), LogInfoDevel);
849855
setTimeFrameLength(mTimeFrameLength);
850856
}
851857

0 commit comments

Comments
 (0)