mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-23 15:00:02 +02:00
commit
0cb418a89b
@ -140,6 +140,13 @@
|
|||||||
|
|
||||||
#define DTA_OFFSET_REG (0x24 * REG_OFFSET + BASE_CONTROL)
|
#define DTA_OFFSET_REG (0x24 * REG_OFFSET + BASE_CONTROL)
|
||||||
|
|
||||||
|
/* Formatting for data core -----------------------------------------------*/
|
||||||
|
#define FMT_CONFIG_REG (0x00 * REG_OFFSET + BASE_FMT)
|
||||||
|
|
||||||
|
#define FMT_CONFIG_TXN_DELAY_OFST (0)
|
||||||
|
#define FMT_CONFIG_TXN_DELAY_MSK (0x00FFFFFF << FMT_CONFIG_TXN_DELAY_OFST)
|
||||||
|
|
||||||
|
|
||||||
/* Packetizer -------------------------------------------------------------*/
|
/* Packetizer -------------------------------------------------------------*/
|
||||||
|
|
||||||
/* Packetizer Config Register */
|
/* Packetizer Config Register */
|
||||||
|
Binary file not shown.
@ -2067,6 +2067,28 @@ int getClockDivider(enum CLKINDEX ind) {
|
|||||||
return clkDivider[ind];
|
return clkDivider[ind];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int getTransmissionDelayFrame() {
|
||||||
|
return ((bus_r(FMT_CONFIG_REG) & FMT_CONFIG_TXN_DELAY_MSK) >>
|
||||||
|
FMT_CONFIG_TXN_DELAY_OFST);
|
||||||
|
}
|
||||||
|
|
||||||
|
int setTransmissionDelayFrame(int value) {
|
||||||
|
if (value < 0 || value > MAX_TIMESLOT_VAL) {
|
||||||
|
LOG(logERROR, ("Transmission delay %d should be in range: 0 - %d\n",
|
||||||
|
value, MAX_TIMESLOT_VAL));
|
||||||
|
return FAIL;
|
||||||
|
}
|
||||||
|
LOG(logINFO, ("Setting transmission delay: %d\n", value));
|
||||||
|
uint32_t addr = FMT_CONFIG_REG;
|
||||||
|
bus_w(addr, bus_r(addr) & ~FMT_CONFIG_TXN_DELAY_MSK);
|
||||||
|
bus_w(addr, (bus_r(addr) | ((value << FMT_CONFIG_TXN_DELAY_OFST) &
|
||||||
|
FMT_CONFIG_TXN_DELAY_MSK)));
|
||||||
|
LOG(logDEBUG1, ("Transmission delay read %d\n",
|
||||||
|
((bus_r(addr) & FMT_CONFIG_TXN_DELAY_MSK) >>
|
||||||
|
FMT_CONFIG_TXN_DELAY_OFST)));
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
/* aquisition */
|
/* aquisition */
|
||||||
|
|
||||||
int startStateMachine() {
|
int startStateMachine() {
|
||||||
|
@ -45,6 +45,7 @@
|
|||||||
#define DEFAULT_MSTR_OTPT_P1_NUM_PULSES (20)
|
#define DEFAULT_MSTR_OTPT_P1_NUM_PULSES (20)
|
||||||
|
|
||||||
/* Firmware Definitions */
|
/* Firmware Definitions */
|
||||||
|
#define MAX_TIMESLOT_VAL (0xFFFFFF)
|
||||||
#define IP_HEADER_SIZE (20)
|
#define IP_HEADER_SIZE (20)
|
||||||
#define FIXED_PLL_FREQUENCY (020000000) // 20MHz
|
#define FIXED_PLL_FREQUENCY (020000000) // 20MHz
|
||||||
#define READOUT_PLL_VCO_FREQ_HZ (1250000000) // 1.25GHz
|
#define READOUT_PLL_VCO_FREQ_HZ (1250000000) // 1.25GHz
|
||||||
|
@ -531,6 +531,8 @@ int *getBadChannels(int *nch);
|
|||||||
#if defined(JUNGFRAUD) || defined(EIGERD)
|
#if defined(JUNGFRAUD) || defined(EIGERD)
|
||||||
int getTenGigaFlowControl();
|
int getTenGigaFlowControl();
|
||||||
int setTenGigaFlowControl(int value);
|
int setTenGigaFlowControl(int value);
|
||||||
|
#endif
|
||||||
|
#if defined(JUNGFRAUD) || defined(EIGERD) || defined(MYTHEN3D)
|
||||||
int getTransmissionDelayFrame();
|
int getTransmissionDelayFrame();
|
||||||
int setTransmissionDelayFrame(int value);
|
int setTransmissionDelayFrame(int value);
|
||||||
#endif
|
#endif
|
||||||
|
@ -3489,12 +3489,12 @@ int set_transmission_delay_frame(int file_des) {
|
|||||||
return printSocketReadError();
|
return printSocketReadError();
|
||||||
LOG(logINFO, ("Setting transmission delay frame: %d\n", arg));
|
LOG(logINFO, ("Setting transmission delay frame: %d\n", arg));
|
||||||
|
|
||||||
#if !defined(EIGERD) && !defined(JUNGFRAUD)
|
#if !defined(EIGERD) && !defined(JUNGFRAUD) && !defined(MYTHEN3D)
|
||||||
functionNotImplemented();
|
functionNotImplemented();
|
||||||
#else
|
#else
|
||||||
// only set
|
// only set
|
||||||
if (Server_VerifyLock() == OK) {
|
if (Server_VerifyLock() == OK) {
|
||||||
#ifdef JUNGFRAUD
|
#if defined(JUNGFRAUD) || defined(MYTHEN3D)
|
||||||
if (arg > MAX_TIMESLOT_VAL) {
|
if (arg > MAX_TIMESLOT_VAL) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
sprintf(mess, "Transmission delay %d should be in range: 0 - %d\n",
|
sprintf(mess, "Transmission delay %d should be in range: 0 - %d\n",
|
||||||
@ -3526,7 +3526,7 @@ int get_transmission_delay_frame(int file_des) {
|
|||||||
|
|
||||||
LOG(logDEBUG1, ("Getting transmission delay frame\n"));
|
LOG(logDEBUG1, ("Getting transmission delay frame\n"));
|
||||||
|
|
||||||
#if !defined(EIGERD) && !defined(JUNGFRAUD)
|
#if !defined(EIGERD) && !defined(JUNGFRAUD) && !defined(MYTHEN3D)
|
||||||
functionNotImplemented();
|
functionNotImplemented();
|
||||||
#else
|
#else
|
||||||
// get only
|
// get only
|
||||||
|
@ -529,13 +529,13 @@ class Detector {
|
|||||||
/** [Eiger][CTB][Moench][Mythen3] */
|
/** [Eiger][CTB][Moench][Mythen3] */
|
||||||
void setTenGiga(bool value, Positions pos = {});
|
void setTenGiga(bool value, Positions pos = {});
|
||||||
|
|
||||||
/** [Eiger, Jungfrau] */
|
/** [Eiger][Jungfrau] */
|
||||||
Result<bool> getTenGigaFlowControl(Positions pos = {}) const;
|
Result<bool> getTenGigaFlowControl(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Eiger, Jungfrau] */
|
/** [Eiger][Jungfrau] */
|
||||||
void setTenGigaFlowControl(bool enable, Positions pos = {});
|
void setTenGigaFlowControl(bool enable, Positions pos = {});
|
||||||
|
|
||||||
/** [Eiger, Jungfrau] */
|
/** [Eiger][Jungfrau][Mythen3] */
|
||||||
Result<int> getTransmissionDelayFrame(Positions pos = {}) const;
|
Result<int> getTransmissionDelayFrame(Positions pos = {}) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -543,6 +543,8 @@ class Detector {
|
|||||||
* streamed out of the module. Options: 0 - 31, each value represenets 1 ms
|
* streamed out of the module. Options: 0 - 31, each value represenets 1 ms
|
||||||
* [Eiger]: Sets the transmission delay of entire frame streamed out for
|
* [Eiger]: Sets the transmission delay of entire frame streamed out for
|
||||||
* both left and right UDP ports. Options: //TODO possible values
|
* both left and right UDP ports. Options: //TODO possible values
|
||||||
|
* [Mythen3] Options: [0-16777215] Each value represents 8 ns (125 MHz
|
||||||
|
* clock), max is 134 ms.
|
||||||
*/
|
*/
|
||||||
void setTransmissionDelayFrame(int value, Positions pos = {});
|
void setTransmissionDelayFrame(int value, Positions pos = {});
|
||||||
|
|
||||||
|
@ -1706,10 +1706,13 @@ class CmdProxy {
|
|||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND(
|
||||||
txndelay_frame, getTransmissionDelayFrame, setTransmissionDelayFrame,
|
txndelay_frame, getTransmissionDelayFrame, setTransmissionDelayFrame,
|
||||||
StringTo<int>,
|
StringTo<int>,
|
||||||
"[n_delay]\n\t[Eiger][Jungfrau] Transmission delay of each image being "
|
"[n_delay]\n\t[Eiger][Jungfrau][Mythen3] Transmission delay of each "
|
||||||
|
"image being "
|
||||||
"streamed out of the module.\n\t[Jungfrau] [0-31] Each value "
|
"streamed out of the module.\n\t[Jungfrau] [0-31] Each value "
|
||||||
"represents 1 ms\n\t[Eiger] Additional delay to txndelay_left and "
|
"represents 1 ms\n\t[Eiger] Additional delay to txndelay_left and "
|
||||||
"txndelay_right. Each value represents 10ns. Typical value is 50000.");
|
"txndelay_right. Each value represents 10ns. Typical value is "
|
||||||
|
"50000.\n\t[Mythen3] [0-16777215] Each value represents 8 ns (125 MHz "
|
||||||
|
"clock), max is 134 ms.");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND(
|
||||||
txndelay_left, getTransmissionDelayLeft, setTransmissionDelayLeft,
|
txndelay_left, getTransmissionDelayLeft, setTransmissionDelayLeft,
|
||||||
|
@ -1648,7 +1648,8 @@ TEST_CASE("txndelay_frame", "[.cmd][.new]") {
|
|||||||
Detector det;
|
Detector det;
|
||||||
CmdProxy proxy(&det);
|
CmdProxy proxy(&det);
|
||||||
auto det_type = det.getDetectorType().squash();
|
auto det_type = det.getDetectorType().squash();
|
||||||
if (det_type == defs::EIGER || det_type == defs::JUNGFRAU) {
|
if (det_type == defs::EIGER || det_type == defs::JUNGFRAU ||
|
||||||
|
det_type == defs::MYTHEN3) {
|
||||||
auto prev_val = det.getTransmissionDelayFrame();
|
auto prev_val = det.getTransmissionDelayFrame();
|
||||||
auto val = 5000;
|
auto val = 5000;
|
||||||
if (det_type == defs::JUNGFRAU) {
|
if (det_type == defs::JUNGFRAU) {
|
||||||
|
@ -7,6 +7,6 @@
|
|||||||
#define APIGOTTHARD 0x200810
|
#define APIGOTTHARD 0x200810
|
||||||
#define APIGOTTHARD2 0x200810
|
#define APIGOTTHARD2 0x200810
|
||||||
#define APIJUNGFRAU 0x200810
|
#define APIJUNGFRAU 0x200810
|
||||||
#define APIMYTHEN3 0x200810
|
|
||||||
#define APIMOENCH 0x200810
|
#define APIMOENCH 0x200810
|
||||||
#define APIEIGER 0x200818
|
#define APIMYTHEN3 0x200818
|
||||||
|
#define APIEIGER 0x200818
|
||||||
|
Loading…
x
Reference in New Issue
Block a user