This repository has been archived by the owner on Jan 31, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #112 from bdorney/revert-110-feature/link-reset-wait
Bug Fix: Bad Node Names & Hard Coded LMDB Size Limit partially revert #110
- Loading branch information
Showing
2 changed files
with
11 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,15 +4,13 @@ | |
* \author Brian Dorney <[email protected]> | ||
*/ | ||
|
||
#include "daq_monitor.h" | ||
|
||
#include "amc.h" | ||
#include <chrono> | ||
#include <thread> | ||
#include "daq_monitor.h" | ||
#include "hw_constants.h" | ||
#include <string> | ||
|
||
#include "utils.h" | ||
#include "amc.h" | ||
#include "hw_constants.h" | ||
|
||
void getmonTTCmainLocal(localArgs * la) | ||
{ | ||
|
@@ -240,30 +238,29 @@ void getmonGBTLinkLocal(localArgs * la, int NOH, bool doReset) | |
//Reset Requested? | ||
if (doReset) { | ||
writeReg(la, "GEM_AMC.GEM_SYSTEM.CTRL.LINK_RESET", 0x1); | ||
std::this_thread::sleep_for(std::chrono::microseconds(92)); // FIXME sleep for N orbits | ||
} | ||
|
||
std::string regName, respName; //regName used for read/write, respName sets word in RPC response | ||
for (int ohN=0; ohN < NOH; ++ohN) { | ||
for (unsigned int gbtN=0; gbtN < gbt::GBTS_PER_OH; ++gbtN) { | ||
//Ready | ||
respName = stdsprintf("OH%i.GBT%i.READY",ohN,gbtN); | ||
regName = stdsprintf("GEM_AMC.OH_LINKS.%s",respName.c_str()); | ||
regName = stdsprintf("GEM_AMC.OH_LINKS.OH%i.GBT%i_READY",ohN,gbtN); | ||
la->response->set_word(respName,readReg(la, regName)); | ||
|
||
//Was not ready | ||
respName = stdsprintf("OH%i.GBT%i.WAS_NOT_READY",ohN,gbtN); | ||
regName = stdsprintf("GEM_AMC.OH_LINKS.%s",respName.c_str()); | ||
regName = stdsprintf("GEM_AMC.OH_LINKS.OH%i.GBT%i_WAS_NOT_READY",ohN,gbtN); | ||
la->response->set_word(respName,readReg(la, regName)); | ||
|
||
//Rx had overflow | ||
respName = stdsprintf("OH%i.GBT%i.RX_HAD_OVERFLOW",ohN,gbtN); | ||
regName = stdsprintf("GEM_AMC.OH_LINKS.%s",respName.c_str()); | ||
regName = stdsprintf("GEM_AMC.OH_LINKS.OH%i.GBT%i_RX_HAD_OVERFLOW",ohN,gbtN); | ||
la->response->set_word(respName,readReg(la, regName)); | ||
|
||
//Rx had underflow | ||
respName = stdsprintf("OH%i.GBT%i.RX_HAD_UNDERFLOW",ohN,gbtN); | ||
regName = stdsprintf("GEM_AMC.OH_LINKS.%s",respName.c_str()); | ||
regName = stdsprintf("GEM_AMC.OH_LINKS.OH%i.GBT%i_RX_HAD_UNDERFLOW",ohN,gbtN); | ||
la->response->set_word(respName,readReg(la, regName)); | ||
} //End Loop Over GBT's | ||
} //End Loop Over All OH's | ||
|
@@ -763,7 +760,7 @@ void getmonVFATLinkLocal(localArgs * la, int NOH, bool doReset) | |
for (unsigned int vfatN=0; vfatN < oh::VFATS_PER_OH; ++vfatN) { | ||
//Sync Error Counters | ||
respName = stdsprintf("OH%i.VFAT%i.SYNC_ERR_CNT",ohN,vfatN); | ||
regName = stdsprintf("GEM_AMC.OH_LINKS.%s",respName.c_str()); | ||
regName = stdsprintf("GEM_AMC.OH_LINKS.OH%i.VFAT%i.SYNC_ERR_CNT",ohN,vfatN); | ||
int nSyncErrs = readReg(la,regName); | ||
la->response->set_word(respName,nSyncErrs); | ||
if ( nSyncErrs > 0 ) { | ||
|
@@ -772,12 +769,12 @@ void getmonVFATLinkLocal(localArgs * la, int NOH, bool doReset) | |
|
||
//DAQ Event Counters | ||
respName = stdsprintf("OH%i.VFAT%i.DAQ_EVENT_CNT",ohN,vfatN); | ||
regName = stdsprintf("GEM_AMC.OH_LINKS.%s",respName.c_str()); | ||
regName = stdsprintf("GEM_AMC.OH_LINKS.OH%i.VFAT%i.DAQ_EVENT_CNT",ohN,vfatN); | ||
la->response->set_word(respName,readReg(la,regName)); | ||
|
||
//DAQ CRC Error Counters | ||
respName = stdsprintf("OH%i.VFAT%i.DAQ_CRC_ERROR_CNT",ohN,vfatN); | ||
regName = stdsprintf("GEM_AMC.OH_LINKS.%s",respName.c_str()); | ||
regName = stdsprintf("GEM_AMC.OH_LINKS.OH%i.VFAT%i.DAQ_CRC_ERROR_CNT",ohN,vfatN); | ||
la->response->set_word(respName,readReg(la,regName)); | ||
} //End Loop Over VFAT's | ||
} //End Loop Over All OH's | ||
|