Skip to content

Commit

Permalink
- update printout
Browse files Browse the repository at this point in the history
  • Loading branch information
murat committed Jan 5, 2025
1 parent 5dd4950 commit 8326658
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 107 deletions.
14 changes: 8 additions & 6 deletions otsdaq-mu2e-tracker/Ui/DtcInterface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,11 @@ namespace trkdaq {
//-----------------------------------------------------------------------------
int DtcInterface::InitExternalCFOReadoutMode(int SampleEdgeMode) {
int rc(0);
TLOG(TLVL_DEBUG) << Form("START SampleEdgeMode=%i\n",fSampleEdgeMode);

if (SampleEdgeMode != -1) fSampleEdgeMode = SampleEdgeMode;

TLOG(TLVL_DEBUG) << "START .. PCIE addr:" << fPcieAddr << " SampleEdgeMode:" << fSampleEdgeMode;

// this one doesn't take DTC_Link_ALL gently
for (int i=0; i<6; i++) {
fDtc->DisableLink(DTC_Link_ID(i),DTC_LinkEnableMode(true,true));
Expand Down Expand Up @@ -263,7 +264,7 @@ namespace trkdaq {

fDtc->EnableReceiveCFOLink (); // r_0x9114:bit_14 = 1

TLOG(TLVL_DEBUG) << Form("END\n");
TLOG(TLVL_DEBUG) << "END PCIE addr:" << fPcieAddr;
return rc;
}

Expand All @@ -276,7 +277,8 @@ namespace trkdaq {
if (EmulateCfo != -1) fEmulateCfo = EmulateCfo;
if (RocReadoutMode != -1) fRocReadoutMode = RocReadoutMode;

TLOG(TLVL_DEBUG) << "START : Emulates CFO=" << fEmulateCfo << " ROC ReadoutMode:" << fRocReadoutMode << std::endl;
TLOG(TLVL_DEBUG) << "START : PCIE addr:" << fPcieAddr << " Emulates CFO=" << fEmulateCfo
<< " ROC ReadoutMode:" << fRocReadoutMode;
//-----------------------------------------------------------------------------
// both emulated and external modes perform soft reset of the DTC
//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -307,7 +309,7 @@ namespace trkdaq {
InitRocReadoutMode();
fDtc->ReleaseAllBuffers(DTC_DMA_Engine_DAQ);

TLOG(TLVL_DEBUG) << "END" << std::endl;
TLOG(TLVL_DEBUG) << "PCIE addr:" << fPcieAddr << " END" << std::endl;
return rc;
}

Expand Down Expand Up @@ -461,13 +463,13 @@ namespace trkdaq {

uint16_t u;
while ((u = fDtc->ReadROCRegister(rlink,128,100)) == 0) {};
TLOG(TLVL_DEBUG) << Form("reg:%03i val:0x%04x\n",128,u);
TLOG(TLVL_DEBUG+1) << Form("reg:%03i val:0x%04x\n",128,u);
//-----------------------------------------------------------------------------
// register 129: number of words to read, currently- (+ 4) (ask Monica)
// 2024-05-10: is r129 now returning the number of bytes ?
//-----------------------------------------------------------------------------
int nb = fDtc->ReadROCRegister(rlink,129,100);
TLOG(TLVL_DEBUG) << Form("reg:%03i val:0x%04x\n",129,nb);
TLOG(TLVL_DEBUG+1) << Form("reg:%03i val:0x%04x\n",129,nb);

int nw = nb-4;

Expand Down
19 changes: 11 additions & 8 deletions otsdaq-mu2e-tracker/Ui/DtcInterface.hh
Original file line number Diff line number Diff line change
Expand Up @@ -134,21 +134,24 @@ namespace trkdaq {
int GetLinkMask() { return fLinkMask; }
//-----------------------------------------------------------------------------
// assume that to be printed are 'nw' uint16_t words , in hex
// if Stream == nullptr, PrintBuffer uses TRACE's TLOG
//-----------------------------------------------------------------------------
void PrintBuffer (const void* ptr, int nw);
void PrintFireflyTemp();
void PrintBuffer (const void* ptr, int nw, std::ostream* Stream = nullptr);

void PrintDtcLinkRegisters(uint FirstReg, const char* Desc);
void PrintRegister (uint16_t Register, const char* Title = "");
void PrintFireflyTemp(std::ostream& Stream = std::cout);

void PrintDtcLinkRegisters(uint FirstReg, const char* Desc, std::ostream& Stream = std::cout);
void PrintRegister (uint16_t Register, const char* Title = "",
std::ostream& Stream = std::cout);
//-----------------------------------------------------------------------------
// Format = 0 : for each register, print a register and its value
// Format = 1 : add short description of each register
// if Link = -1, print a line per register for each ROC
//-----------------------------------------------------------------------------
void PrintRocRegister (uint Reg, std::string& Desc, int Format = 1, int LinkMask = -1);
void PrintRocRegister2(uint Reg, std::string& Desc, int Format = 1, int LinkMask = -1);
void PrintRocStatus (int Format = 1, int LinkMask = -1);
void PrintStatus ();
void PrintRocRegister (uint Reg, std::string& Desc, int Format = 1, int LinkMask = -1, std::ostream& Stream = std::cout);
void PrintRocRegister2(uint Reg, std::string& Desc, int Format = 1, int LinkMask = -1, std::ostream& Stream = std::cout);
void PrintRocStatus (int Format = 1, int LinkMask = -1, std::ostream& Stream = std::cout);
void PrintStatus (std::ostream& Stream = std::cout);

uint32_t ReadRegister (uint16_t Register);

Expand Down
Loading

0 comments on commit 8326658

Please sign in to comment.