Merge branch '6.0.1.rc1' of github.com:slsdetectorgroup/slsDetectorPackage into 6.0.1.rc1

This commit is contained in:
maliakal_d 2021-11-25 08:42:46 +01:00
commit c1e374ed51
42 changed files with 134 additions and 52 deletions

View File

@ -67,10 +67,7 @@ set(ClangFormat_EXCLUDE_PATTERNS "build/"
${CMAKE_BINARY_DIR})
find_package(ClangFormat)
#Enable LTO if available
include(CheckIPOSupported)
check_ipo_supported(RESULT SLS_LTO_AVAILABLE)
message(STATUS "SLS_LTO_AVAILABLE:" ${SLS_LTO_AVAILABLE})
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
@ -81,6 +78,16 @@ if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
endif()
#Enable LTO if available
include(CheckIPOSupported)
check_ipo_supported(RESULT SLS_LTO_AVAILABLE)
if((CMAKE_BUILD_TYPE STREQUAL "Release") AND SLS_LTO_AVAILABLE)
message(STATUS "Building with link time optimization")
else()
message(STATUS "Building without link time optimization")
endif()
#Add two fake libraries to manage options
add_library(slsProjectOptions INTERFACE)
add_library(slsProjectWarnings INTERFACE)

View File

@ -1,4 +1,4 @@
SLS Detector Package 6.0.1 released on 23.11.2021
SLS Detector Package 6.0.1 released on 24.11.2021
==================================================
This document describes the differences between v6.0.1 and v6.0.0.
@ -19,8 +19,8 @@ This document describes the differences between v6.0.1 and v6.0.0.
1. New or Changed Features
==========================
API
---
Client
------
1. Kernel version
Commandline: kernelversion, API: getKernelVersion
@ -51,6 +51,14 @@ This document describes the differences between v6.0.1 and v6.0.0.
it will delete the empty file. Ofcourse, command line "--update" will
overwrite any file detection and start server in update mode.
Detector Server
---------------
1. [Gotthard2] speed
Ensuring dbitpipeline is default when changing speed. This has an effect
only if dbitpipeline was changed in between.
2. Resolved Issues
@ -67,6 +75,10 @@ This document describes the differences between v6.0.1 and v6.0.0.
2. [Gotthard2][Mythen3]
Verifies kernel version at server start up.
3. [Jungfrau]
Verifies HW2.0 before trying to set read n rows or flip rows.
Has no effect when not using slsReceiver.
Client
------
@ -85,6 +97,11 @@ This document describes the differences between v6.0.1 and v6.0.0.
1. Setting receiver hostname to "none" threw an exception. Fixed.
2. [Jungfrau]
Since the server verifies HW2.0 for number of rows before trying to set it,
the receiver now does not show incorrect missing packets stemming from this
issue.
3. Firmware Requirements

View File

@ -7,9 +7,9 @@ function(enable_cxx_warning flag target)
check_cxx_compiler_flag(${flag} ${flag_name})
if(${flag_name})
target_compile_options(${target} INTERFACE ${flag})
message("Adding: ${flag} to ${target}")
message(STATUS "Adding: ${flag} to ${target}")
else()
message("Flag: ${flag} not supported")
message(STATUS "Flag: ${flag} not supported")
endif()
endfunction()
@ -18,9 +18,9 @@ function(enable_c_warning flag target)
check_c_compiler_flag(${flag} ${flag_name})
if(${flag_name})
target_compile_options(${target} INTERFACE ${flag})
message("Adding: ${flag} to ${target}")
message(STATUS "Adding: ${flag} to ${target}")
else()
message("Flag: ${flag} not supported")
message(STATUS "Flag: ${flag} not supported")
endif()
endfunction()
@ -31,10 +31,10 @@ function(disable_cxx_warning flag target)
if(${flag_name})
string(REPLACE "-W" "-Wno-" neg_flag ${flag})
message("Adding: ${neg_flag} to ${target}")
message(STATUS "Adding: ${neg_flag} to ${target}")
target_compile_options(${target} INTERFACE ${neg_flag})
else()
message("Warning: ${flag} not supported no need to disable")
message(STATUS "Warning: ${flag} not supported no need to disable")
endif()
endfunction()
@ -43,10 +43,10 @@ function(disable_c_warning flag target)
check_c_compiler_flag(${flag} ${flag_name})
if(${flag_name})
string(REPLACE "-W" "-Wno-" neg_flag ${flag})
message("Adding: ${neg_flag} to ${target}")
message(STATUS "Adding: ${neg_flag} to ${target}")
target_compile_options(${target} INTERFACE ${neg_flag})
else()
message("Warning: ${flag} not supported no need to disable")
message(STATUS "Warning: ${flag} not supported no need to disable")
endif()
endfunction()

