diff --git a/RELEASE.txt b/RELEASE.txt index 1d64ff1fb..f10de5cfb 100644 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -27,6 +27,7 @@ This document describes the differences between v7.0.0.rc1 and v6.1.2 ========================== - moench being made compatible with jungfrau 2.0 boards (jungfrau structure, away from ctb) +- eiger febl and feb in versions 2. On-board Detector Server Compatibility diff --git a/python/slsdet/detector.py b/python/slsdet/detector.py index 90f98c4a4..6148b72bd 100755 --- a/python/slsdet/detector.py +++ b/python/slsdet/detector.py @@ -1797,6 +1797,17 @@ class Detector(CppDetectorApi): @property def versions(self): + if self.type == detectorType.EIGER: + return {'type': self.type, + 'package': self.packageversion, + 'client': self.clientversion, + 'firmware (Beb)': self.firmwareversion, + 'firmware(Febl)': self.getFrontEndFirmwareVersion(slsDetectorDefs.fpgaPosition.FRONT_LEFT), + 'firmware (Febr)': self.getFrontEndFirmwareVersion(slsDetectorDefs.fpgaPosition.FRONT_RIGHT), + 'detectorserver': self.detectorserverversion, + 'kernel': self.kernelversion, + 'receiver': self.rx_version} + return {'type': self.type, 'package': self.packageversion, 'client': self.clientversion, diff --git a/python/src/detector.cpp b/python/src/detector.cpp index 0df2feaef..708bfe0b3 100644 --- a/python/src/detector.cpp +++ b/python/src/detector.cpp @@ -61,6 +61,11 @@ void init_det(py::module &m) { (Result(Detector::*)(sls::Positions) const) & Detector::getFirmwareVersion, py::arg() = Positions{}); + CppDetectorApi.def("getFrontEndFirmwareVersion", + (Result(Detector::*)(const defs::fpgaPosition, + sls::Positions) const) & + Detector::getFrontEndFirmwareVersion, + py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "getDetectorServerVersion", (Result(Detector::*)(sls::Positions) const) & diff --git a/python/src/enums.cpp b/python/src/enums.cpp index e8967a7dd..7981dd096 100644 --- a/python/src/enums.cpp +++ b/python/src/enums.cpp @@ -286,6 +286,11 @@ void init_enums(py::module &m) { .value("BOTTOM", slsDetectorDefs::portPosition::BOTTOM) .export_values(); + py::enum_(Defs, "fpgaPosition") + .value("FRONT_LEFT", slsDetectorDefs::fpgaPosition::FRONT_LEFT) + .value("FRONT_RIGHT", slsDetectorDefs::fpgaPosition::FRONT_RIGHT) + .export_values(); + py::enum_(Defs, "streamingInterface", py::arithmetic()) .value("NONE", slsDetectorDefs::streamingInterface::NONE) diff --git a/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServerv7.0.0.rc1 b/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServerv7.0.0.rc1 deleted file mode 100755 index d45f830b1..000000000 Binary files a/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServerv7.0.0.rc1 and /dev/null differ diff --git a/slsDetectorServers/eigerDetectorServer/FebControl.c b/slsDetectorServers/eigerDetectorServer/FebControl.c index c37ce2ced..b2ba2cd85 100644 --- a/slsDetectorServers/eigerDetectorServer/FebControl.c +++ b/slsDetectorServers/eigerDetectorServer/FebControl.c @@ -2180,6 +2180,36 @@ int Feb_Control_GetRightFPGATemp() { return (int)temperature; } +int64_t Feb_Control_GetFrontLeftFirmwareVersion() { + if (!Feb_Control_activated) { + return 0; + } + unsigned int value = 0; + if (!Feb_Interface_ReadRegister(Feb_Control_leftAddress, FEB_REG_STATUS, + &value)) { + LOG(logERROR, ("Trouble reading FEB_REG_STATUS reg to get left feb " + "fw version\n")); + return 0; + } + return ((value & FEB_REG_STATUS_FW_VERSION_MSK) >> + FEB_REG_STATUS_FW_VERSION_OFST); +} + +int64_t Feb_Control_GetFrontRightFirmwareVersion() { + if (!Feb_Control_activated) { + return 0; + } + unsigned int value = 0; + if (!Feb_Interface_ReadRegister(Feb_Control_rightAddress, FEB_REG_STATUS, + &value)) { + LOG(logERROR, ("Trouble reading FEB_REG_STATUS reg to get right feb " + "fw version\n")); + return 0; + } + return ((value & FEB_REG_STATUS_FW_VERSION_MSK) >> + FEB_REG_STATUS_FW_VERSION_OFST); +} + int64_t Feb_Control_GetMeasuredPeriod() { if (!Feb_Control_activated) { return 0; diff --git a/slsDetectorServers/eigerDetectorServer/FebControl.h b/slsDetectorServers/eigerDetectorServer/FebControl.h index 325c4af44..ffda63837 100644 --- a/slsDetectorServers/eigerDetectorServer/FebControl.h +++ b/slsDetectorServers/eigerDetectorServer/FebControl.h @@ -116,5 +116,7 @@ int Feb_Control_PrintCorrectedValues(); // adcs int Feb_Control_GetLeftFPGATemp(); int Feb_Control_GetRightFPGATemp(); +int64_t Feb_Control_GetFrontLeftFirmwareVersion(); +int64_t Feb_Control_GetFrontRightFirmwareVersion(); int64_t Feb_Control_GetMeasuredPeriod(); int64_t Feb_Control_GetSubMeasuredPeriod(); diff --git a/slsDetectorServers/eigerDetectorServer/FebRegisterDefs.h b/slsDetectorServers/eigerDetectorServer/FebRegisterDefs.h index 1ec86f834..1e95ef327 100644 --- a/slsDetectorServers/eigerDetectorServer/FebRegisterDefs.h +++ b/slsDetectorServers/eigerDetectorServer/FebRegisterDefs.h @@ -46,6 +46,8 @@ #define FEB_REG_STATUS_WAIT_FOR_TRGGR_MSK (0x00000001 << FEB_REG_STATUS_WAIT_FOR_TRGGR_OFST) #define FEB_REG_STATUS_ACQ_DONE_OFST (6) #define FEB_REG_STATUS_ACQ_DONE_MSK (0x00000001 << FEB_REG_STATUS_ACQ_DONE_OFST) +#define FEB_REG_STATUS_FW_VERSION_OFST (8) +#define FEB_REG_STATUS_FW_VERSION_MSK (0x000000FF << FEB_REG_STATUS_FW_VERSION_OFST) #define FEB_REG_STATUS_TEMP_OFST (16) #define FEB_REG_STATUS_TEMP_MSK (0x0000FFFF << FEB_REG_STATUS_TEMP_OFST) diff --git a/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer b/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer index a13022b53..e3ccdd2fb 100755 Binary files a/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer and b/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer differ diff --git a/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServerv7.0.0.rc1 b/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServerv7.0.0.rc1 deleted file mode 100755 index 148a5c0b6..000000000 Binary files a/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServerv7.0.0.rc1 and /dev/null differ diff --git a/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c index 815db9050..8c77ea483 100644 --- a/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c @@ -216,6 +216,27 @@ u_int64_t getFirmwareVersion() { #endif } +uint64_t getFrontEndFirmwareVersion(enum fpgaPosition fpgaPosition) { + uint64_t retval = 0; +#ifndef VIRTUAL + sharedMemory_lockLocalLink(); + switch (fpgaPosition) { + case FRONT_LEFT: + retval = Feb_Control_GetFrontLeftFirmwareVersion(fpgaPosition); + break; + case FRONT_RIGHT: + retval = Feb_Control_GetFrontRightFirmwareVersion(fpgaPosition); + break; + default: + LOG(logERROR, + ("unknown index for fpga position to read firmware version\n")); + retval = -1; + } + sharedMemory_unlockLocalLink(); +#endif + return retval; +} + u_int64_t getFirmwareAPIVersion() { #ifdef VIRTUAL return 0; diff --git a/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServerv7.0.0.rc1 b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServerv7.0.0.rc1 deleted file mode 100755 index d1ce93fe2..000000000 Binary files a/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServerv7.0.0.rc1 and /dev/null differ diff --git a/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServerv7.0.0.rc1 b/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServerv7.0.0.rc1 deleted file mode 100755 index c00185e30..000000000 Binary files a/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServerv7.0.0.rc1 and /dev/null differ diff --git a/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServerv7.0.0.rc1 b/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServerv7.0.0.rc1 deleted file mode 100755 index b44ac029b..000000000 Binary files a/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServerv7.0.0.rc1 and /dev/null differ diff --git a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h index 7d8d11595..88eeaf95f 100644 --- a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h +++ b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h @@ -78,6 +78,9 @@ int getTestImageMode(); // Ids void getServerVersion(char *version); u_int64_t getFirmwareVersion(); +#ifdef EIGERD +uint64_t getFrontEndFirmwareVersion(enum fpgaPosition fpgaPosition); +#endif u_int64_t getFirmwareAPIVersion(); #ifndef EIGERD void getHardwareVersion(char *version); diff --git a/slsDetectorServers/slsDetectorServer/include/slsDetectorServer_funcs.h b/slsDetectorServers/slsDetectorServer/include/slsDetectorServer_funcs.h index 65ea37fbd..bbfdf26c5 100644 --- a/slsDetectorServers/slsDetectorServer/include/slsDetectorServer_funcs.h +++ b/slsDetectorServers/slsDetectorServer/include/slsDetectorServer_funcs.h @@ -306,3 +306,4 @@ int get_module(int); int get_synchronization(int); int set_synchronization(int); int get_hardware_version(int); +int get_frontend_firmware_version(int); diff --git a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c index 547e346c5..c9e2c803e 100644 --- a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c +++ b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c @@ -471,6 +471,7 @@ void function_table() { flist[F_GET_SYNCHRONIZATION] = &get_synchronization; flist[F_SET_SYNCHRONIZATION] = &set_synchronization; flist[F_GET_HARDWARE_VERSION] = &get_hardware_version; + flist[F_GET_FRONTEND_FIRMWARE_VERSION] = &get_frontend_firmware_version; // check if (NUM_DET_FUNCTIONS >= RECEIVER_ENUM_START) { @@ -10136,3 +10137,35 @@ int get_hardware_version(int file_des) { #endif return Server_SendResult(file_des, OTHER, retvals, sizeof(retvals)); } + +int get_frontend_firmware_version(int file_des) { + ret = OK; + memset(mess, 0, sizeof(mess)); + enum fpgaPosition arg = FRONT_LEFT; + int64_t retval = -1; + + if (receiveData(file_des, &arg, sizeof(arg), INT32) < 0) + return printSocketReadError(); + LOG(logDEBUG1, ("Getting front end firmware version: %s\n", + (arg == FRONT_LEFT ? "left" : "right"))); + +#if !defined(EIGERD) + functionNotImplemented(); +#else + switch (arg) { + case FRONT_LEFT: + case FRONT_RIGHT: + break; + default: + modeNotImplemented("Fpga position Index", (int)arg); + break; + } + if (ret == OK) { + retval = getFrontEndFirmwareVersion(arg); + LOG(logDEBUG1, + ("Front %s version retval: 0x%llx\n", + (arg == FRONT_LEFT ? "left" : "right"), (long long int)retval)); + } +#endif + return Server_SendResult(file_des, INT64, &retval, sizeof(retval)); +} \ No newline at end of file diff --git a/slsDetectorSoftware/include/sls/Detector.h b/slsDetectorSoftware/include/sls/Detector.h index f4c2387fb..fbcd40a73 100644 --- a/slsDetectorSoftware/include/sls/Detector.h +++ b/slsDetectorSoftware/include/sls/Detector.h @@ -78,6 +78,11 @@ class Detector { Result getFirmwareVersion(Positions pos = {}) const; + /** [Eiger] Options: FRONT_LEFT, FRONT_RIGHT */ + Result + getFrontEndFirmwareVersion(const defs::fpgaPosition fpgaPosition, + Positions pos = {}) const; + Result getDetectorServerVersion(Positions pos = {}) const; /** [Jungfrau][Moench][Gotthard2][Myhten3][Gotthard][Ctb] */ diff --git a/slsDetectorSoftware/src/CmdProxy.cpp b/slsDetectorSoftware/src/CmdProxy.cpp index 80e38c01e..f39d5dbcd 100644 --- a/slsDetectorSoftware/src/CmdProxy.cpp +++ b/slsDetectorSoftware/src/CmdProxy.cpp @@ -276,25 +276,33 @@ std::string CmdProxy::Versions(int action) { } bool eiger = (det->getDetectorType().squash() == defs::EIGER); auto t = det->getFirmwareVersion(std::vector{det_id}); - os << "\nType : " << OutString(det->getDetectorType()) - << "\nRelease : " << det->getPackageVersion() << std::hex - << "\nClient : " << det->getClientVersion(); - os << "\nFirmware : "; + os << "\nType : " << OutString(det->getDetectorType()) + << "\nRelease : " << det->getPackageVersion() << std::hex + << "\nClient : " << det->getClientVersion(); if (eiger) { - os << OutString(t); + os << "\nFirmware (Beb) : " + << OutString(det->getFirmwareVersion(std::vector{det_id})); + os << "\nFirmware (Febl) : " + << OutString(det->getFrontEndFirmwareVersion( + defs::FRONT_LEFT, std::vector{det_id})); + os << "\nFirmware (Febr) : " + << OutString(det->getFrontEndFirmwareVersion( + defs::FRONT_RIGHT, std::vector{det_id})); } else { - os << OutStringHex(t); + os << "\nFirmware : " + << OutStringHex( + det->getFirmwareVersion(std::vector{det_id})); } - os << "\nServer : " + os << "\nServer : " << OutString( det->getDetectorServerVersion(std::vector{det_id})); if (!eiger) - os << "\nHardware : " + os << "\nHardware : " << OutString(det->getHardwareVersion(std::vector{det_id})); - os << "\nKernel : " + os << "\nKernel : " << OutString(det->getKernelVersion({std::vector{det_id}})); if (det->getUseReceiverFlag().squash(true)) { - os << "\nReceiver : " + os << "\nReceiver : " << OutString(det->getReceiverVersion(std::vector{det_id})); } os << std::dec << '\n'; diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index c547504fd..890d08c5f 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -124,6 +124,13 @@ Result Detector::getFirmwareVersion(Positions pos) const { return pimpl->Parallel(&Module::getFirmwareVersion, pos); } +Result +Detector::getFrontEndFirmwareVersion(const defs::fpgaPosition fpgaPosition, + Positions pos) const { + return pimpl->Parallel(&Module::getFrontEndFirmwareVersion, pos, + fpgaPosition); +} + Result Detector::getDetectorServerVersion(Positions pos) const { return pimpl->Parallel(&Module::getDetectorServerVersion, pos); } diff --git a/slsDetectorSoftware/src/Module.cpp b/slsDetectorSoftware/src/Module.cpp index 07b5cdeb7..30a5e0656 100644 --- a/slsDetectorSoftware/src/Module.cpp +++ b/slsDetectorSoftware/src/Module.cpp @@ -92,6 +92,12 @@ int64_t Module::getFirmwareVersion() const { return sendToDetector(F_GET_FIRMWARE_VERSION); } +int64_t +Module::getFrontEndFirmwareVersion(const fpgaPosition fpgaPosition) const { + return sendToDetector(F_GET_FRONTEND_FIRMWARE_VERSION, + fpgaPosition); +} + std::string Module::getControlServerLongVersion() const { char retval[MAX_STR_LENGTH]{}; sendToDetector(F_GET_SERVER_VERSION, nullptr, retval); diff --git a/slsDetectorSoftware/src/Module.h b/slsDetectorSoftware/src/Module.h index ca496d407..432a9336b 100644 --- a/slsDetectorSoftware/src/Module.h +++ b/slsDetectorSoftware/src/Module.h @@ -90,6 +90,7 @@ class Module : public virtual slsDetectorDefs { void setHostname(const std::string &hostname, const bool initialChecks); int64_t getFirmwareVersion() const; + int64_t getFrontEndFirmwareVersion(const fpgaPosition fpgaPosition) const; std::string getControlServerLongVersion() const; std::string getStopServerLongVersion() const; std::string getDetectorServerVersion() const; diff --git a/slsSupportLib/include/sls/sls_detector_defs.h b/slsSupportLib/include/sls/sls_detector_defs.h index 32ed13ad2..cdf04e98f 100644 --- a/slsSupportLib/include/sls/sls_detector_defs.h +++ b/slsSupportLib/include/sls/sls_detector_defs.h @@ -445,6 +445,11 @@ typedef struct { enum portPosition { LEFT, RIGHT, TOP, BOTTOM }; + /** + * eiger fpga position + */ + enum fpgaPosition { FRONT_LEFT, FRONT_RIGHT }; + #ifdef __cplusplus enum class streamingInterface { #else diff --git a/slsSupportLib/include/sls/sls_detector_funcs.h b/slsSupportLib/include/sls/sls_detector_funcs.h index da102064d..0fedd9fff 100755 --- a/slsSupportLib/include/sls/sls_detector_funcs.h +++ b/slsSupportLib/include/sls/sls_detector_funcs.h @@ -274,6 +274,7 @@ enum detFuncs { F_GET_SYNCHRONIZATION, F_SET_SYNCHRONIZATION, F_GET_HARDWARE_VERSION, + F_GET_FRONTEND_FIRMWARE_VERSION, NUM_DET_FUNCTIONS, RECEIVER_ENUM_START = 512, /**< detector function should not exceed this @@ -653,6 +654,7 @@ const char* getFunctionNameFromEnum(enum detFuncs func) { case F_GET_SYNCHRONIZATION: return "F_GET_SYNCHRONIZATION"; case F_SET_SYNCHRONIZATION: return "F_SET_SYNCHRONIZATION"; case F_GET_HARDWARE_VERSION: return "F_GET_HARDWARE_VERSION"; + case F_GET_FRONTEND_FIRMWARE_VERSION: return "F_GET_FRONTEND_FIRMWARE_VERSION"; case NUM_DET_FUNCTIONS: return "NUM_DET_FUNCTIONS"; case RECEIVER_ENUM_START: return "RECEIVER_ENUM_START"; diff --git a/slsSupportLib/include/sls/versionAPI.h b/slsSupportLib/include/sls/versionAPI.h index 32297ae43..d134475fe 100644 --- a/slsSupportLib/include/sls/versionAPI.h +++ b/slsSupportLib/include/sls/versionAPI.h @@ -7,7 +7,7 @@ #define APICTB "developer 0x221213" #define APIGOTTHARD2 "developer 0x221213" #define APIJUNGFRAU "developer 0x221213" -#define APIEIGER "developer 0x221213" +#define APIEIGER "developer 0x221215" #define APIMOENCH "developer 0x221215" #define APIGOTTHARD "developer 0x230117" -#define APIMYTHEN3 "developer 0x230117" \ No newline at end of file +#define APIMYTHEN3 "developer 0x230117"