Merge pull request #362 from slsdetectorgroup/eiger_datastream

Eiger datastream
This commit is contained in:
Dhanya Thattil 2022-02-04 11:52:34 +01:00 committed by GitHub
commit 83e0599a37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 58 additions and 21 deletions

View File

@ -30,11 +30,11 @@ This document describes the differences between v6.1.0 and v6.0.0.
- mythen server kernel check incompatible (cet timezone)
- rx_arping
- rx_threadsids max is now 9 (breaking api)
- fixed datastream disabling for eiger. Its only available in 10g mode.
- m3 server crash (vthrehsold)
- allow vtrim to be interpolated for Eiger settings
2. Resolved Issues
==================

View File

@ -492,6 +492,11 @@ int Beb_SetDataStream(enum portPosition port, int enable) {
u_int32_t reg = XPAR_GPIO_P15_STREAMING_REG;
u_int32_t mask = (port == LEFT ? XPAR_GPIO_LFT_STRM_DSBL_MSK
: XPAR_GPIO_RGHT_STRM_DSBL_MSK);
// invert left/right if bottom
if (!Beb_top) {
mask = (port == LEFT ? XPAR_GPIO_RGHT_STRM_DSBL_MSK
: XPAR_GPIO_LFT_STRM_DSBL_MSK);
}
u_int32_t value = Beb_Read32(csp0base, reg);
// disabling in firmware
@ -529,6 +534,11 @@ int Beb_GetDataStream(enum portPosition port, int *retval) {
u_int32_t reg = XPAR_GPIO_P15_STREAMING_REG;
u_int32_t mask = (port == LEFT ? XPAR_GPIO_LFT_STRM_DSBL_MSK
: XPAR_GPIO_RGHT_STRM_DSBL_MSK);
// invert left/right if bottom
if (!Beb_top) {
mask = (port == LEFT ? XPAR_GPIO_RGHT_STRM_DSBL_MSK
: XPAR_GPIO_LFT_STRM_DSBL_MSK);
}
u_int32_t value = Beb_Read32(csp0base, reg);
// disabling in firmware
@ -682,6 +692,10 @@ int Beb_GetTransmissionDelayLeft() {
return Beb_deactivated_transmission_delay_left;
}
u_int32_t offset = TXM_DELAY_LEFT_OFFSET;
// invert left/right if bottom
if (!Beb_top) {
offset = TXM_DELAY_RIGHT_OFFSET;
}
u_int32_t *csp0base = 0;
int fd = Beb_open(&csp0base, XPAR_PLB_GPIO_SYS_BASEADDR);
if (fd <= 0) {
@ -706,6 +720,10 @@ int Beb_SetTransmissionDelayLeft(int value) {
return 1;
}
u_int32_t offset = TXM_DELAY_LEFT_OFFSET;
// invert left/right if bottom
if (!Beb_top) {
offset = TXM_DELAY_RIGHT_OFFSET;
}
u_int32_t *csp0base = 0;
int fd = Beb_open(&csp0base, XPAR_PLB_GPIO_SYS_BASEADDR);
if (fd <= 0) {
@ -726,6 +744,10 @@ int Beb_GetTransmissionDelayRight() {
}
u_int32_t offset = TXM_DELAY_RIGHT_OFFSET;
// invert left/right if bottom
if (!Beb_top) {
offset = TXM_DELAY_LEFT_OFFSET;
}
u_int32_t *csp0base = 0;
int fd = Beb_open(&csp0base, XPAR_PLB_GPIO_SYS_BASEADDR);
if (fd <= 0) {
@ -750,6 +772,10 @@ int Beb_SetTransmissionDelayRight(int value) {
return 1;
}
u_int32_t offset = TXM_DELAY_RIGHT_OFFSET;
// invert left/right if bottom
if (!Beb_top) {
offset = TXM_DELAY_LEFT_OFFSET;
}
u_int32_t *csp0base = 0;
int fd = Beb_open(&csp0base, XPAR_PLB_GPIO_SYS_BASEADDR);
if (fd <= 0) {

View File

@ -2932,7 +2932,7 @@ int enable_ten_giga(int file_des) {
if (receiveData(file_des, &arg, sizeof(arg), INT32) < 0)
return printSocketReadError();
LOG(logINFOBLUE, ("Setting 10GbE: %d\n", arg));
LOG(logDEBUG, ("Setting 10GbE: %d\n", arg));
#if defined(JUNGFRAUD) || defined(GOTTHARDD) || defined(GOTTHARD2D)
functionNotImplemented();
@ -8266,6 +8266,9 @@ int get_datastream(int file_des) {
"Only left and right allowed\n",
arg);
LOG(logERROR, (mess));
} else if (enableTenGigabitEthernet(GET_FLAG) == 0) {
retval = 1;
LOG(logINFO, ("Datastream always enabled for 1g\n"));
} else {
ret = getDataStream(arg, &retval);
LOG(logDEBUG1, ("datastream (%s) retval: %u\n",
@ -8312,6 +8315,14 @@ int set_datastream(int file_des) {
ret = FAIL;
sprintf(mess, "Could not %s. Invalid enable %d. \n", msg, enable);
LOG(logERROR, (mess));
} else if (enableTenGigabitEthernet(GET_FLAG) == 0 && enable == 0) {
ret = FAIL;
sprintf(mess,
"Could not %s. Disabling is only enabled in 10g mode.\n",
msg);
LOG(logERROR, (mess));
} else if (enableTenGigabitEthernet(GET_FLAG) == 0 && enable == 1) {
LOG(logINFO, ("Datastream always enabled for 1g\n"));
} else {
ret = setDataStream(port, enable);
if (ret == FAIL) {

View File

@ -635,25 +635,25 @@ void Implementation::stopReceiver() {
std::to_string(std::abs(mp[i])) + std::string(" (Extra)");
}
std::string summary;
if (!activated) {
summary = "\n\tDeactivated Receiver";
} else if (!detectorDataStream[i]) {
summary = (i == 0 ? "\n\tDeactivated Left Port"
: "\n\tDeactivated Right Port");
} else {
std::ostringstream os;
os << "\n\tMissing Packets\t\t: " << mpMessage
<< "\n\tComplete Frames\t\t: " << nf
<< "\n\tLast Frame Caught\t: "
<< listener[i]->GetLastFrameIndexCaught();
summary = os.str();
}
TLogLevel lev = ((mp[i]) > 0) ? logINFORED : logINFOGREEN;
LOG(lev) <<
// udp port number could be the second if selected interface is
// 2 for jungfrau
"Summary of Port " << udpPortNum[i]
<< "\n\tMissing Packets\t\t: " << mpMessage
<< "\n\tComplete Frames\t\t: " << nf
<< "\n\tLast Frame Caught\t: "
<< listener[i]->GetLastFrameIndexCaught();
}
if (!activated) {
LOG(logINFORED) << "Deactivated Receiver";
}
if (!detectorDataStream[0]) {
LOG(logINFORED) << "Deactivated Left Port";
}
if (!detectorDataStream[1]) {
LOG(logINFORED) << "Deactivated Right Port";
LOG(lev) << "Summary of Port " << udpPortNum[i] << summary;
}
// callback
if (acquisitionFinishedCallBack) {
try {

View File

@ -11,5 +11,5 @@
#define APIGOTTHARD2 0x220203
#define APIJUNGFRAU 0x220203
#define APIMYTHEN3 0x220203
#define APIMOENCH 0x220202
#define APIEIGER 0x220203
#define APIMOENCH 0x220203
#define APIEIGER 0x220204