View File

@ -247,6 +247,19 @@ Possible causes could be the following:
* For Jungfrau, refer to :ref:`Jungfrau Power Supply Troubleshooting<Jungfrau Troubleshooting Power Supply>`.
Cannot ping module (Nios)
^^^^^^^^^^^^^^^^^^^^^^^^^
If you executed "reboot" command on the board, you cannot ping it anymore unless you power cycle. To reboot the controller, please use the software command ("rebootcontroller"), which talks to the microcontroller.
Gotthard2
---------
Cannot get data without a module attached
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
You cannot get data without a module attached as a specific pin is floating. Attach module to get data.
Gotthard
----------

View File

@ -1 +0,0 @@
../slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer

View File

@ -0,0 +1 @@
../slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServerv6.0.1

View File

@ -1 +0,0 @@
../slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer

View File

@ -0,0 +1 @@
../slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServerv6.0.1

View File

@ -1 +0,0 @@
../slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer

View File

@ -0,0 +1 @@
../slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServerv6.0.1

View File

@ -1 +0,0 @@
../slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer

View File

@ -0,0 +1 @@
../slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServerv6.0.1

View File

@ -1 +0,0 @@
../slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer

View File

@ -0,0 +1 @@
../slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServerv6.0.1

View File

@ -1 +0,0 @@
../slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer

View File

@ -0,0 +1 @@
../slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServerv6.0.1

View File

@ -1 +0,0 @@
../slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer

View File

@ -0,0 +1 @@
../slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServerv6.0.1

View File

@ -39,7 +39,7 @@ foreach(exe ${MOENCH_EXECUTABLES})
set_target_properties(${exe} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
if(SLS_LTO_AVAILABLE)
if((CMAKE_BUILD_TYPE STREQUAL "Release") AND SLS_LTO_AVAILABLE)
set_property(TARGET ${exe} PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
endif()

View File

@ -110,7 +110,7 @@ target_link_libraries(slsDetectorGui PUBLIC
set_target_properties(slsDetectorGui PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
if(SLS_LTO_AVAILABLE)
if((CMAKE_BUILD_TYPE STREQUAL "Release") AND SLS_LTO_AVAILABLE)
set_property(TARGET slsDetectorGui PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
endif()

View File

@ -2083,24 +2083,40 @@ int setReadoutSpeed(int val) {
case G2_108MHZ:
LOG(logINFOBLUE, ("Setting readout speed to 108 MHz\n"));
if (setClockDivider(READOUT_C0, SPEED_108_CLKDIV_0) == FAIL) {
LOG(logERROR, ("Could not set readout speed to 108 MHz. Failed to set readout clk 0 to %d\n", SPEED_108_CLKDIV_0));
return FAIL;
}
if (setClockDivider(READOUT_C1, SPEED_108_CLKDIV_1) == FAIL) {
LOG(logERROR, ("Could not set readout speed to 108 MHz. Failed to set readout clk 1 to %d\n", SPEED_108_CLKDIV_1));
return FAIL;
}
if (setPhase(READOUT_C1, SPEED_108_CLKPHASE_DEG_1, 1) == FAIL) {
LOG(logERROR, ("Could not set readout speed to 108 MHz. Failed to set clk phase 1 %d deg\n", SPEED_108_CLKPHASE_DEG_1));
return FAIL;
}
setDBITPipeline(SPEED_144_DBIT_PIPELINE);
if (getDBITPipeline() != SPEED_144_DBIT_PIPELINE) {
LOG(logERROR, ("Could not set readout speed to 108 MHz. Failed to set dbitpipeline to %d \n", SPEED_144_DBIT_PIPELINE));
return FAIL;
}
break;
case G2_144MHZ:
LOG(logINFOBLUE, ("Setting readout speed to 144 MHz\n"));
if (setClockDivider(READOUT_C0, SPEED_144_CLKDIV_0) == FAIL) {
LOG(logERROR, ("Could not set readout speed to 144 MHz. Failed to set readout clk 0 to %d\n", SPEED_144_CLKDIV_0));
return FAIL;
}
if (setClockDivider(READOUT_C1, SPEED_144_CLKDIV_1) == FAIL) {
LOG(logERROR, ("Could not set readout speed to 144 MHz. Failed to set readout clk 1 to %d\n", SPEED_144_CLKDIV_1));
return FAIL;
}
if (setPhase(READOUT_C1, SPEED_144_CLKPHASE_DEG_1, 1) == FAIL) {
LOG(logERROR, ("Could not set readout speed to 144 MHz. Failed to set clk phase 1 %d deg\n", SPEED_144_CLKPHASE_DEG_1));
return FAIL;
}
setDBITPipeline(SPEED_144_DBIT_PIPELINE);
if (getDBITPipeline() != SPEED_144_DBIT_PIPELINE) {
LOG(logERROR, ("Could not set readout speed to 144 MHz. Failed to set dbitpipeline to %d \n", SPEED_144_DBIT_PIPELINE));
return FAIL;
}
break;

View File

@ -67,9 +67,11 @@
#define SPEED_144_CLKDIV_0 (6)
#define SPEED_144_CLKDIV_1 (6)
#define SPEED_144_CLKPHASE_DEG_1 (122) // 125 not possible
#define SPEED_144_DBIT_PIPELINE (1)
#define SPEED_108_CLKDIV_0 (8)
#define SPEED_108_CLKDIV_1 (8)
#define SPEED_108_CLKPHASE_DEG_1 (268) // 270 not possible
#define SPEED_108_DBIT_PIPELINE (1)
/* Firmware Definitions */
#define FIXED_PLL_FREQUENCY (20000000) // 20MHz

View File

@ -501,12 +501,14 @@ void setupDetector() {
// temp threshold and reset event
setThresholdTemperature(DEFAULT_TMP_THRSHLD);
setTemperatureEvent(0);
setFlipRows(DEFAULT_FLIP_ROWS);
if (getChipVersion() == 11) {
setFilterResistor(DEFAULT_FILTER_RESISTOR);
setNumberOfFilterCells(DEFAULT_FILTER_CELL);
}
setReadNRows(MAX_ROWS_PER_READOUT);
if (!isHardwareVersion2()) {
setFlipRows(DEFAULT_FLIP_ROWS);
setReadNRows(MAX_ROWS_PER_READOUT);
}
}
int resetToDefaultDacs(int hardReset) {
@ -1671,6 +1673,11 @@ int setReadNRows(int value) {
LOG(logERROR, ("Invalid number of rows %d\n", value));
return FAIL;
}
if (isHardwareVersion2()) {
LOG(logERROR, ("Could not set number of rows. Only available for "
"Hardware Board version 2.0.\n"));
return FAIL;
}
// regval is numpackets - 1
int regval = (value / READ_N_ROWS_MULTIPLE) - 1;
@ -1679,7 +1686,6 @@ int setReadNRows(int value) {
bus_w(addr, bus_r(addr) & ~READ_N_ROWS_NUM_ROWS_MSK);
bus_w(addr, bus_r(addr) | ((regval << READ_N_ROWS_NUM_ROWS_OFST) &
READ_N_ROWS_NUM_ROWS_MSK));
if (value == MAX_ROWS_PER_READOUT) {
LOG(logINFO, ("Disabling Partial Readout (#rows)\n"));
bus_w(addr, bus_r(addr) & ~READ_N_ROWS_ENBL_MSK);
@ -1691,6 +1697,10 @@ int setReadNRows(int value) {
}
int getReadNRows() {
// cannot set it in old board
if (isHardwareVersion2()) {
return MAX_ROWS_PER_READOUT;
}
int enable = (bus_r(READ_N_ROWS_REG) & READ_N_ROWS_ENBL_MSK);
int regval = ((bus_r(READ_N_ROWS_REG) & READ_N_ROWS_NUM_ROWS_MSK) >>
READ_N_ROWS_NUM_ROWS_OFST);
@ -2163,6 +2173,11 @@ int getFlipRows() {
}
void setFlipRows(int arg) {
if (isHardwareVersion2()) {
LOG(logERROR, ("Could not set flip rows. Only available for "
"Hardware Board version 2.0.\n"));
return;
}
if (arg >= 0) {
if (arg == 0) {
LOG(logINFO, ("Switching off bottom row flipping\n"));

View File

@ -8,6 +8,8 @@
#include <stdio.h>
#include <sys/types.h>
#define BLACKFIN_DEFINED
int defineGPIOpins(char *mess);
int FPGAdontTouchFlash(char *mess);
int FPGATouchFlash(char *mess);

View File

@ -10,7 +10,6 @@
#include <sys/sysinfo.h>
#include <unistd.h> // usleep
#define BLACKFIN_DEFINED
/* global variables */
// clang-format off
#define MAX_TIME_FPGA_TOUCH_FLASH_US (10 * 1000 * 1000) // 10s
@ -275,7 +274,7 @@ int allowUpdate(char *mess, char *functionType) {
getKernelVersion(retvals);
snprintf(mess, MAX_STR_LENGTH,
"Could not update %s. Kernel version %s is too old to "
"update the Amd flash\n",
"update the Amd flash/ root directory. Most likely, blackfin needs rescue or replacement. Please contact us.\n",
functionType, retvals);
LOG(logERROR, (mess));
return FAIL;

View File

@ -4143,7 +4143,7 @@ int copy_detector_server(int file_des) {
LOG(logINFOBLUE, ("Copying server %s from host %s\n", sname, hostname));
char cmd[MAX_STR_LENGTH] = {0};
#if BLACKFIN_DEFINED
#ifdef BLACKFIN_DEFINED
// check update is allowed (Non Amd OR AMD + current kernel)
ret = allowUpdate(mess, "copy detector server");
#endif
@ -4663,6 +4663,13 @@ int set_read_n_rows(int file_des) {
"of %d\n",
arg, READ_N_ROWS_MULTIPLE);
LOG(logERROR, (mess));
}
// only for HW 2.0 (version = 3)
else if (isHardwareVersion2()) {
ret = FAIL;
strcpy(mess, "Could not set number of rows. Only available for "
"Hardware Board version 2.0.\n");
LOG(logERROR, (mess));
} else
#endif
{
@ -4702,7 +4709,7 @@ int get_read_n_rows(int file_des) {
retval = getReadNRows();
if (retval == -1) {
ret = FAIL;
sprintf(mess, "Could not get numbr of rows. \n");
sprintf(mess, "Could not get number of rows. \n");
LOG(logERROR, (mess));
} else {
LOG(logDEBUG1, ("number of rows retval: %u\n", retval));
@ -9389,11 +9396,14 @@ void receive_program_via_blackfin(int file_des, enum PROGRAM_INDEX index,
functionType);
LOG(logERROR, (mess));
#else
// check update is allowed (Non Amd OR AMD + current kernel)
ret = allowUpdate(mess, functionType);
if (ret == FAIL) {
Server_SendResult(file_des, INT32, NULL, 0);
return;
// only when writing to kernel flash or root directory
if (index != PROGRAM_FPGA) {
// check update is allowed (Non Amd OR AMD + current kernel)
ret = allowUpdate(mess, functionType);
if (ret == FAIL) {
Server_SendResult(file_des, INT32, NULL, 0);
return;
}
}
// open file and allocate memory for part program
@ -9615,9 +9625,9 @@ int set_update_mode(int file_des) {
return printSocketReadError();
LOG(logDEBUG1, ("Setting update mode to \n", arg));
#if BLACKFIN_DEFINED
#ifdef BLACKFIN_DEFINED
// check update is allowed (Non Amd OR AMD + current kernel)
ret = allowUpdate(mess, "copy detector server");
ret = allowUpdate(mess, "set/unset update mode");
#endif
if (ret == OK) {

View File

@ -69,9 +69,6 @@ list(APPEND DETECTOR_LIBRARY_TARGETS slsDetectorStatic)
if((CMAKE_BUILD_TYPE STREQUAL "Release") AND SLS_LTO_AVAILABLE)
set_property(TARGET ${DETECTOR_LIBRARY_TARGETS} PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
# set_property(TARGET slsDetectorObject PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
# set_property(TARGET slsDetectorStatic PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
# set_property(TARGET slsDetectorShared PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
endif()
@ -100,7 +97,7 @@ if(SLS_USE_TEXTCLIENT)
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
COMPILE_DEFINITIONS ${val2}=1
)
if(SLS_LTO_AVAILABLE)
if((CMAKE_BUILD_TYPE STREQUAL "Release") AND SLS_LTO_AVAILABLE)
set_property(TARGET ${val1} PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
endif()
endforeach()

View File

@ -104,7 +104,7 @@ if (SLS_USE_RECEIVER_BINARIES)
set_target_properties(slsReceiver PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
if(SLS_LTO_AVAILABLE)
if((CMAKE_BUILD_TYPE STREQUAL "Release") AND SLS_LTO_AVAILABLE)
set_property(TARGET slsReceiver PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
endif()
@ -124,7 +124,7 @@ if (SLS_USE_RECEIVER_BINARIES)
set_target_properties(slsMultiReceiver PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
if(SLS_LTO_AVAILABLE)
if((CMAKE_BUILD_TYPE STREQUAL "Release") AND SLS_LTO_AVAILABLE)
set_property(TARGET slsMultiReceiver PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
endif()

View File

@ -6,10 +6,10 @@
#define APILIB 0x211122
#define APIRECEIVER 0x211122
#define APIGUI 0x211021
#define APICTB 0x211122
#define APIGOTTHARD 0x211122
#define APIGOTTHARD2 0x211122
#define APIJUNGFRAU 0x211122
#define APIMYTHEN3 0x211122
#define APIMOENCH 0x211122
#define APIEIGER 0x211122
#define APICTB 0x211124
#define APIGOTTHARD 0x211124
#define APIJUNGFRAU 0x211124
#define APIMYTHEN3 0x211124
#define APIMOENCH 0x211124
#define APIEIGER 0x211124
#define APIGOTTHARD2 0x211124

View File

@ -115,7 +115,7 @@ TEST_CASE("Copy construct a MacAddr") {
}
TEST_CASE("udp dst struct basic properties") {
static_assert(sizeof(UdpDestination) == 36);
static_assert(sizeof(UdpDestination) == 36, "udpDestination struct size does not match");
UdpDestination dst{};
REQUIRE(dst.entry == 0);
REQUIRE(dst.port == 0);

View File

@ -43,6 +43,10 @@ if (SLS_USE_RECEIVER)
endif (SLS_USE_RECEIVER)
if((CMAKE_BUILD_TYPE STREQUAL "Release") AND SLS_LTO_AVAILABLE)
set_property(TARGET tests PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
endif()
set_target_properties(tests PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)