Compare commits

..

7 Commits

Author SHA1 Message Date
641b40ffe0 fixed zmq path when building as submodule 2024-01-12 09:18:12 +01:00
bd1a125154 moench default speed set to after init readout configuration (half speed) (#886) 2024-01-11 18:07:34 +01:00
ffe7728966 formatting 2024-01-11 18:04:19 +01:00
b69e053bb4 updated commands generation 2024-01-11 18:03:34 +01:00
daec0dc389 minor 2024-01-11 18:02:30 +01:00
c8bb70f876 Dev/xilinx defaults and pattern (#888)
* implemented testbus, testfpga, set/get #frames, triggers, allowed that and for connection to client, also allowed, getnumchannels, configuremac, getrunstatus, setdetectorposition with dummy values

* connected kernelversion, hardwareversion, versions, framesl, triggersl, dr, timingmode, pattern (except patioctrl) thats there for altera ctb

* replaced set/get64Bit to set/getU64bit in all loadpattern.c for (ctb and m3 also)
2024-01-11 18:01:08 +01:00
9a08ecc5a5 Xilinx client tests (#887)
* implemented testbus, testfpga, set/get #frames, triggers, allowed that and for connection to client, also allowed, getnumchannels, configuremac, getrunstatus, setdetectorposition with dummy values

* allowing tests for xilinx

* binaries in
2024-01-10 16:23:52 +01:00
36 changed files with 2697 additions and 1638 deletions

View File

@ -33,7 +33,7 @@ else()
# Standard behaviour use libzmq included in this repo (libs/libzmq) # Standard behaviour use libzmq included in this repo (libs/libzmq)
FetchContent_Declare( FetchContent_Declare(
libzmq libzmq
URL ${CMAKE_SOURCE_DIR}/libs/libzmq/libzmq-4.3.4.tar.gz URL ${CMAKE_CURRENT_SOURCE_DIR}/libs/libzmq/libzmq-4.3.4.tar.gz
URL_HASH MD5=cc20b769ac10afa352e5ed2769bb23b3 URL_HASH MD5=cc20b769ac10afa352e5ed2769bb23b3
) )
endif() endif()

View File

@ -232,7 +232,7 @@ class Detector(CppDetectorApi):
@element @element
def hardwareversion(self): def hardwareversion(self):
""" """
[Jungfrau][Moench][Gotthard2][Myhten3][Gotthard][Ctb] Hardware version of detector. \n Hardware version of detector. \n
[Eiger] Hardware version of front FPGA on detector. [Eiger] Hardware version of front FPGA on detector.
""" """
return self.getHardwareVersion() return self.getHardwareVersion()
@ -308,7 +308,7 @@ class Detector(CppDetectorApi):
----- -----
[Eiger] Options: 4, 8, 12, 16, 32. If set to 32, also sets clkdivider to 2 (quarter speed), else to 0 (full speed)\n [Eiger] Options: 4, 8, 12, 16, 32. If set to 32, also sets clkdivider to 2 (quarter speed), else to 0 (full speed)\n
[Mythen3] Options: 8, 16, 32 \n [Mythen3] Options: 8, 16, 32 \n
[Jungfrau][Moench][Gotthard][Ctb][Mythen3][Gotthard2] 16 [Jungfrau][Moench][Gotthard][Ctb][Mythen3][Gotthard2][Xilinx Ctb] 16
""" """
return self.getDynamicRange() return self.getDynamicRange()
@ -400,7 +400,7 @@ class Detector(CppDetectorApi):
@element @element
def framesl(self): def framesl(self):
""" """
[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][CTB] Number of frames left in acquisition.\n [Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][CTB][Xilinx CTB] Number of frames left in acquisition.\n
Note Note
---- ----
@ -1951,7 +1951,7 @@ class Detector(CppDetectorApi):
@element @element
def triggersl(self): def triggersl(self):
""" """
[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][CTB] Number of triggers left in acquisition.\n [Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][CTB][Xilinx CTB] Number of triggers left in acquisition.\n
Note Note
---- ----
@ -2180,7 +2180,7 @@ class Detector(CppDetectorApi):
Note Note
----- -----
Default: AUTO_TIMING \n Default: AUTO_TIMING \n
[Jungfrau][Moench][Gotthard][Ctb][Gotthard2] AUTO_TIMING, TRIGGER_EXPOSURE \n [Jungfrau][Moench][Gotthard][Ctb][Gotthard2][Xilinx Ctb] AUTO_TIMING, TRIGGER_EXPOSURE \n
[Mythen3] AUTO_TIMING, TRIGGER_EXPOSURE, GATED, TRIGGER_GATED \n [Mythen3] AUTO_TIMING, TRIGGER_EXPOSURE, GATED, TRIGGER_GATED \n
[Eiger] AUTO_TIMING, TRIGGER_EXPOSURE, GATED, BURST_TRIGGER [Eiger] AUTO_TIMING, TRIGGER_EXPOSURE, GATED, BURST_TRIGGER
""" """
@ -3477,7 +3477,7 @@ class Detector(CppDetectorApi):
@property @property
def pattern(self): def pattern(self):
"""[Mythen3][Ctb] Loads ASCII pattern file directly to server (instead of executing line by line). """[Mythen3][Ctb][Xilinx Ctb] Loads ASCII pattern file directly to server (instead of executing line by line).
:getter: Not Implemented :getter: Not Implemented
@ -3495,7 +3495,7 @@ class Detector(CppDetectorApi):
@property @property
def patfname(self): def patfname(self):
""" """
[Ctb][Mythen3] Gets the pattern file name including path of the last pattern uploaded. Returns an empty if nothing was uploaded or via a server default [Ctb][Mythen3][Xilinx Ctb] Gets the pattern file name including path of the last pattern uploaded. Returns an empty if nothing was uploaded or via a server default
file file
""" """
return self.getPatterFileName() return self.getPatterFileName()
@ -3520,7 +3520,7 @@ class Detector(CppDetectorApi):
@property @property
@element @element
def patlimits(self): def patlimits(self):
"""[Ctb][Mythen3] Limits (start and stop address) of complete pattern. """[Ctb][Mythen3][Xilinx Ctb] Limits (start and stop address) of complete pattern.
Example Example
--------- ---------
@ -3540,7 +3540,7 @@ class Detector(CppDetectorApi):
@property @property
@element @element
def patsetbit(self): def patsetbit(self):
"""[Ctb][Mythen3] Sets the mask applied to every pattern to the selected bits. """[Ctb][Mythen3][Xilinx Ctb] Sets the mask applied to every pattern to the selected bits.
Example Example
-------- --------
@ -3557,7 +3557,7 @@ class Detector(CppDetectorApi):
@property @property
@element @element
def patmask(self): def patmask(self):
"""[Ctb][Mythen3] Selects the bits that will have a pattern mask applied to the selected patmask for every pattern. """[Ctb][Mythen3][Xilinx Ctb] Selects the bits that will have a pattern mask applied to the selected patmask for every pattern.
Example Example
-------- --------
@ -3575,7 +3575,7 @@ class Detector(CppDetectorApi):
# @element # @element
def patwait(self): def patwait(self):
""" """
[Ctb][Mythen3] Wait address of loop level provided. [Ctb][Mythen3][Xilinx Ctb] Wait address of loop level provided.
Example Example
------- -------
@ -3592,7 +3592,7 @@ class Detector(CppDetectorApi):
@property @property
@element @element
def patwait0(self): def patwait0(self):
"""[Ctb][Mythen3] Wait 0 address. """[Ctb][Mythen3][Xilinx Ctb] Wait 0 address.
Example Example
-------- --------
@ -3612,7 +3612,7 @@ class Detector(CppDetectorApi):
@property @property
@element @element
def patwait1(self): def patwait1(self):
"""[Ctb][Mythen3] Wait 1 address. """[Ctb][Mythen3][Xilinx Ctb] Wait 1 address.
Example Example
-------- --------
@ -3632,7 +3632,7 @@ class Detector(CppDetectorApi):
@property @property
@element @element
def patwait2(self): def patwait2(self):
"""[Ctb][Mythen3] Wait 2 address. """[Ctb][Mythen3][Xilinx Ctb] Wait 2 address.
Example Example
-------- --------
@ -3652,7 +3652,7 @@ class Detector(CppDetectorApi):
@property @property
def patwaittime(self): def patwaittime(self):
""" """
[Ctb][Mythen3] Wait time in clock cycles of loop level provided. [Ctb][Mythen3][Xilinx Ctb] Wait time in clock cycles of loop level provided.
Example Example
------- -------
@ -3669,7 +3669,7 @@ class Detector(CppDetectorApi):
@property @property
@element @element
def patwaittime0(self): def patwaittime0(self):
"""[Ctb][Mythen3] Wait 0 time in clock cycles.""" """[Ctb][Mythen3][Xilinx Ctb] Wait 0 time in clock cycles."""
return self.getPatternWaitTime(0) return self.getPatternWaitTime(0)
@patwaittime0.setter @patwaittime0.setter
@ -3680,7 +3680,7 @@ class Detector(CppDetectorApi):
@property @property
@element @element
def patwaittime1(self): def patwaittime1(self):
"""[Ctb][Mythen3] Wait 1 time in clock cycles.""" """[Ctb][Mythen3][Xilinx Ctb] Wait 1 time in clock cycles."""
return self.getPatternWaitTime(1) return self.getPatternWaitTime(1)
@patwaittime1.setter @patwaittime1.setter
@ -3691,7 +3691,7 @@ class Detector(CppDetectorApi):
@property @property
@element @element
def patwaittime2(self): def patwaittime2(self):
"""[Ctb][Mythen3] Wait 2 time in clock cycles.""" """[Ctb][Mythen3][Xilinx Ctb] Wait 2 time in clock cycles."""
return self.getPatternWaitTime(2) return self.getPatternWaitTime(2)
@patwaittime2.setter @patwaittime2.setter
@ -3703,7 +3703,7 @@ class Detector(CppDetectorApi):
@property @property
def patloop(self): def patloop(self):
""" """
[Ctb][Mythen3] Limits (start and stop address) of the loop provided. [Ctb][Mythen3][Xilinx Ctb] Limits (start and stop address) of the loop provided.
Example Example
------- -------
@ -3720,7 +3720,7 @@ class Detector(CppDetectorApi):
@property @property
@element @element
def patloop0(self): def patloop0(self):
"""[Ctb][Mythen3] Limits (start and stop address) of loop 0. """[Ctb][Mythen3][Xilinx Ctb] Limits (start and stop address) of loop 0.
Example Example
--------- ---------
@ -3740,7 +3740,7 @@ class Detector(CppDetectorApi):
@property @property
@element @element
def patloop1(self): def patloop1(self):
"""[Ctb][Mythen3] Limits (start and stop address) of loop 1. """[Ctb][Mythen3][Xilinx Ctb] Limits (start and stop address) of loop 1.
Example Example
--------- ---------
@ -3761,7 +3761,7 @@ class Detector(CppDetectorApi):
@property @property
@element @element
def patloop2(self): def patloop2(self):
"""[Ctb][Mythen3] Limits (start and stop address) of loop 2. """[Ctb][Mythen3][Xilinx Ctb] Limits (start and stop address) of loop 2.
Example Example
--------- ---------
@ -3783,7 +3783,7 @@ class Detector(CppDetectorApi):
@property @property
def patnloop(self): def patnloop(self):
""" """
[Ctb][Mythen3] Number of cycles of the loop provided. [Ctb][Mythen3][Xilinx Ctb] Number of cycles of the loop provided.
Example Example
------- -------
@ -3800,7 +3800,7 @@ class Detector(CppDetectorApi):
@property @property
@element @element
def patnloop0(self): def patnloop0(self):
"""[Ctb][Mythen3] Number of cycles of loop 0.""" """[Ctb][Mythen3][Xilinx Ctb] Number of cycles of loop 0."""
return self.getPatternLoopCycles(0) return self.getPatternLoopCycles(0)
@patnloop0.setter @patnloop0.setter
@ -3811,7 +3811,7 @@ class Detector(CppDetectorApi):
@property @property
@element @element
def patnloop1(self): def patnloop1(self):
"""[Ctb][Mythen3] Number of cycles of loop 1.""" """[Ctb][Mythen3][Xilinx Ctb] Number of cycles of loop 1."""
return self.getPatternLoopCycles(1) return self.getPatternLoopCycles(1)
@patnloop1.setter @patnloop1.setter
@ -3822,7 +3822,7 @@ class Detector(CppDetectorApi):
@property @property
@element @element
def patnloop2(self): def patnloop2(self):
"""[Ctb][Mythen3] Number of cycles of loop 2.""" """[Ctb][Mythen3][Xilinx Ctb] Number of cycles of loop 2."""
return self.getPatternLoopCycles(2) return self.getPatternLoopCycles(2)
@patnloop2.setter @patnloop2.setter

View File

@ -8,7 +8,8 @@ det_list=("ctbDetectorServer
gotthard2DetectorServer gotthard2DetectorServer
jungfrauDetectorServer jungfrauDetectorServer
mythen3DetectorServer mythen3DetectorServer
moenchDetectorServer" moenchDetectorServer
xilinx_ctbDetectorServer"
) )
usage="\nUsage: compileAllServers.sh [server|all(opt)] [branch(opt)]. \n\tNo arguments mean all servers with 'developer' branch. \n\tNo 'branch' input means 'developer branch'" usage="\nUsage: compileAllServers.sh [server|all(opt)] [branch(opt)]. \n\tNo arguments mean all servers with 'developer' branch. \n\tNo 'branch' input means 'developer branch'"

View File

@ -9,6 +9,7 @@ det_list=("ctbDetectorServer"
"jungfrauDetectorServer" "jungfrauDetectorServer"
"mythen3DetectorServer" "mythen3DetectorServer"
"moenchDetectorServer" "moenchDetectorServer"
"xilinx_ctbDetectorServer"
) )
usage="\nUsage: compileAllServers.sh [server|all(opt)] [branch(opt)]. \n\tNo arguments mean all servers with 'developer' branch. \n\tNo 'branch' input means 'developer branch'" usage="\nUsage: compileAllServers.sh [server|all(opt)] [branch(opt)]. \n\tNo arguments mean all servers with 'developer' branch. \n\tNo 'branch' input means 'developer branch'"

View File

@ -482,7 +482,6 @@ void setupDetector() {
return; return;
} }
setReadoutSpeed(DEFAULT_SPEED);
cleanFifos(); cleanFifos();
resetCore(); resetCore();
@ -496,6 +495,7 @@ void setupDetector() {
initReadoutConfiguration(); initReadoutConfiguration();
// Initialization of acquistion parameters // Initialization of acquistion parameters
setReadoutSpeed(DEFAULT_SPEED);
setSettings(DEFAULT_SETTINGS); setSettings(DEFAULT_SETTINGS);
setNumFrames(DEFAULT_NUM_FRAMES); setNumFrames(DEFAULT_NUM_FRAMES);
setNumTriggers(DEFAULT_NUM_CYCLES); setNumTriggers(DEFAULT_NUM_CYCLES);

View File

@ -5,6 +5,8 @@
#include <inttypes.h> #include <inttypes.h>
#include <sys/types.h> #include <sys/types.h>
int mapCSP0(void);
void bus_w(u_int32_t offset, u_int32_t data); void bus_w(u_int32_t offset, u_int32_t data);
u_int32_t bus_r(u_int32_t offset); u_int32_t bus_r(u_int32_t offset);
uint64_t getU64BitReg(int aLSB, int aMSB);
void setU64BitReg(uint64_t value, int aLSB, int aMSB);
int mapCSP0(void);

View File

@ -6,10 +6,12 @@
#include "clogger.h" #include "clogger.h"
void initializePatternAddresses(); void initializePatternAddresses();
#ifdef CHIPTESTBOARDD #if defined(CHIPTESTBOARDD) || defined(XILINX_CHIPTESTBOARDD)
#ifdef VIRTUAL #ifdef VIRTUAL
void initializePatternWord(); void initializePatternWord();
#endif #endif
#endif
#if defined(CHIPTESTBOARDD) // TODO || defined(XILINX_CHIPTESTBOARDD)
uint64_t validate_readPatternIOControl(); uint64_t validate_readPatternIOControl();
int validate_writePatternIOControl(char *message, uint64_t arg); int validate_writePatternIOControl(char *message, uint64_t arg);
void writePatternIOControl(uint64_t word); void writePatternIOControl(uint64_t word);

View File

@ -65,10 +65,8 @@ typedef struct udpStruct_s {
int isInitCheckDone(); int isInitCheckDone();
int getInitResult(char **mess); int getInitResult(char **mess);
void basictests(); void basictests();
#if !defined(EIGERD)
int checkType(); int checkType();
#if defined(GOTTHARDD) || defined(JUNGFRAUD) || defined(MOENCHD) || \
defined(CHIPTESTBOARDD) || defined(MYTHEN3D) || defined(GOTTHARD2D)
int testFpga(); int testFpga();
int testBus(); int testBus();
#endif #endif
@ -88,8 +86,8 @@ uint64_t getFrontEndFirmwareVersion(enum fpgaPosition fpgaPosition);
#endif #endif
#ifndef XILINX_CHIPTESTBOARDD #ifndef XILINX_CHIPTESTBOARDD
u_int64_t getFirmwareAPIVersion(); u_int64_t getFirmwareAPIVersion();
void getHardwareVersion(char *version);
#endif #endif
void getHardwareVersion(char *version);
#ifdef EIGERD #ifdef EIGERD
int getHardwareVersionNumber(); int getHardwareVersionNumber();
#else #else
@ -199,10 +197,8 @@ void setMasterSlaveConfiguration();
#endif #endif
// parameters - dr, roi // parameters - dr, roi
#ifndef XILINX_CHIPTESTBOARDD
int setDynamicRange(int dr); int setDynamicRange(int dr);
int getDynamicRange(int *retval); int getDynamicRange(int *retval);
#endif
#ifdef GOTTHARDD #ifdef GOTTHARDD
int setROI(ROI arg); int setROI(ROI arg);
ROI getROI(); ROI getROI();
@ -251,11 +247,11 @@ int getMaxStoragecellStart();
int setNextFrameNumber(uint64_t value); int setNextFrameNumber(uint64_t value);
int getNextFrameNumber(uint64_t *value); int getNextFrameNumber(uint64_t *value);
#endif #endif
#ifndef XILINX_CHIPTESTBOARDD
void setNumFrames(int64_t val); void setNumFrames(int64_t val);
int64_t getNumFrames(); int64_t getNumFrames();
void setNumTriggers(int64_t val); void setNumTriggers(int64_t val);
int64_t getNumTriggers(); int64_t getNumTriggers();
#ifndef XILINX_CHIPTESTBOARDD
#ifndef MYTHEN3D #ifndef MYTHEN3D
int setExpTime(int64_t val); int setExpTime(int64_t val);
int64_t getExpTime(); int64_t getExpTime();
@ -311,12 +307,15 @@ uint32_t getCounterMask();
void updatePacketizing(); void updatePacketizing();
#endif #endif
#ifndef EIGERD
int64_t getNumFramesLeft();
int64_t getNumTriggersLeft();
#endif
#if defined(JUNGFRAUD) || defined(MOENCHD) || defined(GOTTHARDD) || \ #if defined(JUNGFRAUD) || defined(MOENCHD) || defined(GOTTHARDD) || \
defined(CHIPTESTBOARDD) || defined(MYTHEN3D) || defined(GOTTHARD2D) defined(CHIPTESTBOARDD) || defined(MYTHEN3D) || defined(GOTTHARD2D)
int setDelayAfterTrigger(int64_t val); int setDelayAfterTrigger(int64_t val);
int64_t getDelayAfterTrigger(); int64_t getDelayAfterTrigger();
int64_t getNumFramesLeft();
int64_t getNumTriggersLeft();
int64_t getDelayAfterTriggerLeft(); int64_t getDelayAfterTriggerLeft();
int64_t getPeriodLeft(); int64_t getPeriodLeft();
#endif #endif
@ -447,10 +446,8 @@ void setSynchronization(int enable);
void updatingRegisters(); void updatingRegisters();
int updateClockDivs(); int updateClockDivs();
#endif #endif
#ifndef XILINX_CHIPTESTBOARDD
void setTiming(enum timingMode arg); void setTiming(enum timingMode arg);
enum timingMode getTiming(); enum timingMode getTiming();
#endif
#ifdef MYTHEN3D #ifdef MYTHEN3D
void setInitialExtSignals(); void setInitialExtSignals();
int setChipStatusRegister(int csr); int setChipStatusRegister(int csr);
@ -501,9 +498,7 @@ void calcChecksum(udp_header *udp);
int getAdcConfigured(); int getAdcConfigured();
#endif #endif
#ifndef XILINX_CHIPTESTBOARDD
int configureMAC(); int configureMAC();
#endif
int setDetectorPosition(int pos[]); int setDetectorPosition(int pos[]);
int *getDetectorPosition(); int *getDetectorPosition();
@ -715,9 +710,7 @@ int softwareTrigger(int block);
#if defined(EIGERD) || defined(MYTHEN3D) || defined(CHIPTESTBOARDD) #if defined(EIGERD) || defined(MYTHEN3D) || defined(CHIPTESTBOARDD)
int startReadOut(); int startReadOut();
#endif #endif
#ifndef XILINX_CHIPTESTBOARDD
enum runStatus getRunStatus(); enum runStatus getRunStatus();
#endif
#ifdef EIGERD #ifdef EIGERD
void waitForAcquisitionEnd(int *ret, char *mess); void waitForAcquisitionEnd(int *ret, char *mess);
#else #else
@ -748,9 +741,11 @@ u_int32_t runState(enum TLogLevel lev);
#ifndef XILINX_CHIPTESTBOARDD #ifndef XILINX_CHIPTESTBOARDD
int calculateDataBytes(); int calculateDataBytes();
int getTotalNumberOfChannels(); int getTotalNumberOfChannels();
#if defined(CHIPTESTBOARDD) #endif
#if defined(CHIPTESTBOARDD) || defined(XILINX_CHIPTESTBOARDD)
void getNumberOfChannels(int *nchanx, int *nchany); void getNumberOfChannels(int *nchanx, int *nchany);
#endif #endif
#ifndef XILINX_CHIPTESTBOARDD
int getNumberOfChips(); int getNumberOfChips();
int getNumberOfDACs(); int getNumberOfDACs();
int getNumberOfChannelsPerChip(); int getNumberOfChannelsPerChip();

View File

@ -10,9 +10,8 @@
#include <fcntl.h> // open #include <fcntl.h> // open
#include <sys/mman.h> // mmap #include <sys/mman.h> // mmap
/* global variables */ /* global variables */
#define CSP0 (0xB0010000)/// 0xB008_0000 #define CSP0 (0xB0010000)
#define MEM_SIZE 0x100000 #define MEM_SIZE 0x100000
u_int32_t *csp0base = 0; u_int32_t *csp0base = 0;
@ -59,7 +58,7 @@ int mapCSP0(void) {
return FAIL; return FAIL;
} }
LOG(logDEBUG1, ("/dev/mem opened\n")); LOG(logDEBUG1, ("/dev/mem opened\n"));
csp0base = (u_int32_t*)mmap(0, MEM_SIZE, PROT_READ | PROT_WRITE, csp0base = (u_int32_t *)mmap(0, MEM_SIZE, PROT_READ | PROT_WRITE,
MAP_FILE | MAP_SHARED, fd, CSP0); MAP_FILE | MAP_SHARED, fd, CSP0);
if (csp0base == MAP_FAILED) { if (csp0base == MAP_FAILED) {
LOG(logERROR, ("Can't map memmory area\n")); LOG(logERROR, ("Can't map memmory area\n"));
@ -72,4 +71,3 @@ int mapCSP0(void) {
LOG(logINFO, ("Memory already mapped before\n")); LOG(logINFO, ("Memory already mapped before\n"));
return OK; return OK;
} }

View File

@ -134,7 +134,6 @@ int getKernelVersion(char *retvals) {
return OK; return OK;
} }
int validateKernelVersion(char *expectedVersion) { int validateKernelVersion(char *expectedVersion) {
// extract kernel date string // extract kernel date string
char version[255] = {0}; char version[255] = {0};

View File

@ -13,7 +13,7 @@
extern enum TLogLevel trimmingPrint; extern enum TLogLevel trimmingPrint;
#endif #endif
#ifdef CHIPTESTBOARDD #if defined(CHIPTESTBOARDD) || defined(XILINX_CHIPTESTBOARDD)
#ifdef VIRTUAL #ifdef VIRTUAL
uint64_t virtual_pattern[MAX_PATTERN_LENGTH]; uint64_t virtual_pattern[MAX_PATTERN_LENGTH];
#endif #endif
@ -21,8 +21,8 @@ uint64_t virtual_pattern[MAX_PATTERN_LENGTH];
extern void bus_w(u_int32_t offset, u_int32_t data); extern void bus_w(u_int32_t offset, u_int32_t data);
extern u_int32_t bus_r(u_int32_t offset); extern u_int32_t bus_r(u_int32_t offset);
extern int64_t get64BitReg(int aLSB, int aMSB); // extern int64_t get64BitReg(int aLSB, int aMSB); TODO for all servers (only
extern int64_t set64BitReg(int64_t value, int aLSB, int aMSB); // uint64_t) extern int64_t set64BitReg(int64_t value, int aLSB, int aMSB);
extern uint64_t getU64BitReg(int aLSB, int aMSB); extern uint64_t getU64BitReg(int aLSB, int aMSB);
extern void setU64BitReg(uint64_t value, int aLSB, int aMSB); extern void setU64BitReg(uint64_t value, int aLSB, int aMSB);
@ -44,13 +44,15 @@ void initializePatternAddresses() {
} }
} }
#ifdef CHIPTESTBOARDD #if defined(CHIPTESTBOARDD) || defined(XILINX_CHIPTESTBOARDD)
#ifdef VIRTUAL #ifdef VIRTUAL
void initializePatternWord() { void initializePatternWord() {
memset(virtual_pattern, 0, sizeof(virtual_pattern)); memset(virtual_pattern, 0, sizeof(virtual_pattern));
} }
#endif #endif
#endif
#if defined(CHIPTESTBOARDD) // TODO || defined(XILINX_CHIPTESTBOARDD)
uint64_t validate_readPatternIOControl() { uint64_t validate_readPatternIOControl() {
return getU64BitReg(PATTERN_IO_CNTRL_LSB_REG, PATTERN_IO_CNTRL_MSB_REG); return getU64BitReg(PATTERN_IO_CNTRL_LSB_REG, PATTERN_IO_CNTRL_MSB_REG);
} }
@ -101,7 +103,7 @@ uint64_t readPatternWord(int addr) {
// the first word in RAM as base plus the offset of the word to write (addr) // the first word in RAM as base plus the offset of the word to write (addr)
uint32_t reg_lsb = PATTERN_STEP0_LSB_REG + addr * REG_OFFSET * 2; uint32_t reg_lsb = PATTERN_STEP0_LSB_REG + addr * REG_OFFSET * 2;
uint32_t reg_msb = PATTERN_STEP0_MSB_REG + addr * REG_OFFSET * 2; uint32_t reg_msb = PATTERN_STEP0_MSB_REG + addr * REG_OFFSET * 2;
return get64BitReg(reg_lsb, reg_msb); return getU64BitReg(reg_lsb, reg_msb);
#else #else
LOG(logDEBUG1, (" Reading (Executing) Pattern Word (addr:0x%x)\n", addr)); LOG(logDEBUG1, (" Reading (Executing) Pattern Word (addr:0x%x)\n", addr));
uint32_t reg = PATTERN_CNTRL_REG; uint32_t reg = PATTERN_CNTRL_REG;
@ -118,7 +120,7 @@ uint64_t readPatternWord(int addr) {
// read value // read value
#ifndef VIRTUAL #ifndef VIRTUAL
return get64BitReg(PATTERN_OUT_LSB_REG, PATTERN_OUT_MSB_REG); return getU64BitReg(PATTERN_OUT_LSB_REG, PATTERN_OUT_MSB_REG);
#else #else
return virtual_pattern[addr]; return virtual_pattern[addr];
#endif #endif
@ -160,7 +162,7 @@ void writePatternWord(int addr, uint64_t word) {
uint32_t reg = PATTERN_CNTRL_REG; uint32_t reg = PATTERN_CNTRL_REG;
// write word // write word
set64BitReg(word, PATTERN_IN_LSB_REG, PATTERN_IN_MSB_REG); setU64BitReg(word, PATTERN_IN_LSB_REG, PATTERN_IN_MSB_REG);
// overwrite with only addr // overwrite with only addr
bus_w(reg, ((addr << PATTERN_CNTRL_ADDR_OFST) & PATTERN_CNTRL_ADDR_MSK)); bus_w(reg, ((addr << PATTERN_CNTRL_ADDR_OFST) & PATTERN_CNTRL_ADDR_MSK));
@ -178,7 +180,7 @@ void writePatternWord(int addr, uint64_t word) {
// the first word in RAM as base plus the offset of the word to write (addr) // the first word in RAM as base plus the offset of the word to write (addr)
uint32_t reg_lsb = PATTERN_STEP0_LSB_REG + addr * REG_OFFSET * 2; uint32_t reg_lsb = PATTERN_STEP0_LSB_REG + addr * REG_OFFSET * 2;
uint32_t reg_msb = PATTERN_STEP0_MSB_REG + addr * REG_OFFSET * 2; uint32_t reg_msb = PATTERN_STEP0_MSB_REG + addr * REG_OFFSET * 2;
set64BitReg(word, reg_lsb, reg_msb); setU64BitReg(word, reg_lsb, reg_msb);
#endif #endif
} }
@ -311,23 +313,23 @@ int validate_getPatternWaitTime(char *message, int level, uint64_t *waittime) {
uint64_t getPatternWaitTime(int level) { uint64_t getPatternWaitTime(int level) {
switch (level) { switch (level) {
case 0: case 0:
return get64BitReg(PATTERN_WAIT_TIMER_0_LSB_REG, return getU64BitReg(PATTERN_WAIT_TIMER_0_LSB_REG,
PATTERN_WAIT_TIMER_0_MSB_REG); PATTERN_WAIT_TIMER_0_MSB_REG);
case 1: case 1:
return get64BitReg(PATTERN_WAIT_TIMER_1_LSB_REG, return getU64BitReg(PATTERN_WAIT_TIMER_1_LSB_REG,
PATTERN_WAIT_TIMER_1_MSB_REG); PATTERN_WAIT_TIMER_1_MSB_REG);
case 2: case 2:
return get64BitReg(PATTERN_WAIT_TIMER_2_LSB_REG, return getU64BitReg(PATTERN_WAIT_TIMER_2_LSB_REG,
PATTERN_WAIT_TIMER_2_MSB_REG); PATTERN_WAIT_TIMER_2_MSB_REG);
#ifndef MYTHEN3D #ifndef MYTHEN3D
case 3: case 3:
return get64BitReg(PATTERN_WAIT_TIMER_3_LSB_REG, return getU64BitReg(PATTERN_WAIT_TIMER_3_LSB_REG,
PATTERN_WAIT_TIMER_3_MSB_REG); PATTERN_WAIT_TIMER_3_MSB_REG);
case 4: case 4:
return get64BitReg(PATTERN_WAIT_TIMER_4_LSB_REG, return getU64BitReg(PATTERN_WAIT_TIMER_4_LSB_REG,
PATTERN_WAIT_TIMER_4_MSB_REG); PATTERN_WAIT_TIMER_4_MSB_REG);
case 5: case 5:
return get64BitReg(PATTERN_WAIT_TIMER_5_LSB_REG, return getU64BitReg(PATTERN_WAIT_TIMER_5_LSB_REG,
PATTERN_WAIT_TIMER_5_MSB_REG); PATTERN_WAIT_TIMER_5_MSB_REG);
#endif #endif
default: default:
@ -369,28 +371,28 @@ void setPatternWaitTime(int level, uint64_t t) {
(long long int)t)); (long long int)t));
switch (level) { switch (level) {
case 0: case 0:
set64BitReg(t, PATTERN_WAIT_TIMER_0_LSB_REG, setU64BitReg(t, PATTERN_WAIT_TIMER_0_LSB_REG,
PATTERN_WAIT_TIMER_0_MSB_REG); PATTERN_WAIT_TIMER_0_MSB_REG);
break; break;
case 1: case 1:
set64BitReg(t, PATTERN_WAIT_TIMER_1_LSB_REG, setU64BitReg(t, PATTERN_WAIT_TIMER_1_LSB_REG,
PATTERN_WAIT_TIMER_1_MSB_REG); PATTERN_WAIT_TIMER_1_MSB_REG);
break; break;
case 2: case 2:
set64BitReg(t, PATTERN_WAIT_TIMER_2_LSB_REG, setU64BitReg(t, PATTERN_WAIT_TIMER_2_LSB_REG,
PATTERN_WAIT_TIMER_2_MSB_REG); PATTERN_WAIT_TIMER_2_MSB_REG);
break; break;
#ifndef MYTHEN3D #ifndef MYTHEN3D
case 3: case 3:
set64BitReg(t, PATTERN_WAIT_TIMER_3_LSB_REG, setU64BitReg(t, PATTERN_WAIT_TIMER_3_LSB_REG,
PATTERN_WAIT_TIMER_3_MSB_REG); PATTERN_WAIT_TIMER_3_MSB_REG);
break; break;
case 4: case 4:
set64BitReg(t, PATTERN_WAIT_TIMER_4_LSB_REG, setU64BitReg(t, PATTERN_WAIT_TIMER_4_LSB_REG,
PATTERN_WAIT_TIMER_4_MSB_REG); PATTERN_WAIT_TIMER_4_MSB_REG);
break; break;
case 5: case 5:
set64BitReg(t, PATTERN_WAIT_TIMER_5_LSB_REG, setU64BitReg(t, PATTERN_WAIT_TIMER_5_LSB_REG,
PATTERN_WAIT_TIMER_5_MSB_REG); PATTERN_WAIT_TIMER_5_MSB_REG);
break; break;
#endif #endif
@ -775,7 +777,7 @@ int loadPattern(char *message, enum TLogLevel printLevel,
} }
} }
// iocontrol // iocontrol
#ifndef MYTHEN3D #if !defined(MYTHEN3D) && !defined(XILINX_CHIPTESTBOARDD) // TODO
if (ret == OK) { if (ret == OK) {
ret = validate_writePatternIOControl(message, pat->ioctrl); ret = validate_writePatternIOControl(message, pat->ioctrl);
} }
@ -835,7 +837,7 @@ int getPattern(char *message, patternParameters *pat) {
pat->word[i] = retval64; pat->word[i] = retval64;
} }
// iocontrol // iocontrol
#ifndef MYTHEN3D #if !defined(MYTHEN3D) && !defined(XILINX_CHIPTESTBOARDD) // TODO
if (ret == OK) { if (ret == OK) {
validate_readPatternIOControl(); validate_readPatternIOControl();
} }
@ -956,7 +958,7 @@ int loadPatternFile(char *patFname, char *errMessage) {
uint64_t word = 0; uint64_t word = 0;
// cannot scan values // cannot scan values
#ifdef VIRTUAL #if defined(VIRTUAL) || defined(XILINX_CHIPTESTBOARDD)
if (sscanf(line, "%s 0x%x 0x%lx", command, &addr, &word) != 3) { if (sscanf(line, "%s 0x%x 0x%lx", command, &addr, &word) != 3) {
#else #else
if (sscanf(line, "%s 0x%x 0x%llx", command, &addr, &word) != 3) { if (sscanf(line, "%s 0x%x 0x%llx", command, &addr, &word) != 3) {
@ -971,7 +973,7 @@ int loadPatternFile(char *patFname, char *errMessage) {
} }
// patioctrl // patioctrl
#ifndef MYTHEN3D #if !defined(MYTHEN3D) && !defined(XILINX_CHIPTESTBOARDD) // TODO
if (!strncmp(line, "patioctrl", strlen("patioctrl"))) { if (!strncmp(line, "patioctrl", strlen("patioctrl"))) {
uint64_t arg = 0; uint64_t arg = 0;
@ -1063,7 +1065,7 @@ int loadPatternFile(char *patFname, char *errMessage) {
uint64_t waittime = 0; uint64_t waittime = 0;
// cannot scan values // cannot scan values
#ifdef VIRTUAL #if defined(VIRTUAL) || defined(XILINX_CHIPTESTBOARDD)
if (sscanf(line, "%s %d %ld", command, &level, &waittime) != 3) { if (sscanf(line, "%s %d %ld", command, &level, &waittime) != 3) {
#else #else
if (sscanf(line, "%s %d %lld", command, &level, &waittime) != 3) { if (sscanf(line, "%s %d %lld", command, &level, &waittime) != 3) {

View File

@ -7,7 +7,8 @@
#include "sls/sls_detector_funcs.h" #include "sls/sls_detector_funcs.h"
#include "slsDetectorFunctionList.h" #include "slsDetectorFunctionList.h"
#if defined(CHIPTESTBOARDD) || defined(MYTHEN3D) #if defined(CHIPTESTBOARDD) || defined(XILINX_CHIPTESTBOARDD) || \
defined(MYTHEN3D)
#include "Pattern.h" #include "Pattern.h"
#include "loadPattern.h" #include "loadPattern.h"
#endif #endif
@ -719,9 +720,6 @@ int set_timing_mode(int file_des) {
return printSocketReadError(); return printSocketReadError();
LOG(logDEBUG1, ("Setting external communication mode to %d\n", arg)); LOG(logDEBUG1, ("Setting external communication mode to %d\n", arg));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// set // set
if (((int)arg != GET_FLAG) && (Server_VerifyLock() == OK)) { if (((int)arg != GET_FLAG) && (Server_VerifyLock() == OK)) {
switch (arg) { switch (arg) {
@ -758,7 +756,7 @@ int set_timing_mode(int file_des) {
validate(&ret, mess, (int)arg, (int)retval, "set timing mode", DEC); validate(&ret, mess, (int)arg, (int)retval, "set timing mode", DEC);
#endif #endif
LOG(logDEBUG1, ("Timing Mode: %d\n", retval)); LOG(logDEBUG1, ("Timing Mode: %d\n", retval));
#endif
return Server_SendResult(file_des, INT32, &retval, sizeof(retval)); return Server_SendResult(file_des, INT32, &retval, sizeof(retval));
} }
@ -2219,9 +2217,6 @@ int get_num_frames(int file_des) {
memset(mess, 0, sizeof(mess)); memset(mess, 0, sizeof(mess));
int64_t retval = -1; int64_t retval = -1;
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// get only // get only
if (!scan) { if (!scan) {
retval = getNumFrames(); retval = getNumFrames();
@ -2231,7 +2226,6 @@ int get_num_frames(int file_des) {
LOG(logDEBUG1, ("retval num frames (num scan steps) %lld\n", LOG(logDEBUG1, ("retval num frames (num scan steps) %lld\n",
(long long int)retval)); (long long int)retval));
} }
#endif
return Server_SendResult(file_des, INT64, &retval, sizeof(retval)); return Server_SendResult(file_des, INT64, &retval, sizeof(retval));
} }
@ -2244,9 +2238,6 @@ int set_num_frames(int file_des) {
return printSocketReadError(); return printSocketReadError();
LOG(logDEBUG1, ("Setting number of frames %lld\n", (long long int)arg)); LOG(logDEBUG1, ("Setting number of frames %lld\n", (long long int)arg));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// only set // only set
if (Server_VerifyLock() == OK) { if (Server_VerifyLock() == OK) {
// only set number of frames if normal mode (not scan) // only set number of frames if normal mode (not scan)
@ -2292,7 +2283,6 @@ int set_num_frames(int file_des) {
} }
} }
} }
#endif
return Server_SendResult(file_des, INT64, NULL, 0); return Server_SendResult(file_des, INT64, NULL, 0);
} }
@ -2301,13 +2291,9 @@ int get_num_triggers(int file_des) {
memset(mess, 0, sizeof(mess)); memset(mess, 0, sizeof(mess));
int64_t retval = -1; int64_t retval = -1;
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// get only // get only
retval = getNumTriggers(); retval = getNumTriggers();
LOG(logDEBUG1, ("retval num triggers %lld\n", (long long int)retval)); LOG(logDEBUG1, ("retval num triggers %lld\n", (long long int)retval));
#endif
return Server_SendResult(file_des, INT64, &retval, sizeof(retval)); return Server_SendResult(file_des, INT64, &retval, sizeof(retval));
} }
@ -2320,9 +2306,6 @@ int set_num_triggers(int file_des) {
return printSocketReadError(); return printSocketReadError();
LOG(logDEBUG1, ("Setting number of triggers %lld\n", (long long int)arg)); LOG(logDEBUG1, ("Setting number of triggers %lld\n", (long long int)arg));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// only set // only set
if (Server_VerifyLock() == OK) { if (Server_VerifyLock() == OK) {
#if JUNGFRAUD #if JUNGFRAUD
@ -2342,7 +2325,6 @@ int set_num_triggers(int file_des) {
validate64(&ret, mess, arg, retval, "set number of triggers", DEC); validate64(&ret, mess, arg, retval, "set number of triggers", DEC);
} }
} }
#endif
return Server_SendResult(file_des, INT64, NULL, 0); return Server_SendResult(file_des, INT64, NULL, 0);
} }
@ -2896,7 +2878,8 @@ int get_frames_left(int file_des) {
int64_t retval = -1; int64_t retval = -1;
#if !defined(JUNGFRAUD) && !defined(MOENCHD) && !defined(GOTTHARDD) && \ #if !defined(JUNGFRAUD) && !defined(MOENCHD) && !defined(GOTTHARDD) && \
!defined(CHIPTESTBOARDD) && !defined(MYTHEN3D) && !defined(GOTTHARD2D) !defined(CHIPTESTBOARDD) && !defined(MYTHEN3D) && !defined(GOTTHARD2D) && \
!defined(XILINX_CHIPTESTBOARDD)
functionNotImplemented(); functionNotImplemented();
#else #else
// get only // get only
@ -2912,7 +2895,8 @@ int get_triggers_left(int file_des) {
int64_t retval = -1; int64_t retval = -1;
#if !defined(JUNGFRAUD) && !defined(MOENCHD) && !defined(GOTTHARDD) && \ #if !defined(JUNGFRAUD) && !defined(MOENCHD) && !defined(GOTTHARDD) && \
!defined(CHIPTESTBOARDD) && !defined(MYTHEN3D) && !defined(GOTTHARD2D) !defined(CHIPTESTBOARDD) && !defined(MYTHEN3D) && !defined(GOTTHARD2D) && \
!defined(XILINX_CHIPTESTBOARDD)
functionNotImplemented(); functionNotImplemented();
#else #else
// get only // get only
@ -3062,9 +3046,6 @@ int set_dynamic_range(int file_des) {
return printSocketReadError(); return printSocketReadError();
LOG(logDEBUG1, ("Setting dr to %d\n", dr)); LOG(logDEBUG1, ("Setting dr to %d\n", dr));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// set & get // set & get
if ((dr == GET_FLAG) || (Server_VerifyLock() == OK)) { if ((dr == GET_FLAG) || (Server_VerifyLock() == OK)) {
// check dr // check dr
@ -3085,7 +3066,8 @@ int set_dynamic_range(int file_des) {
case 32: case 32:
#endif #endif
#if defined(GOTTHARDD) || defined(JUNGFRAUD) || defined(MOENCHD) || \ #if defined(GOTTHARDD) || defined(JUNGFRAUD) || defined(MOENCHD) || \
defined(CHIPTESTBOARDD) || defined(GOTTHARD2D) defined(CHIPTESTBOARDD) || defined(GOTTHARD2D) || \
defined(XILINX_CHIPTESTBOARDD)
case 16: case 16:
#endif #endif
if (dr >= 0) { if (dr >= 0) {
@ -3113,7 +3095,6 @@ int set_dynamic_range(int file_des) {
break; break;
} }
} }
#endif
return Server_SendResult(file_des, INT32, &retval, sizeof(retval)); return Server_SendResult(file_des, INT32, &retval, sizeof(retval));
} }
@ -3359,7 +3340,8 @@ int set_pattern_word(int file_des) {
if (receiveData(file_des, args, sizeof(args), INT64) < 0) if (receiveData(file_des, args, sizeof(args), INT64) < 0)
return printSocketReadError(); return printSocketReadError();
#if !defined(CHIPTESTBOARDD) && !defined(MYTHEN3D) #if !defined(CHIPTESTBOARDD) && !defined(XILINX_CHIPTESTBOARDD) && \
!defined(MYTHEN3D)
functionNotImplemented(); functionNotImplemented();
#else #else
int addr = (int)args[0]; int addr = (int)args[0];
@ -3387,7 +3369,8 @@ int set_pattern_loop_addresses(int file_des) {
if (receiveData(file_des, args, sizeof(args), INT32) < 0) if (receiveData(file_des, args, sizeof(args), INT32) < 0)
return printSocketReadError(); return printSocketReadError();
#if !defined(CHIPTESTBOARDD) && !defined(MYTHEN3D) #if !defined(CHIPTESTBOARDD) && !defined(XILINX_CHIPTESTBOARDD) && \
!defined(MYTHEN3D)
functionNotImplemented(); functionNotImplemented();
#else #else
int loopLevel = args[0]; int loopLevel = args[0];
@ -3433,7 +3416,8 @@ int set_pattern_loop_cycles(int file_des) {
if (receiveData(file_des, args, sizeof(args), INT32) < 0) if (receiveData(file_des, args, sizeof(args), INT32) < 0)
return printSocketReadError(); return printSocketReadError();
#if !defined(CHIPTESTBOARDD) && !defined(MYTHEN3D) #if !defined(CHIPTESTBOARDD) && !defined(XILINX_CHIPTESTBOARDD) && \
!defined(MYTHEN3D)
functionNotImplemented(); functionNotImplemented();
#else #else
int loopLevel = args[0]; int loopLevel = args[0];
@ -3462,7 +3446,8 @@ int set_pattern_wait_addr(int file_des) {
if (receiveData(file_des, args, sizeof(args), INT32) < 0) if (receiveData(file_des, args, sizeof(args), INT32) < 0)
return printSocketReadError(); return printSocketReadError();
#if !defined(CHIPTESTBOARDD) && !defined(MYTHEN3D) #if !defined(CHIPTESTBOARDD) && !defined(XILINX_CHIPTESTBOARDD) && \
!defined(MYTHEN3D)
functionNotImplemented(); functionNotImplemented();
#else #else
int loopLevel = args[0]; int loopLevel = args[0];
@ -3491,7 +3476,8 @@ int set_pattern_wait_time(int file_des) {
if (receiveData(file_des, args, sizeof(args), INT32) < 0) if (receiveData(file_des, args, sizeof(args), INT32) < 0)
return printSocketReadError(); return printSocketReadError();
#if !defined(CHIPTESTBOARDD) && !defined(MYTHEN3D) #if !defined(CHIPTESTBOARDD) && !defined(XILINX_CHIPTESTBOARDD) && \
!defined(MYTHEN3D)
functionNotImplemented(); functionNotImplemented();
#else #else
int loopLevel = (int)args[0]; int loopLevel = (int)args[0];
@ -3521,7 +3507,8 @@ int set_pattern_mask(int file_des) {
return printSocketReadError(); return printSocketReadError();
LOG(logDEBUG1, ("Set Pattern Mask to %d\n", arg)); LOG(logDEBUG1, ("Set Pattern Mask to %d\n", arg));
#if !defined(CHIPTESTBOARDD) && !defined(MYTHEN3D) #if !defined(CHIPTESTBOARDD) && !defined(XILINX_CHIPTESTBOARDD) && \
!defined(MYTHEN3D)
functionNotImplemented(); functionNotImplemented();
#else #else
// only set // only set
@ -3549,7 +3536,8 @@ int get_pattern_mask(int file_des) {
LOG(logDEBUG1, ("Get Pattern Mask\n")); LOG(logDEBUG1, ("Get Pattern Mask\n"));
#if !defined(CHIPTESTBOARDD) && !defined(MYTHEN3D) #if !defined(CHIPTESTBOARDD) && !defined(XILINX_CHIPTESTBOARDD) && \
!defined(MYTHEN3D)
functionNotImplemented(); functionNotImplemented();
#else #else
// only get // only get
@ -3570,7 +3558,8 @@ int set_pattern_bit_mask(int file_des) {
return printSocketReadError(); return printSocketReadError();
LOG(logDEBUG1, ("Set Pattern Bit Mask to %d\n", arg)); LOG(logDEBUG1, ("Set Pattern Bit Mask to %d\n", arg));
#if !defined(CHIPTESTBOARDD) && !defined(MYTHEN3D) #if !defined(CHIPTESTBOARDD) && !defined(XILINX_CHIPTESTBOARDD) && \
!defined(MYTHEN3D)
functionNotImplemented(); functionNotImplemented();
#else #else
// only set // only set
@ -3599,7 +3588,8 @@ int get_pattern_bit_mask(int file_des) {
LOG(logDEBUG1, ("Get Pattern Bit Mask\n")); LOG(logDEBUG1, ("Get Pattern Bit Mask\n"));
#if !defined(CHIPTESTBOARDD) && !defined(MYTHEN3D) #if !defined(CHIPTESTBOARDD) && !defined(XILINX_CHIPTESTBOARDD) && \
!defined(MYTHEN3D)
functionNotImplemented(); functionNotImplemented();
#else #else
// only get // only get
@ -3622,7 +3612,8 @@ int write_adc_register(int file_des) {
uint32_t val = args[1]; uint32_t val = args[1];
LOG(logDEBUG1, ("Writing 0x%x to ADC Register 0x%x\n", val, addr)); LOG(logDEBUG1, ("Writing 0x%x to ADC Register 0x%x\n", val, addr));
#if defined(EIGERD) || defined(GOTTHARD2D) || defined(MYTHEN3D) #if defined(EIGERD) || defined(GOTTHARD2D) || defined(MYTHEN3D) || \
defined(XILINX_CHIPTESTBOARDD)
functionNotImplemented(); functionNotImplemented();
#else #else
#ifndef VIRTUAL #ifndef VIRTUAL
@ -4017,7 +4008,7 @@ int reset_fpga(int file_des) {
LOG(logDEBUG1, ("Reset FPGA\n")); LOG(logDEBUG1, ("Reset FPGA\n"));
#if defined(EIGERD) || defined(GOTTHARDD) || defined(GOTTHARD2D) || \ #if defined(EIGERD) || defined(GOTTHARDD) || defined(GOTTHARD2D) || \
defined(MYTHEN3D) defined(MYTHEN3D) || defined(XILINX_CHIPTESTBOARDD)
functionNotImplemented(); functionNotImplemented();
#else #else
// only set // only set
@ -5026,9 +5017,6 @@ int set_detector_position(int file_des) {
LOG(logDEBUG, ("Setting detector positions: [maxy:%u, modIndex:%u]\n", LOG(logDEBUG, ("Setting detector positions: [maxy:%u, modIndex:%u]\n",
args[0], args[1])); args[0], args[1]));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// only set // only set
if (Server_VerifyLock() == OK) { if (Server_VerifyLock() == OK) {
// if in update mode, there is no need to do this (also detector not set // if in update mode, there is no need to do this (also detector not set
@ -5039,14 +5027,10 @@ int set_detector_position(int file_des) {
calculate_and_set_position(); calculate_and_set_position();
} }
} }
#endif
return Server_SendResult(file_des, INT32, NULL, 0); return Server_SendResult(file_des, INT32, NULL, 0);
} }
int check_detector_idle(const char *s) { int check_detector_idle(const char *s) {
#ifdef XILINX_CHIPTESTBOARDD
return FAIL;
#else
enum runStatus status = getRunStatus(); enum runStatus status = getRunStatus();
if (status != IDLE && status != RUN_FINISHED && status != STOPPED && if (status != IDLE && status != RUN_FINISHED && status != STOPPED &&
status != ERROR) { status != ERROR) {
@ -5058,7 +5042,6 @@ int check_detector_idle(const char *s) {
LOG(logERROR, (mess)); LOG(logERROR, (mess));
} }
return ret; return ret;
#endif
} }
int is_udp_configured() { int is_udp_configured() {
@ -5125,7 +5108,6 @@ int is_udp_configured() {
} }
void configure_mac() { void configure_mac() {
#ifndef XILINX_CHIPTESTBOARDD
if (isControlServer) { if (isControlServer) {
if (is_udp_configured() == OK) { if (is_udp_configured() == OK) {
ret = configureMAC(); ret = configureMAC();
@ -5152,7 +5134,6 @@ void configure_mac() {
} }
configured = FAIL; configured = FAIL;
LOG(logWARNING, ("Configure FAIL, not all parameters configured yet\n")); LOG(logWARNING, ("Configure FAIL, not all parameters configured yet\n"));
#endif
} }
int set_source_udp_ip(int file_des) { int set_source_udp_ip(int file_des) {
@ -7105,7 +7086,7 @@ int get_num_channels(int file_des) {
LOG(logDEBUG1, ("Getting number of channels\n")); LOG(logDEBUG1, ("Getting number of channels\n"));
#if !defined(CHIPTESTBOARDD) #if !defined(CHIPTESTBOARDD) && !defined(XILINX_CHIPTESTBOARDD)
functionNotImplemented(); functionNotImplemented();
#else #else
// get only // get only
@ -7827,7 +7808,8 @@ int set_pattern(int file_des) {
char args[MAX_STR_LENGTH]; char args[MAX_STR_LENGTH];
memset(args, 0, MAX_STR_LENGTH); memset(args, 0, MAX_STR_LENGTH);
#if !defined(CHIPTESTBOARDD) && !defined(MYTHEN3D) #if !defined(CHIPTESTBOARDD) && !defined(XILINX_CHIPTESTBOARDD) && \
!defined(MYTHEN3D)
functionNotImplemented(); functionNotImplemented();
#else #else
@ -7864,7 +7846,8 @@ int get_pattern_file(int file_des) {
LOG(logDEBUG1, ("Getting pattern file name\n")); LOG(logDEBUG1, ("Getting pattern file name\n"));
#if !defined(CHIPTESTBOARDD) && !defined(MYTHEN3D) #if !defined(CHIPTESTBOARDD) && !defined(XILINX_CHIPTESTBOARDD) && \
!defined(MYTHEN3D)
functionNotImplemented(); functionNotImplemented();
#else #else
// get only // get only
@ -7878,7 +7861,8 @@ int get_pattern(int file_des) {
ret = OK; ret = OK;
memset(mess, 0, sizeof(mess)); memset(mess, 0, sizeof(mess));
#if !defined(CHIPTESTBOARDD) && !defined(MYTHEN3D) #if !defined(CHIPTESTBOARDD) && !defined(XILINX_CHIPTESTBOARDD) && \
!defined(MYTHEN3D)
functionNotImplemented(); functionNotImplemented();
return Server_SendResult(file_des, INT32, NULL, 0); return Server_SendResult(file_des, INT32, NULL, 0);
#else #else
@ -9753,9 +9737,7 @@ int get_kernel_version(int file_des) {
memset(retvals, 0, MAX_STR_LENGTH); memset(retvals, 0, MAX_STR_LENGTH);
LOG(logDEBUG1, ("Getting kernel version\n")); LOG(logDEBUG1, ("Getting kernel version\n"));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// get only // get only
ret = getKernelVersion(retvals); ret = getKernelVersion(retvals);
if (ret == FAIL) { if (ret == FAIL) {
@ -9768,7 +9750,6 @@ int get_kernel_version(int file_des) {
} else { } else {
LOG(logDEBUG1, ("kernel version: [%s]\n", retvals)); LOG(logDEBUG1, ("kernel version: [%s]\n", retvals));
} }
#endif
return Server_SendResult(file_des, OTHER, retvals, sizeof(retvals)); return Server_SendResult(file_des, OTHER, retvals, sizeof(retvals));
} }
@ -10530,12 +10511,10 @@ int get_hardware_version(int file_des) {
memset(mess, 0, sizeof(mess)); memset(mess, 0, sizeof(mess));
char retvals[MAX_STR_LENGTH]; char retvals[MAX_STR_LENGTH];
memset(retvals, 0, MAX_STR_LENGTH); memset(retvals, 0, MAX_STR_LENGTH);
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
getHardwareVersion(retvals); getHardwareVersion(retvals);
LOG(logDEBUG1, ("hardware version retval: %s\n", retvals)); LOG(logDEBUG1, ("hardware version retval: %s\n", retvals));
#endif
return Server_SendResult(file_des, OTHER, retvals, sizeof(retvals)); return Server_SendResult(file_des, OTHER, retvals, sizeof(retvals));
} }

View File

@ -8,6 +8,7 @@ add_executable(xilinx_ctbDetectorServer_virtual
../slsDetectorServer/src/arm64.c ../slsDetectorServer/src/arm64.c
../slsDetectorServer/src/common.c ../slsDetectorServer/src/common.c
../slsDetectorServer/src/sharedMemory.c ../slsDetectorServer/src/sharedMemory.c
../slsDetectorServer/src/loadPattern.c
../../slsSupportLib/src/md5.c ../../slsSupportLib/src/md5.c
) )

View File

@ -18,7 +18,7 @@ DESTDIR ?= bin
INSTMODE = 0777 INSTMODE = 0777
SRCS = slsDetectorFunctionList.c SRCS = slsDetectorFunctionList.c
SRCS += $(main_src)slsDetectorServer.c $(main_src)slsDetectorServer_funcs.c $(main_src)communication_funcs.c $(main_src)arm64.c $(main_src)common.c $(main_src)/sharedMemory.c $(md5_dir)md5.c SRCS += $(main_src)slsDetectorServer.c $(main_src)slsDetectorServer_funcs.c $(main_src)communication_funcs.c $(main_src)arm64.c $(main_src)common.c $(main_src)/sharedMemory.c $(main_src)/loadPattern.c $(md5_dir)md5.c
OBJS = $(SRCS:.c=.o) OBJS = $(SRCS:.c=.o)

File diff suppressed because it is too large Load Diff

View File

@ -7,10 +7,11 @@
#include "sharedMemory.h" #include "sharedMemory.h"
#include "sls/versionAPI.h" #include "sls/versionAPI.h"
#include "loadPattern.h"
#include <arpa/inet.h> // INET_ADDRSTRLEN
#include <string.h> #include <string.h>
#include <unistd.h> // usleep #include <unistd.h> // usleep
#include <arpa/inet.h> // INET_ADDRSTRLEN
// Global variable from slsDetectorServer_funcs // Global variable from slsDetectorServer_funcs
extern int debugflag; extern int debugflag;
@ -51,14 +52,10 @@ void basictests() {
} }
#ifndef VIRTUAL #ifndef VIRTUAL
/*if ((!debugflag) && (!updateFlag) &&
((validateKernelVersion(KERNEL_DATE_VRSN) == FAIL) ||
(checkType() == FAIL) || (testFpga() == FAIL) ||
(testBus() == FAIL))) {*/
if ((!debugflag) && (!updateFlag) && if ((!debugflag) && (!updateFlag) &&
((validateKernelVersion(KERNEL_DATE_VRSN) == FAIL) || ((validateKernelVersion(KERNEL_DATE_VRSN) == FAIL) ||
(checkType() == FAIL) /*|| (testFpga() == FAIL) || (checkType() == FAIL) || (testFpga() == FAIL) ||
(testBus() == FAIL)*/)) { (testBus() == FAIL))) {
sprintf(initErrorMessage, sprintf(initErrorMessage,
"Could not pass basic tests of FPGA and bus. Cannot proceed. " "Could not pass basic tests of FPGA and bus. Cannot proceed. "
"Check Firmware. (Firmware version:0x%lx) \n", "Check Firmware. (Firmware version:0x%lx) \n",
@ -92,8 +89,7 @@ int checkType() {
#ifdef VIRTUAL #ifdef VIRTUAL
return OK; return OK;
#endif #endif
u_int32_t type = u_int32_t type = ((bus_r(FPGAVERSIONREG) & DETTYPE_MSK) >> DETTYPE_OFST);
((bus_r(FPGAVERSIONREG) & DETTYPE_MSK) >> DETTYPE_OFST);
if (type != XILINX_CHIPTESTBOARD) { if (type != XILINX_CHIPTESTBOARD) {
LOG(logERROR, LOG(logERROR,
("This is not a Xilinx CTB firmware (read %d, expected %d)\n", type, ("This is not a Xilinx CTB firmware (read %d, expected %d)\n", type,
@ -103,6 +99,122 @@ int checkType() {
return OK; return OK;
} }
int testFpga() {
#ifdef VIRTUAL
return OK;
#endif
LOG(logINFO, ("Testing FPGA:\n"));
// fixed pattern
int ret = OK;
/* TODO: FIX PATTERN not defined in firmware
uint32_t val = bus_r(FIX_PATT_REG);
if (val == FIX_PATT_VAL) {
LOG(logINFO, ("\tFixed pattern: successful match (0x%08x)\n", val));
} else {
LOG(logERROR,
("Fixed pattern does not match! Read 0x%08x, expected 0x%08x\n",
val, FIX_PATT_VAL));
ret = FAIL;
}
*/
if (ret == OK) {
// Delay LSB reg
LOG(logINFO, ("\tTesting Delay LSB Register:\n"));
uint32_t addr = DELAYINREG1;
// store previous delay value
uint32_t previousValue = bus_r(addr);
volatile uint32_t val = 0, readval = 0;
int times = 1000 * 1000;
for (int i = 0; i < times; ++i) {
val = 0x5A5A5A5A - i;
bus_w(addr, val);
readval = bus_r(addr);
if (readval != val) {
LOG(logERROR, ("1:Mismatch! Loop(%d): Wrote 0x%x, read 0x%x\n",
i, val, readval));
ret = FAIL;
break;
}
val = (i + (i << 10) + (i << 20));
bus_w(addr, val);
readval = bus_r(addr);
if (readval != val) {
LOG(logERROR, ("2:Mismatch! Loop(%d): Wrote 0x%x, read 0x%x\n",
i, val, readval));
ret = FAIL;
break;
}
val = 0x0F0F0F0F;
bus_w(addr, val);
readval = bus_r(addr);
if (readval != val) {
LOG(logERROR, ("3:Mismatch! Loop(%d): Wrote 0x%x, read 0x%x\n",
i, val, readval));
ret = FAIL;
break;
}
val = 0xF0F0F0F0;
bus_w(addr, val);
readval = bus_r(addr);
if (readval != val) {
LOG(logERROR, ("4:Mismatch! Loop(%d): Wrote 0x%x, read 0x%x\n",
i, val, readval));
ret = FAIL;
break;
}
}
// write back previous value
bus_w(addr, previousValue);
if (ret == OK) {
LOG(logINFO,
("\tSuccessfully tested FPGA Delay LSB Register %d times\n",
times));
}
}
return ret;
}
int testBus() {
#ifdef VIRTUAL
return OK;
#endif
LOG(logINFO, ("Testing Bus:\n"));
int ret = OK;
uint32_t addr = DELAYINREG1;
// store previous delay value
uint32_t previousValue = bus_r(addr);
volatile uint32_t val = 0, readval = 0;
int times = 1000 * 1000;
for (int i = 0; i < times; ++i) {
val += 0xbbbbb;
bus_w(addr, val);
readval = bus_r(addr);
if (readval != val) {
LOG(logERROR, ("Mismatch! Loop(%d): Wrote 0x%x, read 0x%x\n", i,
val, readval));
ret = FAIL;
}
}
// write back previous value
bus_w(addr, previousValue);
if (ret == OK) {
LOG(logINFO, ("\tSuccessfully tested bus %d times\n", times));
}
return ret;
}
/* Ids */ /* Ids */
void getServerVersion(char *version) { strcpy(version, APIXILINXCTB); } void getServerVersion(char *version) { strcpy(version, APIXILINXCTB); }
@ -114,6 +226,8 @@ uint64_t getFirmwareVersion() {
return ((bus_r(FPGAVERSIONREG) & COMPDATE_MSK) >> COMPDATE_OFST); return ((bus_r(FPGAVERSIONREG) & COMPDATE_MSK) >> COMPDATE_OFST);
} }
void getHardwareVersion(char *version) { strcpy(version, "Not applicable"); }
u_int64_t getDetectorMAC() { u_int64_t getDetectorMAC() {
#ifdef VIRTUAL #ifdef VIRTUAL
return 0; return 0;
@ -194,18 +308,128 @@ void initStopServer() {
/* set up detector */ /* set up detector */
void setupDetector() { void setupDetector() {
LOG(logINFO, ("This Server is for 1 Xilinx Chip Test Board\n")); LOG(logINFO, ("Setting up Server for 1 Xilinx Chip Test Board\n"));
#ifdef VIRTUAL #ifdef VIRTUAL
sharedMemory_setStatus(IDLE); sharedMemory_setStatus(IDLE);
initializePatternWord();
#endif #endif
LOG(logINFO, ("Goodbye...\n"));
LOG(logINFOBLUE, ("Setting Default parameters\n"));
initializePatternAddresses();
setNumFrames(DEFAULT_NUM_FRAMES);
setNumTriggers(DEFAULT_NUM_CYCLES);
setTiming(DEFAULT_TIMING_MODE);
}
/* set parameters - dr */
int setDynamicRange(int dr) {
if (dr == 16)
return OK;
return FAIL;
}
int getDynamicRange(int *retval) {
*retval = DYNAMIC_RANGE;
return OK;
}
/* parameters - timer */
void setNumFrames(int64_t val) {
if (val > 0) {
LOG(logINFO, ("Setting number of frames %ld\n", val));
setU64BitReg(val, FRAMESINREG1, FRAMESINREG2);
}
}
int64_t getNumFrames() { return getU64BitReg(FRAMESINREG1, FRAMESINREG2); }
void setNumTriggers(int64_t val) {
if (val > 0) {
LOG(logINFO, ("Setting number of triggers %ld\n", val));
setU64BitReg(val, CYCLESINREG1, CYCLESINREG2);
}
}
int64_t getNumTriggers() { return getU64BitReg(CYCLESINREG1, CYCLESINREG2); }
int64_t getNumFramesLeft() {
return getU64BitReg(FRAMESOUTREG1, FRAMESOUTREG2);
}
int64_t getNumTriggersLeft() {
return getU64BitReg(CYCLESOUTREG1, CYCLESOUTREG2);
}
/* parameters - timing, extsig */
void setTiming(enum timingMode arg) {
switch (arg) {
case AUTO_TIMING:
LOG(logINFO, ("Set Timing: Auto\n"));
bus_w(FLOWCONTROLREG, bus_r(FLOWCONTROLREG) & ~TRIGGERENABLE_MSK);
break;
case TRIGGER_EXPOSURE:
LOG(logINFO, ("Set Timing: Trigger\n"));
bus_w(FLOWCONTROLREG, bus_r(FLOWCONTROLREG) | TRIGGERENABLE_MSK);
break;
default:
LOG(logERROR, ("Unknown timing mode %d\n", arg));
}
}
enum timingMode getTiming() {
if (bus_r(FLOWCONTROLREG) == TRIGGERENABLE_MSK)
return TRIGGER_EXPOSURE;
return AUTO_TIMING;
} }
int setDetectorPosition(int pos[]) { int setDetectorPosition(int pos[]) {
memcpy(detPos, pos, sizeof(detPos)); memcpy(detPos, pos, sizeof(detPos));
// TODO
return OK;
}
int configureMAC() {
// TODO
LOG(logINFO, ("Configuring MAC\n"));
return OK; return OK;
} }
int *getDetectorPosition() { return detPos; } int *getDetectorPosition() { return detPos; }
int getNumberofUDPInterfaces() { return 1; } int getNumberofUDPInterfaces() { return 1; }
/* aquisition */
enum runStatus getRunStatus() {
LOG(logDEBUG1, ("Getting status\n"));
// scan error or running
if (sharedMemory_getScanStatus() == ERROR) {
LOG(logINFOBLUE, ("Status: scan ERROR\n"));
return ERROR;
}
if (sharedMemory_getScanStatus() == RUNNING) {
LOG(logINFOBLUE, ("Status: scan RUNNING\n"));
return RUNNING;
}
#ifdef VIRTUAL
if (sharedMemory_getStatus() == RUNNING) {
LOG(logINFOBLUE, ("Status: RUNNING\n"));
return RUNNING;
}
LOG(logINFOBLUE, ("Status: IDLE\n"));
return IDLE;
#endif
// TODO: get status
LOG(logINFOBLUE, ("Status: IDLE\n"));
return IDLE;
}
void getNumberOfChannels(int *nchanx, int *nchany) {
// TODO
*nchanx = NCHAN;
*nchany = 1;
}

View File

@ -16,3 +16,12 @@
enum ADCINDEX { V_PWR_IO }; enum ADCINDEX { V_PWR_IO };
enum DACINDEX { D0 }; enum DACINDEX { D0 };
/** Default Parameters */
#define DEFAULT_NUM_FRAMES (1)
#define DEFAULT_NUM_CYCLES (1)
#define DYNAMIC_RANGE (16)
#define DEFAULT_TIMING_MODE (AUTO_TIMING)
/* Defines in the Firmware */
#define WAIT_TIME_PATTERN_READ (10)

View File

@ -585,7 +585,7 @@ patioctrl:
function: setPatternIOControl function: setPatternIOControl
patmask: patmask:
help: "[64 bit mask]\n\t[Ctb][Mythen3] Selects the bits that will have a pattern mask applied to the selected patmask for every pattern." help: "[64 bit mask]\n\t[Ctb][Mythen3][Xilinx Ctb] Selects the bits that will have a pattern mask applied to the selected patmask for every pattern."
inherit_actions: INTEGER_COMMAND_HEX_WIDTH16 inherit_actions: INTEGER_COMMAND_HEX_WIDTH16
actions: actions:
GET: GET:
@ -594,7 +594,7 @@ patmask:
function: setPatternMask function: setPatternMask
patsetbit: patsetbit:
help: "[64 bit mask]\n\t[Ctb][Mythen3] Sets the mask applied to every pattern to the selected bits." help: "[64 bit mask]\n\t[Ctb][Mythen3][Xilinx Ctb] Sets the mask applied to every pattern to the selected bits."
inherit_actions: INTEGER_COMMAND_HEX_WIDTH16 inherit_actions: INTEGER_COMMAND_HEX_WIDTH16
actions: actions:
GET: GET:
@ -688,7 +688,7 @@ column:
function: setColumn function: setColumn
timing: timing:
help: "[auto|trigger|gating|burst_trigger]\n\tTiming Mode of detector.\n\t[Jungfrau][Moench][Gotthard][Ctb][Gotthard2] [auto|trigger]\n\t[Mythen3] [auto|trigger|gating|trigger_gating]\n\t[Eiger] [auto|trigger|gating|burst_trigger]" help: "[auto|trigger|gating|burst_trigger]\n\tTiming Mode of detector.\n\t[Jungfrau][Moench][Gotthard][Ctb][Gotthard2][Xilinx Ctb] [auto|trigger]\n\t[Mythen3] [auto|trigger|gating|trigger_gating]\n\t[Eiger] [auto|trigger|gating|burst_trigger]"
inherit_actions: INTEGER_COMMAND_VEC_ID inherit_actions: INTEGER_COMMAND_VEC_ID
actions: actions:
GET: GET:
@ -1506,7 +1506,7 @@ triggers:
dr: dr:
inherit_actions: INTEGER_COMMAND_SET_NOID_GET_ID inherit_actions: INTEGER_COMMAND_SET_NOID_GET_ID
help: "[value]\n\tDynamic Range or number of bits per pixel in detector.\n\t[Eiger] Options: 4, 8, 12, 16, 32. If set to 32, also sets clkdivider to 2, else to 0.\n\t[Mythen3] Options: 8, 16, 32\n\t[Jungfrau][Moench][Gotthard][Ctb][Mythen3][Gotthard2] 16" help: "[value]\n\tDynamic Range or number of bits per pixel in detector.\n\t[Eiger] Options: 4, 8, 12, 16, 32. If set to 32, also sets clkdivider to 2, else to 0.\n\t[Mythen3] Options: 8, 16, 32\n\t[Jungfrau][Moench][Gotthard][Ctb][Mythen3][Gotthard2][Xilinx Ctb] 16"
actions: actions:
GET: GET:
function: getDynamicRange function: getDynamicRange
@ -1835,7 +1835,7 @@ parameters:
savepattern: savepattern:
inherit_actions: EXECUTE_SET_COMMAND_NOID_1ARG inherit_actions: EXECUTE_SET_COMMAND_NOID_1ARG
help: "\n\t[Ctb][Mythen3] Saves pattern to file (ascii). \n\t[Ctb] Also executes pattern." help: "\n\t[Ctb][Mythen3][Xilinx Ctb] Saves pattern to file (ascii). \n\t[Ctb] Also executes pattern."
actions: actions:
PUT: PUT:
function: savePattern function: savePattern
@ -1850,7 +1850,7 @@ detectorserverversion:
hardwareversion: hardwareversion:
inherit_actions: GET_COMMAND inherit_actions: GET_COMMAND
help: "\n\t[Jungfrau][Gotthard2][Myhten3][Gotthard][Ctb][Moench] Hardware version of detector. \n\t[Eiger] Hardware version of front FPGA on detector." help: "\n\tHardware version of detector. \n\t[Eiger] Hardware version of front FPGA on detector."
actions: actions:
GET: GET:
function: getHardwareVersion function: getHardwareVersion
@ -1885,14 +1885,14 @@ type:
framesl: framesl:
inherit_actions: GET_COMMAND inherit_actions: GET_COMMAND
help: "\n\t[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Number of frames left in acquisition. \n\t[Gotthard2] only in continuous auto mode." help: "\n\t[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb][Xilinx Ctb] Number of frames left in acquisition. \n\t[Gotthard2] only in continuous auto mode."
actions: actions:
GET: GET:
function: getNumberOfFramesLeft function: getNumberOfFramesLeft
triggersl: triggersl:
inherit_actions: GET_COMMAND inherit_actions: GET_COMMAND
help: "\n\t[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Number of triggers left in acquisition. Only when external trigger used." help: "\n\t[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb][Xilinx Ctb] Number of triggers left in acquisition. Only when external trigger used."
actions: actions:
GET: GET:
function: getNumberOfTriggersLeft function: getNumberOfTriggersLeft
@ -1997,7 +1997,7 @@ syncclk:
patfname: patfname:
inherit_actions: GET_COMMAND inherit_actions: GET_COMMAND
help: "\n\t[Ctb][Mythen3] Gets the pattern file name including path of the last pattern uploaded. Returns an empty if nothing was uploaded or via a server default file" help: "\n\t[Ctb][Mythen3][Xilinx Ctb] Gets the pattern file name including path of the last pattern uploaded. Returns an empty if nothing was uploaded or via a server default file"
actions: actions:
GET: GET:
function: getPatterFileName function: getPatterFileName
@ -3842,7 +3842,7 @@ diodelay:
# pattern is a keyword in yaml, so patternX is used to avoid it # pattern is a keyword in yaml, so patternX is used to avoid it
patternX: patternX:
help: "[fname]\n\t[Mythen3][Ctb] Loads ASCII pattern file directly to server (instead of executing line by line)" help: "[fname]\n\t[Mythen3][Ctb][Xilinx Ctb] Loads ASCII pattern file directly to server (instead of executing line by line)"
command_name: "pattern" command_name: "pattern"
actions: actions:
PUT: PUT:
@ -3855,7 +3855,7 @@ patternX:
output: [ 'args.front()' ] output: [ 'args.front()' ]
patword: patword:
help: "[step or address] [64 bit mask]\n\t[Ctb][Mythen3] 64 bit pattern at address of pattern memory.\n\t[Ctb] read is same as executing pattern" help: "[step or address] [64 bit mask]\n\t[Ctb][Mythen3][Xilinx Ctb] 64 bit pattern at address of pattern memory.\n\t[Ctb] read is same as executing pattern"
actions: actions:
GET: GET:
argc: 1 argc: 1
@ -3875,7 +3875,7 @@ patword:
output: [ "'['", "ToStringHex(arg0, 4)", '", "', "ToStringHex(arg1, 16)", '"]"' ] output: [ "'['", "ToStringHex(arg0, 4)", '", "', "ToStringHex(arg1, 16)", '"]"' ]
patlimits: patlimits:
help: "[start addr] [stop addr] \n\t[Ctb][Mythen3] Limits of complete pattern" help: "[start addr] [stop addr] \n\t[Ctb][Mythen3][Xilinx Ctb] Limits of complete pattern"
actions: actions:
GET: GET:
argc: -1 argc: -1
@ -3895,7 +3895,7 @@ patlimits:
output: [ "'['" , "ToStringHex(arg1, 4)" , '", "' , "ToStringHex(arg2, 4)", "']'" ] output: [ "'['" , "ToStringHex(arg1, 4)" , '", "' , "ToStringHex(arg2, 4)", "']'" ]
patloop: patloop:
help: "[0-6] [start addr] [stop addr] \n\t[Ctb][Mythen3] Limits of the loop level provided.\n\t[Mythen3] Level options: 0-3 only." help: "[0-6] [start addr] [stop addr] \n\t[Ctb][Mythen3][Xilinx Ctb] Limits of the loop level provided.\n\t[Mythen3] Level options: 0-3 only."
actions: actions:
GET: GET:
argc: -1 argc: -1
@ -3944,7 +3944,7 @@ patloop2:
inherit_actions: patloop0 inherit_actions: patloop0
patnloop: patnloop:
help: "[0-6] [n_cycles] \n\t[Ctb][Mythen3] Number of cycles of the loop level provided.\n\t[Mythen3] Level options: 0-3 only." help: "[0-6] [n_cycles] \n\t[Ctb][Mythen3][Xilinx Ctb] Number of cycles of the loop level provided.\n\t[Mythen3] Level options: 0-3 only."
actions: actions:
GET: GET:
argc: -1 argc: -1
@ -3991,7 +3991,7 @@ patnloop2:
inherit_actions: patnloop0 inherit_actions: patnloop0
patwait: patwait:
help: "[0-6] [addr] \n\t[Ctb][Mythen3] Wait address for loop level provided. \n\t[Mythen3] Level options: 0-3 only." help: "[0-6] [addr] \n\t[Ctb][Mythen3][Xilinx Ctb] Wait address for loop level provided. \n\t[Mythen3] Level options: 0-3 only."
actions: actions:
GET: GET:
argc: -1 argc: -1
@ -4037,7 +4037,7 @@ patwait2:
inherit_actions: patwait0 inherit_actions: patwait0
patwaittime: patwaittime:
help: "[0-6] [n_clk] \n\t[Ctb][Mythen3] Wait time in clock cycles for the loop provided.\n\t[Mythen3] Level options: 0-3 only." help: "[0-6] [n_clk] \n\t[Ctb][Mythen3][Xilinx Ctb] Wait time in clock cycles for the loop provided.\n\t[Mythen3] Level options: 0-3 only."
actions: actions:
GET: GET:
argc: -1 argc: -1

View File

@ -2703,8 +2703,8 @@ dr:
function_alias: dr function_alias: dr
help: "[value]\n\tDynamic Range or number of bits per pixel in detector.\n\t[Eiger]\ help: "[value]\n\tDynamic Range or number of bits per pixel in detector.\n\t[Eiger]\
\ Options: 4, 8, 12, 16, 32. If set to 32, also sets clkdivider to 2, else to\ \ Options: 4, 8, 12, 16, 32. If set to 32, also sets clkdivider to 2, else to\
\ 0.\n\t[Mythen3] Options: 8, 16, 32\n\t[Jungfrau][Moench][Gotthard][Ctb][Mythen3][Gotthard2]\ \ 0.\n\t[Mythen3] Options: 8, 16, 32\n\t[Jungfrau][Moench][Gotthard][Ctb][Mythen3][Gotthard2][Xilinx\
\ 16" \ Ctb] 16"
infer_action: true infer_action: true
template: true template: true
drlist: drlist:
@ -3970,8 +3970,8 @@ framesl:
store_result_in_t: true store_result_in_t: true
command_name: framesl command_name: framesl
function_alias: framesl function_alias: framesl
help: "\n\t[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Number of frames\ help: "\n\t[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb][Xilinx Ctb] Number\
\ left in acquisition. \n\t[Gotthard2] only in continuous auto mode." \ of frames left in acquisition. \n\t[Gotthard2] only in continuous auto mode."
infer_action: true infer_action: true
template: true template: true
frametime: frametime:
@ -4703,8 +4703,8 @@ hardwareversion:
store_result_in_t: true store_result_in_t: true
command_name: hardwareversion command_name: hardwareversion
function_alias: hardwareversion function_alias: hardwareversion
help: "\n\t[Jungfrau][Gotthard2][Myhten3][Gotthard][Ctb][Moench] Hardware version\ help: "\n\tHardware version of detector. \n\t[Eiger] Hardware version of front FPGA\
\ of detector. \n\t[Eiger] Hardware version of front FPGA on detector." \ on detector."
infer_action: true infer_action: true
template: true template: true
highvoltage: highvoltage:
@ -5730,9 +5730,9 @@ patfname:
store_result_in_t: true store_result_in_t: true
command_name: patfname command_name: patfname
function_alias: patfname function_alias: patfname
help: "\n\t[Ctb][Mythen3] Gets the pattern file name including path of the last\ help: "\n\t[Ctb][Mythen3][Xilinx Ctb] Gets the pattern file name including path\
\ pattern uploaded. Returns an empty if nothing was uploaded or via a server default\ \ of the last pattern uploaded. Returns an empty if nothing was uploaded or via\
\ file" \ a server default file"
infer_action: true infer_action: true
template: true template: true
patioctrl: patioctrl:
@ -5826,7 +5826,8 @@ patlimits:
store_result_in_t: false store_result_in_t: false
command_name: patlimits command_name: patlimits
function_alias: patlimits function_alias: patlimits
help: "[start addr] [stop addr] \n\t[Ctb][Mythen3] Limits of complete pattern" help: "[start addr] [stop addr] \n\t[Ctb][Mythen3][Xilinx Ctb] Limits of complete\
\ pattern"
infer_action: true infer_action: true
patloop: patloop:
actions: actions:
@ -5899,8 +5900,8 @@ patloop:
store_result_in_t: false store_result_in_t: false
command_name: patloop command_name: patloop
function_alias: patloop function_alias: patloop
help: "[0-6] [start addr] [stop addr] \n\t[Ctb][Mythen3] Limits of the loop level\ help: "[0-6] [start addr] [stop addr] \n\t[Ctb][Mythen3][Xilinx Ctb] Limits of the\
\ provided.\n\t[Mythen3] Level options: 0-3 only." \ loop level provided.\n\t[Mythen3] Level options: 0-3 only."
infer_action: true infer_action: true
patloop0: patloop0:
actions: actions:
@ -6145,8 +6146,8 @@ patmask:
store_result_in_t: false store_result_in_t: false
command_name: patmask command_name: patmask
function_alias: patmask function_alias: patmask
help: "[64 bit mask]\n\t[Ctb][Mythen3] Selects the bits that will have a pattern\ help: "[64 bit mask]\n\t[Ctb][Mythen3][Xilinx Ctb] Selects the bits that will have\
\ mask applied to the selected patmask for every pattern." \ a pattern mask applied to the selected patmask for every pattern."
infer_action: true infer_action: true
template: true template: true
patnloop: patnloop:
@ -6209,8 +6210,8 @@ patnloop:
store_result_in_t: false store_result_in_t: false
command_name: patnloop command_name: patnloop
function_alias: patnloop function_alias: patnloop
help: "[0-6] [n_cycles] \n\t[Ctb][Mythen3] Number of cycles of the loop level provided.\n\ help: "[0-6] [n_cycles] \n\t[Ctb][Mythen3][Xilinx Ctb] Number of cycles of the loop\
\t[Mythen3] Level options: 0-3 only." \ level provided.\n\t[Mythen3] Level options: 0-3 only."
infer_action: true infer_action: true
patnloop0: patnloop0:
actions: actions:
@ -6422,8 +6423,8 @@ patsetbit:
store_result_in_t: false store_result_in_t: false
command_name: patsetbit command_name: patsetbit
function_alias: patsetbit function_alias: patsetbit
help: "[64 bit mask]\n\t[Ctb][Mythen3] Sets the mask applied to every pattern to\ help: "[64 bit mask]\n\t[Ctb][Mythen3][Xilinx Ctb] Sets the mask applied to every\
\ the selected bits." \ pattern to the selected bits."
infer_action: true infer_action: true
template: true template: true
patternX: patternX:
@ -6448,8 +6449,8 @@ patternX:
store_result_in_t: false store_result_in_t: false
command_name: pattern command_name: pattern
function_alias: pattern function_alias: pattern
help: "[fname]\n\t[Mythen3][Ctb] Loads ASCII pattern file directly to server (instead\ help: "[fname]\n\t[Mythen3][Ctb][Xilinx Ctb] Loads ASCII pattern file directly to\
\ of executing line by line)" \ server (instead of executing line by line)"
infer_action: true infer_action: true
patternstart: patternstart:
actions: actions:
@ -6532,8 +6533,8 @@ patwait:
store_result_in_t: false store_result_in_t: false
command_name: patwait command_name: patwait
function_alias: patwait function_alias: patwait
help: "[0-6] [addr] \n\t[Ctb][Mythen3] Wait address for loop level provided. \n\t\ help: "[0-6] [addr] \n\t[Ctb][Mythen3][Xilinx Ctb] Wait address for loop level provided.\
[Mythen3] Level options: 0-3 only." \ \n\t[Mythen3] Level options: 0-3 only."
infer_action: true infer_action: true
patwait0: patwait0:
actions: actions:
@ -6769,8 +6770,8 @@ patwaittime:
store_result_in_t: false store_result_in_t: false
command_name: patwaittime command_name: patwaittime
function_alias: patwaittime function_alias: patwaittime
help: "[0-6] [n_clk] \n\t[Ctb][Mythen3] Wait time in clock cycles for the loop provided.\n\ help: "[0-6] [n_clk] \n\t[Ctb][Mythen3][Xilinx Ctb] Wait time in clock cycles for\
\t[Mythen3] Level options: 0-3 only." \ the loop provided.\n\t[Mythen3] Level options: 0-3 only."
infer_action: true infer_action: true
patwaittime0: patwaittime0:
actions: actions:
@ -6998,8 +6999,8 @@ patword:
store_result_in_t: false store_result_in_t: false
command_name: patword command_name: patword
function_alias: patword function_alias: patword
help: "[step or address] [64 bit mask]\n\t[Ctb][Mythen3] 64 bit pattern at address\ help: "[step or address] [64 bit mask]\n\t[Ctb][Mythen3][Xilinx Ctb] 64 bit pattern\
\ of pattern memory.\n\t[Ctb] read is same as executing pattern" \ at address of pattern memory.\n\t[Ctb] read is same as executing pattern"
infer_action: true infer_action: true
pedestalmode: pedestalmode:
actions: actions:
@ -9438,8 +9439,8 @@ savepattern:
store_result_in_t: false store_result_in_t: false
command_name: savepattern command_name: savepattern
function_alias: savepattern function_alias: savepattern
help: "\n\t[Ctb][Mythen3] Saves pattern to file (ascii). \n\t[Ctb] Also executes\ help: "\n\t[Ctb][Mythen3][Xilinx Ctb] Saves pattern to file (ascii). \n\t[Ctb] Also\
\ pattern." \ executes pattern."
infer_action: true infer_action: true
template: true template: true
scan: scan:
@ -11229,8 +11230,8 @@ timing:
store_result_in_t: false store_result_in_t: false
command_name: timing command_name: timing
function_alias: timing function_alias: timing
help: "[auto|trigger|gating|burst_trigger]\n\tTiming Mode of detector.\n\t[Jungfrau][Moench][Gotthard][Ctb][Gotthard2]\ help: "[auto|trigger|gating|burst_trigger]\n\tTiming Mode of detector.\n\t[Jungfrau][Moench][Gotthard][Ctb][Gotthard2][Xilinx\
\ [auto|trigger]\n\t[Mythen3] [auto|trigger|gating|trigger_gating]\n\t[Eiger]\ \ Ctb] [auto|trigger]\n\t[Mythen3] [auto|trigger|gating|trigger_gating]\n\t[Eiger]\
\ [auto|trigger|gating|burst_trigger]" \ [auto|trigger|gating|burst_trigger]"
infer_action: true infer_action: true
template: true template: true
@ -11459,8 +11460,8 @@ triggersl:
store_result_in_t: true store_result_in_t: true
command_name: triggersl command_name: triggersl
function_alias: triggersl function_alias: triggersl
help: "\n\t[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Number of triggers\ help: "\n\t[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb][Xilinx Ctb] Number\
\ left in acquisition. Only when external trigger used." \ of triggers left in acquisition. Only when external trigger used."
infer_action: true infer_action: true
template: true template: true
trimbits: trimbits:

View File

@ -322,11 +322,11 @@ class Detector {
/** [Gotthard][Jungfrau][Moench][CTB][Mythen3][Gotthard2] */ /** [Gotthard][Jungfrau][Moench][CTB][Mythen3][Gotthard2] */
void setDelayAfterTrigger(ns value, Positions pos = {}); void setDelayAfterTrigger(ns value, Positions pos = {});
/** [Gotthard][Jungfrau][Moench][CTB][Mythen3] /** [Gotthard][Jungfrau][Moench][CTB][Mythen3][Xilinx CTB]
* [Gotthard2] only in continuous auto mode */ * [Gotthard2] only in continuous auto mode */
Result<int64_t> getNumberOfFramesLeft(Positions pos = {}) const; Result<int64_t> getNumberOfFramesLeft(Positions pos = {}) const;
/** [Gotthard][Jungfrau][Moench][CTB][Mythen3] /** [Gotthard][Jungfrau][Moench][CTB][Mythen3][Xilinx CTB]
* Only when external trigger used */ * Only when external trigger used */
Result<int64_t> getNumberOfTriggersLeft(Positions pos = {}) const; Result<int64_t> getNumberOfTriggersLeft(Positions pos = {}) const;
@ -343,7 +343,7 @@ class Detector {
/** /**
* [Eiger] Options: 4, 8, 12, 16, 32. If i is 32, also sets clkdivider to 2, * [Eiger] Options: 4, 8, 12, 16, 32. If i is 32, also sets clkdivider to 2,
* else sets clkdivider to 1 \n [Mythen3] Options: 8, 16, 32 \n * else sets clkdivider to 1 \n [Mythen3] Options: 8, 16, 32 \n
* [Jungfrau][Moench][Gotthard][Ctb][Mythen3][Gotthard2] 16 * [Jungfrau][Moench][Gotthard][CTB][Mythen3][Gotthard2][Xilinx CTB] 16
*/ */
void setDynamicRange(int value); void setDynamicRange(int value);
@ -353,10 +353,10 @@ class Detector {
Result<defs::timingMode> getTimingMode(Positions pos = {}) const; Result<defs::timingMode> getTimingMode(Positions pos = {}) const;
/** /**
* [Gotthard][Jungfrau][Moench][Gotthard][CTB][Gotthard2] Options: * [Gotthard][Jungfrau][Moench][Gotthard][CTB][Gotthard2][Xilinx CTB]
* AUTO_TIMING, TRIGGER_EXPOSURE \n * Options: AUTO_TIMING, TRIGGER_EXPOSURE \n [Mythen3] Options: AUTO_TIMING,
* [Mythen3] Options: AUTO_TIMING, TRIGGER_EXPOSURE, GATED, TRIGGER_GATED \n * TRIGGER_EXPOSURE, GATED, TRIGGER_GATED \n [Eiger] Options: AUTO_TIMING,
* [Eiger] Options: AUTO_TIMING, TRIGGER_EXPOSURE, GATED, BURST_TRIGGER * TRIGGER_EXPOSURE, GATED, BURST_TRIGGER
*/ */
void setTimingMode(defs::timingMode value, Positions pos = {}); void setTimingMode(defs::timingMode value, Positions pos = {});
@ -1846,20 +1846,20 @@ class Detector {
* Pattern * * Pattern *
* * * *
* ************************************************/ * ************************************************/
/** [CTB][Mythen3] Gets the pattern file name including path of the last /** [CTB][Mythen3][Xilinx CTB] Gets the pattern file name including path of
* pattern uploaded. \n Returns an empty if nothing was uploaded or via a * the last pattern uploaded. \n Returns an empty if nothing was uploaded or
* server default file*/ * via a server default file*/
Result<std::string> getPatterFileName(Positions pos = {}) const; Result<std::string> getPatterFileName(Positions pos = {}) const;
/** [CTB][Mythen3] Loads ASCII pattern file directly to server /** [CTB][Mythen3][Xilinx CTB] Loads ASCII pattern file directly to server
* (instead of executing line by line)*/ * (instead of executing line by line)*/
void setPattern(const std::string &fname, Positions pos = {}); void setPattern(const std::string &fname, Positions pos = {});
/** [CTB][Mythen3] Loads pattern parameters structure directly to /** [CTB][Mythen3][Xilinx CTB] Loads pattern parameters structure directly
* server */ * to server */
void setPattern(const Pattern &pat, Positions pos = {}); void setPattern(const Pattern &pat, Positions pos = {});
/** [CTB][Mythen3] [Ctb][Mythen3] Saves pattern to file /** [CTB][Mythen3][Xilinx CTB] Saves pattern to file
* (ascii). \n [Ctb] Also executes pattern.*/ * (ascii). \n [Ctb] Also executes pattern.*/
void savePattern(const std::string &fname); void savePattern(const std::string &fname);
@ -1872,57 +1872,57 @@ class Detector {
/** [CTB] */ /** [CTB] */
void setPatternIOControl(uint64_t word, Positions pos = {}); void setPatternIOControl(uint64_t word, Positions pos = {});
/** [CTB][Mythen3] same as executing for ctb */ /** [CTB][Mythen3][Xilinx CTB] same as executing for ctb */
Result<uint64_t> getPatternWord(int addr, Positions pos = {}); Result<uint64_t> getPatternWord(int addr, Positions pos = {});
/** [CTB] Caution: If word is -1 reads the addr (same as /** [CTB][Xilinx CTB] Caution: If word is -1 reads the addr (same as
* executing the pattern) * executing the pattern)
* [Mythen3] */ * [Mythen3] */
void setPatternWord(int addr, uint64_t word, Positions pos = {}); void setPatternWord(int addr, uint64_t word, Positions pos = {});
/**[CTB][Mythen3] Options: level: -1 (complete pattern) and 0-2 /**[CTB][Mythen3][Xilinx CTB] Options: level: -1 (complete pattern) and 0-2
* levels * levels
* @returns array of start address and stop address * @returns array of start address and stop address
*/ */
Result<std::array<int, 2>> Result<std::array<int, 2>>
getPatternLoopAddresses(int level, Positions pos = {}) const; getPatternLoopAddresses(int level, Positions pos = {}) const;
/** [CTB][Mythen3] Options: level: -1 (complete pattern) and 0-2 /** [CTB][Mythen3][Xilinx CTB] Options: level: -1 (complete pattern) and 0-2
* levels */ * levels */
void setPatternLoopAddresses(int level, int start, int stop, void setPatternLoopAddresses(int level, int start, int stop,
Positions pos = {}); Positions pos = {});
/**[CTB][Mythen3] Options: level: -1 (complete pattern) and 0-2 /**[CTB][Mythen3][Xilinx CTB] Options: level: -1 (complete pattern) and 0-2
* levels */ * levels */
Result<int> getPatternLoopCycles(int level, Positions pos = {}) const; Result<int> getPatternLoopCycles(int level, Positions pos = {}) const;
/** [CTB][Mythen3] n: 0-2, level: -1 (complete pattern) and 0-2 /** [CTB][Mythen3][Xilinx CTB] n: 0-2, level: -1 (complete pattern) and 0-2
* levels */ * levels */
void setPatternLoopCycles(int level, int n, Positions pos = {}); void setPatternLoopCycles(int level, int n, Positions pos = {});
/**[CTB][Mythen3] */ /**[CTB][Mythen3][Xilinx CTB] */
Result<int> getPatternWaitAddr(int level, Positions pos = {}) const; Result<int> getPatternWaitAddr(int level, Positions pos = {}) const;
/** [CTB][Mythen3] Options: level 0-2 */ /** [CTB][Mythen3][Xilinx CTB] Options: level 0-2 */
void setPatternWaitAddr(int level, int addr, Positions pos = {}); void setPatternWaitAddr(int level, int addr, Positions pos = {});
/** [CTB][Mythen3] */ /** [CTB][Mythen3][Xilinx CTB] */
Result<uint64_t> getPatternWaitTime(int level, Positions pos = {}) const; Result<uint64_t> getPatternWaitTime(int level, Positions pos = {}) const;
/** [CTB][Mythen3] Options: level 0-2 */ /** [CTB][Mythen3][Xilinx CTB] Options: level 0-2 */
void setPatternWaitTime(int level, uint64_t t, Positions pos = {}); void setPatternWaitTime(int level, uint64_t t, Positions pos = {});
/** [CTB][Mythen3] */ /** [CTB][Mythen3][Xilinx CTB] */
Result<uint64_t> getPatternMask(Positions pos = {}); Result<uint64_t> getPatternMask(Positions pos = {});
/** [CTB][Mythen3] Selects the bits that will have a pattern mask /** [CTB][Mythen3][Xilinx CTB] Selects the bits that will have a pattern
* applied to the selected patmask for every pattern. */ * mask applied to the selected patmask for every pattern. */
void setPatternMask(uint64_t mask, Positions pos = {}); void setPatternMask(uint64_t mask, Positions pos = {});
/** [CTB][Mythen3] */ /** [CTB][Mythen3][Xilinx CTB] */
Result<uint64_t> getPatternBitMask(Positions pos = {}) const; Result<uint64_t> getPatternBitMask(Positions pos = {}) const;
/** [CTB][Mythen3] Sets the mask applied to every pattern to the /** [CTB][Mythen3][Xilinx CTB] Sets the mask applied to every pattern to the
* selected bits */ * selected bits */
void setPatternBitMask(uint64_t mask, Positions pos = {}); void setPatternBitMask(uint64_t mask, Positions pos = {});

View File

@ -3516,7 +3516,7 @@ std::string Caller::dr(int action) {
Dynamic Range or number of bits per pixel in detector. Dynamic Range or number of bits per pixel in detector.
[Eiger] Options: 4, 8, 12, 16, 32. If set to 32, also sets clkdivider to 2, else to 0. [Eiger] Options: 4, 8, 12, 16, 32. If set to 32, also sets clkdivider to 2, else to 0.
[Mythen3] Options: 8, 16, 32 [Mythen3] Options: 8, 16, 32
[Jungfrau][Moench][Gotthard][Ctb][Mythen3][Gotthard2] 16 )V0G0N" [Jungfrau][Moench][Gotthard][Ctb][Mythen3][Gotthard2][Xilinx Ctb] 16 )V0G0N"
<< std::endl; << std::endl;
return os.str(); return os.str();
} }
@ -5242,7 +5242,7 @@ std::string Caller::framesl(int action) {
if (action == slsDetectorDefs::HELP_ACTION) { if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: framesl" << std::endl; os << "Command: framesl" << std::endl;
os << R"V0G0N( os << R"V0G0N(
[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Number of frames left in acquisition. [Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb][Xilinx Ctb] Number of frames left in acquisition.
[Gotthard2] only in continuous auto mode. )V0G0N" [Gotthard2] only in continuous auto mode. )V0G0N"
<< std::endl; << std::endl;
return os.str(); return os.str();
@ -6039,7 +6039,7 @@ std::string Caller::hardwareversion(int action) {
if (action == slsDetectorDefs::HELP_ACTION) { if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: hardwareversion" << std::endl; os << "Command: hardwareversion" << std::endl;
os << R"V0G0N( os << R"V0G0N(
[Jungfrau][Gotthard2][Myhten3][Gotthard][Ctb][Moench] Hardware version of detector. Hardware version of detector.
[Eiger] Hardware version of front FPGA on detector. )V0G0N" [Eiger] Hardware version of front FPGA on detector. )V0G0N"
<< std::endl; << std::endl;
return os.str(); return os.str();
@ -7668,7 +7668,7 @@ std::string Caller::patfname(int action) {
if (action == slsDetectorDefs::HELP_ACTION) { if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: patfname" << std::endl; os << "Command: patfname" << std::endl;
os << R"V0G0N( os << R"V0G0N(
[Ctb][Mythen3] Gets the pattern file name including path of the last pattern uploaded. Returns an empty if nothing was uploaded or via a server default file )V0G0N" [Ctb][Mythen3][Xilinx Ctb] Gets the pattern file name including path of the last pattern uploaded. Returns an empty if nothing was uploaded or via a server default file )V0G0N"
<< std::endl; << std::endl;
return os.str(); return os.str();
} }
@ -7771,7 +7771,7 @@ std::string Caller::patlimits(int action) {
if (action == slsDetectorDefs::HELP_ACTION) { if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: patlimits" << std::endl; os << "Command: patlimits" << std::endl;
os << R"V0G0N([start addr] [stop addr] os << R"V0G0N([start addr] [stop addr]
[Ctb][Mythen3] Limits of complete pattern )V0G0N" [Ctb][Mythen3][Xilinx Ctb] Limits of complete pattern )V0G0N"
<< std::endl; << std::endl;
return os.str(); return os.str();
} }
@ -7824,7 +7824,7 @@ std::string Caller::patloop(int action) {
if (action == slsDetectorDefs::HELP_ACTION) { if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: patloop" << std::endl; os << "Command: patloop" << std::endl;
os << R"V0G0N([0-6] [start addr] [stop addr] os << R"V0G0N([0-6] [start addr] [stop addr]
[Ctb][Mythen3] Limits of the loop level provided. [Ctb][Mythen3][Xilinx Ctb] Limits of the loop level provided.
[Mythen3] Level options: 0-3 only. )V0G0N" [Mythen3] Level options: 0-3 only. )V0G0N"
<< std::endl; << std::endl;
return os.str(); return os.str();
@ -8047,7 +8047,7 @@ std::string Caller::patmask(int action) {
if (action == slsDetectorDefs::HELP_ACTION) { if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: patmask" << std::endl; os << "Command: patmask" << std::endl;
os << R"V0G0N([64 bit mask] os << R"V0G0N([64 bit mask]
[Ctb][Mythen3] Selects the bits that will have a pattern mask applied to the selected patmask for every pattern. )V0G0N" [Ctb][Mythen3][Xilinx Ctb] Selects the bits that will have a pattern mask applied to the selected patmask for every pattern. )V0G0N"
<< std::endl; << std::endl;
return os.str(); return os.str();
} }
@ -8110,7 +8110,7 @@ std::string Caller::patnloop(int action) {
if (action == slsDetectorDefs::HELP_ACTION) { if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: patnloop" << std::endl; os << "Command: patnloop" << std::endl;
os << R"V0G0N([0-6] [n_cycles] os << R"V0G0N([0-6] [n_cycles]
[Ctb][Mythen3] Number of cycles of the loop level provided. [Ctb][Mythen3][Xilinx Ctb] Number of cycles of the loop level provided.
[Mythen3] Level options: 0-3 only. )V0G0N" [Mythen3] Level options: 0-3 only. )V0G0N"
<< std::endl; << std::endl;
return os.str(); return os.str();
@ -8325,7 +8325,7 @@ std::string Caller::patsetbit(int action) {
if (action == slsDetectorDefs::HELP_ACTION) { if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: patsetbit" << std::endl; os << "Command: patsetbit" << std::endl;
os << R"V0G0N([64 bit mask] os << R"V0G0N([64 bit mask]
[Ctb][Mythen3] Sets the mask applied to every pattern to the selected bits. )V0G0N" [Ctb][Mythen3][Xilinx Ctb] Sets the mask applied to every pattern to the selected bits. )V0G0N"
<< std::endl; << std::endl;
return os.str(); return os.str();
} }
@ -8388,7 +8388,7 @@ std::string Caller::pattern(int action) {
if (action == slsDetectorDefs::HELP_ACTION) { if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: patternX" << std::endl; os << "Command: patternX" << std::endl;
os << R"V0G0N([fname] os << R"V0G0N([fname]
[Mythen3][Ctb] Loads ASCII pattern file directly to server (instead of executing line by line) )V0G0N" [Mythen3][Ctb][Xilinx Ctb] Loads ASCII pattern file directly to server (instead of executing line by line) )V0G0N"
<< std::endl; << std::endl;
return os.str(); return os.str();
} }
@ -8468,7 +8468,7 @@ std::string Caller::patwait(int action) {
if (action == slsDetectorDefs::HELP_ACTION) { if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: patwait" << std::endl; os << "Command: patwait" << std::endl;
os << R"V0G0N([0-6] [addr] os << R"V0G0N([0-6] [addr]
[Ctb][Mythen3] Wait address for loop level provided. [Ctb][Mythen3][Xilinx Ctb] Wait address for loop level provided.
[Mythen3] Level options: 0-3 only. )V0G0N" [Mythen3] Level options: 0-3 only. )V0G0N"
<< std::endl; << std::endl;
return os.str(); return os.str();
@ -8679,7 +8679,7 @@ std::string Caller::patwaittime(int action) {
if (action == slsDetectorDefs::HELP_ACTION) { if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: patwaittime" << std::endl; os << "Command: patwaittime" << std::endl;
os << R"V0G0N([0-6] [n_clk] os << R"V0G0N([0-6] [n_clk]
[Ctb][Mythen3] Wait time in clock cycles for the loop provided. [Ctb][Mythen3][Xilinx Ctb] Wait time in clock cycles for the loop provided.
[Mythen3] Level options: 0-3 only. )V0G0N" [Mythen3] Level options: 0-3 only. )V0G0N"
<< std::endl; << std::endl;
return os.str(); return os.str();
@ -8893,7 +8893,7 @@ std::string Caller::patword(int action) {
if (action == slsDetectorDefs::HELP_ACTION) { if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: patword" << std::endl; os << "Command: patword" << std::endl;
os << R"V0G0N([step or address] [64 bit mask] os << R"V0G0N([step or address] [64 bit mask]
[Ctb][Mythen3] 64 bit pattern at address of pattern memory. [Ctb][Mythen3][Xilinx Ctb] 64 bit pattern at address of pattern memory.
[Ctb] read is same as executing pattern )V0G0N" [Ctb] read is same as executing pattern )V0G0N"
<< std::endl; << std::endl;
return os.str(); return os.str();
@ -12328,7 +12328,7 @@ std::string Caller::savepattern(int action) {
if (action == slsDetectorDefs::HELP_ACTION) { if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: savepattern" << std::endl; os << "Command: savepattern" << std::endl;
os << R"V0G0N( os << R"V0G0N(
[Ctb][Mythen3] Saves pattern to file (ascii). [Ctb][Mythen3][Xilinx Ctb] Saves pattern to file (ascii).
[Ctb] Also executes pattern. )V0G0N" [Ctb] Also executes pattern. )V0G0N"
<< std::endl; << std::endl;
return os.str(); return os.str();
@ -14727,7 +14727,7 @@ std::string Caller::timing(int action) {
os << "Command: timing" << std::endl; os << "Command: timing" << std::endl;
os << R"V0G0N([auto|trigger|gating|burst_trigger] os << R"V0G0N([auto|trigger|gating|burst_trigger]
Timing Mode of detector. Timing Mode of detector.
[Jungfrau][Moench][Gotthard][Ctb][Gotthard2] [auto|trigger] [Jungfrau][Moench][Gotthard][Ctb][Gotthard2][Xilinx Ctb] [auto|trigger]
[Mythen3] [auto|trigger|gating|trigger_gating] [Mythen3] [auto|trigger|gating|trigger_gating]
[Eiger] [auto|trigger|gating|burst_trigger] )V0G0N" [Eiger] [auto|trigger|gating|burst_trigger] )V0G0N"
<< std::endl; << std::endl;
@ -15134,7 +15134,7 @@ std::string Caller::triggersl(int action) {
if (action == slsDetectorDefs::HELP_ACTION) { if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: triggersl" << std::endl; os << "Command: triggersl" << std::endl;
os << R"V0G0N( os << R"V0G0N(
[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Number of triggers left in acquisition. Only when external trigger used. )V0G0N" [Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb][Xilinx Ctb] Number of triggers left in acquisition. Only when external trigger used. )V0G0N"
<< std::endl; << std::endl;
return os.str(); return os.str();
} }

View File

@ -653,7 +653,6 @@ std::vector<defs::dacIndex> Detector::getTemperatureList() const {
std::vector<defs::dacIndex> retval; std::vector<defs::dacIndex> retval;
switch (getDetectorType().squash()) { switch (getDetectorType().squash()) {
case defs::CHIPTESTBOARD: case defs::CHIPTESTBOARD:
case defs::XILINX_CHIPTESTBOARD:
return std::vector<defs::dacIndex>{defs::SLOW_ADC_TEMP}; return std::vector<defs::dacIndex>{defs::SLOW_ADC_TEMP};
case defs::JUNGFRAU: case defs::JUNGFRAU:
case defs::MOENCH: case defs::MOENCH:

View File

@ -24,7 +24,8 @@ TEST_CASE("CALLER::dacname", "[.cmdcall]") {
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD) { if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD) {
defs::dacIndex ind = static_cast<defs::dacIndex>(2); defs::dacIndex ind = static_cast<defs::dacIndex>(2);
std::string str_dac_index = "2"; std::string str_dac_index = "2";
auto prev = det.getDacName(ind); auto prev = det.getDacName(ind);
@ -58,7 +59,8 @@ TEST_CASE("CALLER::dacindex", "[.cmdcall]") {
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD) { if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD) {
defs::dacIndex ind = static_cast<defs::dacIndex>(2); defs::dacIndex ind = static_cast<defs::dacIndex>(2);
std::string str_dac_index = "2"; std::string str_dac_index = "2";
@ -83,7 +85,8 @@ TEST_CASE("CALLER::adclist", "[.cmdcall]") {
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD) { if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD) {
auto prev = det.getAdcNames(); auto prev = det.getAdcNames();
REQUIRE_THROWS(caller.call("adclist", {"a", "s", "d"}, -1, PUT)); REQUIRE_THROWS(caller.call("adclist", {"a", "s", "d"}, -1, PUT));
@ -115,7 +118,8 @@ TEST_CASE("CALLER::adcname", "[.cmdcall]") {
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD) { if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD) {
int ind = 2; int ind = 2;
std::string str_adc_index = "2"; std::string str_adc_index = "2";
auto prev = det.getAdcName(ind); auto prev = det.getAdcName(ind);
@ -149,7 +153,8 @@ TEST_CASE("CALLER::adcindex", "[.cmdcall]") {
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD) { if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD) {
int ind = 2; int ind = 2;
std::string str_adc_index = "2"; std::string str_adc_index = "2";
@ -174,7 +179,8 @@ TEST_CASE("CALLER::signallist", "[.cmdcall]") {
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD) { if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD) {
auto prev = det.getSignalNames(); auto prev = det.getSignalNames();
REQUIRE_THROWS(caller.call("signallist", {"a", "s", "d"}, -1, PUT)); REQUIRE_THROWS(caller.call("signallist", {"a", "s", "d"}, -1, PUT));
@ -206,7 +212,8 @@ TEST_CASE("CALLER::signalname", "[.cmdcall]") {
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD) { if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD) {
int ind = 2; int ind = 2;
std::string str_signal_index = "2"; std::string str_signal_index = "2";
auto prev = det.getSignalName(ind); auto prev = det.getSignalName(ind);
@ -240,7 +247,8 @@ TEST_CASE("CALLER::signalindex", "[.cmdcall]") {
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD) { if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD) {
int ind = 2; int ind = 2;
std::string str_signal_index = "2"; std::string str_signal_index = "2";
@ -266,7 +274,8 @@ TEST_CASE("CALLER::powerlist", "[.cmdcall]") {
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD) { if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD) {
auto prev = det.getPowerNames(); auto prev = det.getPowerNames();
REQUIRE_THROWS(caller.call("powerlist", {"a", "s", "d"}, -1, PUT)); REQUIRE_THROWS(caller.call("powerlist", {"a", "s", "d"}, -1, PUT));
@ -298,7 +307,8 @@ TEST_CASE("CALLER::powername", "[.cmdcall]") {
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD) { if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD) {
defs::dacIndex ind = static_cast<defs::dacIndex>(2 + defs::V_POWER_A); defs::dacIndex ind = static_cast<defs::dacIndex>(2 + defs::V_POWER_A);
std::string str_power_index = "2"; std::string str_power_index = "2";
auto prev = det.getPowerName(ind); auto prev = det.getPowerName(ind);
@ -332,7 +342,8 @@ TEST_CASE("CALLER::powerindex", "[.cmdcall]") {
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD) { if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD) {
defs::dacIndex ind = static_cast<defs::dacIndex>(2 + defs::V_POWER_A); defs::dacIndex ind = static_cast<defs::dacIndex>(2 + defs::V_POWER_A);
std::string str_power_index = "2"; std::string str_power_index = "2";
@ -382,7 +393,8 @@ TEST_CASE("CALLER::slowadclist", "[.cmdcall]") {
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD) { if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD) {
auto prev = det.getSlowADCNames(); auto prev = det.getSlowADCNames();
REQUIRE_THROWS(caller.call("slowadclist", {"a", "s", "d"}, -1, PUT)); REQUIRE_THROWS(caller.call("slowadclist", {"a", "s", "d"}, -1, PUT));
@ -414,7 +426,8 @@ TEST_CASE("CALLER::slowadcname", "[.cmdcall]") {
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD) { if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD) {
defs::dacIndex ind = static_cast<defs::dacIndex>(2 + defs::SLOW_ADC0); defs::dacIndex ind = static_cast<defs::dacIndex>(2 + defs::SLOW_ADC0);
std::string str_slowadc_index = "2"; std::string str_slowadc_index = "2";
auto prev = det.getSlowADCName(ind); auto prev = det.getSlowADCName(ind);
@ -449,7 +462,8 @@ TEST_CASE("CALLER::slowadcindex", "[.cmdcall]") {
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD) { if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD) {
defs::dacIndex ind = static_cast<defs::dacIndex>(2 + defs::SLOW_ADC0); defs::dacIndex ind = static_cast<defs::dacIndex>(2 + defs::SLOW_ADC0);
std::string str_slowadc_index = "2"; std::string str_slowadc_index = "2";
@ -478,12 +492,19 @@ TEST_CASE("CALLER::dac", "[.cmdcall][.dacs]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD) { if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD) {
for (int i = 0; i < 18; ++i) { for (int i = 0; i < 18; ++i) {
SECTION("dac " + std::to_string(i)) { SECTION("dac " + std::to_string(i)) {
if (det_type == defs::CHIPTESTBOARD) {
test_dac_caller(static_cast<defs::dacIndex>(i), "dac", 0); test_dac_caller(static_cast<defs::dacIndex>(i), "dac", 0);
} else {
REQUIRE_THROWS(
caller.call("dac", {std::to_string(i)}, -1, GET));
} }
} }
}
// eiger // eiger
// REQUIRE_THROWS(caller.call("dac", {"vthreshold"}, -1, GET)); // REQUIRE_THROWS(caller.call("dac", {"vthreshold"}, -1, GET));
// REQUIRE_THROWS(caller.call("dac", {"vsvp"}, -1, GET)); // REQUIRE_THROWS(caller.call("dac", {"vsvp"}, -1, GET));

View File

@ -23,7 +23,8 @@ TEST_CASE("Caller::patfname", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) { if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD || det_type == defs::MYTHEN3) {
REQUIRE_THROWS(caller.call("patfname", {}, -1, PUT)); REQUIRE_THROWS(caller.call("patfname", {}, -1, PUT));
REQUIRE_NOTHROW(caller.call("patfname", {}, -1, GET)); REQUIRE_NOTHROW(caller.call("patfname", {}, -1, GET));
} else { } else {
@ -35,7 +36,8 @@ TEST_CASE("Caller::pattern", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) { if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD || det_type == defs::MYTHEN3) {
// no proper test for put // no proper test for put
REQUIRE_THROWS(caller.call("pattern", {}, -1, GET)); REQUIRE_THROWS(caller.call("pattern", {}, -1, GET));
} else { } else {
@ -47,7 +49,8 @@ TEST_CASE("Caller::savepattern", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) { if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD || det_type == defs::MYTHEN3) {
REQUIRE_THROWS( REQUIRE_THROWS(
caller.call("savepattern", {"/tmp/pattern.txt"}, -1, GET)); caller.call("savepattern", {"/tmp/pattern.txt"}, -1, GET));
if (det.size() == 1) { if (det.size() == 1) {
@ -108,7 +111,8 @@ TEST_CASE("Caller::patword", "[.cmdcall]") {
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) { if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD || det_type == defs::MYTHEN3) {
int addr = 0x23; int addr = 0x23;
std::string saddr = ToStringHex(addr, 4); std::string saddr = ToStringHex(addr, 4);
auto prev_val = det.getPatternWord(addr); auto prev_val = det.getPatternWord(addr);
@ -118,6 +122,12 @@ TEST_CASE("Caller::patword", "[.cmdcall]") {
REQUIRE(oss.str() == REQUIRE(oss.str() ==
"patword [" + saddr + ", 0xc15004808d0a21a4]\n"); "patword [" + saddr + ", 0xc15004808d0a21a4]\n");
} }
{
std::ostringstream oss;
caller.call("patword", {saddr, "0x815004808d0a21a4"}, -1, PUT, oss);
REQUIRE(oss.str() ==
"patword [" + saddr + ", 0x815004808d0a21a4]\n");
}
{ {
std::ostringstream oss; std::ostringstream oss;
caller.call("patword", {saddr, "0xaadf0"}, -1, PUT, oss); caller.call("patword", {saddr, "0xaadf0"}, -1, PUT, oss);
@ -143,7 +153,8 @@ TEST_CASE("Caller::patlimits", "[.cmdcall]") {
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) { if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD || det_type == defs::MYTHEN3) {
auto prev_val = det.getPatternLoopAddresses(-1); auto prev_val = det.getPatternLoopAddresses(-1);
{ {
std::ostringstream oss; std::ostringstream oss;
@ -169,7 +180,8 @@ TEST_CASE("Caller::patloop", "[.cmdcall]") {
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) { if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD || det_type == defs::MYTHEN3) {
for (int iLoop = 0; iLoop != MAX_PATTERN_LEVELS; ++iLoop) { for (int iLoop = 0; iLoop != MAX_PATTERN_LEVELS; ++iLoop) {
// m3 only has 3 levels // m3 only has 3 levels
if (det_type == defs::MYTHEN3 && iLoop >= 3) { if (det_type == defs::MYTHEN3 && iLoop >= 3) {
@ -217,7 +229,8 @@ TEST_CASE("Caller::patnloop", "[.cmdcall]") {
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) { if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD || det_type == defs::MYTHEN3) {
for (int iLoop = 0; iLoop != MAX_PATTERN_LEVELS; ++iLoop) { for (int iLoop = 0; iLoop != MAX_PATTERN_LEVELS; ++iLoop) {
// m3 only has 3 levels // m3 only has 3 levels
if (det_type == defs::MYTHEN3 && iLoop >= 3) { if (det_type == defs::MYTHEN3 && iLoop >= 3) {
@ -262,7 +275,8 @@ TEST_CASE("Caller::patwait", "[.cmdcall]") {
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) { if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD || det_type == defs::MYTHEN3) {
for (int iLoop = 0; iLoop != MAX_PATTERN_LEVELS; ++iLoop) { for (int iLoop = 0; iLoop != MAX_PATTERN_LEVELS; ++iLoop) {
// m3 only has 3 levels // m3 only has 3 levels
if (det_type == defs::MYTHEN3 && iLoop >= 3) { if (det_type == defs::MYTHEN3 && iLoop >= 3) {
@ -307,7 +321,8 @@ TEST_CASE("Caller::patwaittime", "[.cmdcall]") {
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) { if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD || det_type == defs::MYTHEN3) {
for (int iLoop = 0; iLoop != MAX_PATTERN_LEVELS; ++iLoop) { for (int iLoop = 0; iLoop != MAX_PATTERN_LEVELS; ++iLoop) {
// m3 only has 3 levels // m3 only has 3 levels
if (det_type == defs::MYTHEN3 && iLoop >= 3) { if (det_type == defs::MYTHEN3 && iLoop >= 3) {
@ -352,7 +367,8 @@ TEST_CASE("Caller::patmask", "[.cmdcall]") {
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) { if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD || det_type == defs::MYTHEN3) {
auto prev_val = det.getPatternMask(); auto prev_val = det.getPatternMask();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -377,7 +393,8 @@ TEST_CASE("Caller::patsetbit", "[.cmdcall]") {
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) { if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD || det_type == defs::MYTHEN3) {
auto prev_val = det.getPatternBitMask(); auto prev_val = det.getPatternBitMask();
{ {
std::ostringstream oss; std::ostringstream oss;

View File

@ -27,6 +27,8 @@ python/scripts/list_tested_cmd.py to check if all commands are covered
TEST_CASE("Caller::rx_version", "[.cmdcall][.rx]") { TEST_CASE("Caller::rx_version", "[.cmdcall][.rx]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
std::ostringstream oss; std::ostringstream oss;
caller.call("rx_version", {}, -1, GET, oss); caller.call("rx_version", {}, -1, GET, oss);
sls::Version v(APIRECEIVER); sls::Version v(APIRECEIVER);
@ -35,12 +37,17 @@ TEST_CASE("Caller::rx_version", "[.cmdcall][.rx]") {
REQUIRE(oss.str() == vs.str()); REQUIRE(oss.str() == vs.str());
REQUIRE_THROWS(caller.call("rx_version", {"0"}, -1, PUT)); REQUIRE_THROWS(caller.call("rx_version", {"0"}, -1, PUT));
} else {
REQUIRE_THROWS(caller.call("rx_version", {}, -1, GET));
}
} }
/* acquisition */ /* acquisition */
TEST_CASE("Caller::rx_start", "[.cmdcall][.rx]") { TEST_CASE("Caller::rx_start", "[.cmdcall][.rx]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
det.setFileWrite(false); // avoid writing or error on file creation det.setFileWrite(false); // avoid writing or error on file creation
// PUT only command // PUT only command
REQUIRE_THROWS(caller.call("rx_start", {}, -1, GET)); REQUIRE_THROWS(caller.call("rx_start", {}, -1, GET));
@ -54,11 +61,16 @@ TEST_CASE("Caller::rx_start", "[.cmdcall][.rx]") {
caller.call("rx_status", {}, -1, GET, oss); caller.call("rx_status", {}, -1, GET, oss);
REQUIRE(oss.str() == "rx_status running\n"); REQUIRE(oss.str() == "rx_status running\n");
} }
} else {
REQUIRE_THROWS(caller.call("rx_start", {}, -1, GET));
}
} }
TEST_CASE("Caller::rx_stop", "[.cmdcall][.rx]") { TEST_CASE("Caller::rx_stop", "[.cmdcall][.rx]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
// PUT only command // PUT only command
REQUIRE_THROWS(caller.call("rx_stop", {}, -1, GET)); REQUIRE_THROWS(caller.call("rx_stop", {}, -1, GET));
{ {
@ -71,10 +83,16 @@ TEST_CASE("Caller::rx_stop", "[.cmdcall][.rx]") {
caller.call("rx_status", {}, -1, GET, oss); caller.call("rx_status", {}, -1, GET, oss);
REQUIRE(oss.str() == "rx_status idle\n"); REQUIRE(oss.str() == "rx_status idle\n");
} }
} else {
REQUIRE_THROWS(caller.call("rx_stop", {}, -1, GET));
}
} }
TEST_CASE("Caller::rx_status", "[.cmdcall][.rx]") { TEST_CASE("Caller::rx_status", "[.cmdcall][.rx]") {
Detector det; Detector det;
Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
det.setFileWrite(false); // avoid writing or error on file creation det.setFileWrite(false); // avoid writing or error on file creation
Caller caller(&det); Caller caller(&det);
det.startReceiver(); det.startReceiver();
@ -89,12 +107,16 @@ TEST_CASE("Caller::rx_status", "[.cmdcall][.rx]") {
caller.call("rx_status", {}, -1, GET, oss); caller.call("rx_status", {}, -1, GET, oss);
REQUIRE(oss.str() == "rx_status idle\n"); REQUIRE(oss.str() == "rx_status idle\n");
} }
} else {
REQUIRE_THROWS(caller.call("rx_status", {}, -1, GET));
}
} }
TEST_CASE("Caller::rx_framescaught", "[.cmdcall][.rx]") { TEST_CASE("Caller::rx_framescaught", "[.cmdcall][.rx]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
// This ensures 0 caught frames // This ensures 0 caught frames
auto prev_val = det.getFileWrite(); auto prev_val = det.getFileWrite();
det.setFileWrite(false); // avoid writing or error on file creation det.setFileWrite(false); // avoid writing or error on file creation
@ -124,10 +146,16 @@ TEST_CASE("Caller::rx_framescaught", "[.cmdcall][.rx]") {
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
det.setFileWrite(prev_val[i], {i}); det.setFileWrite(prev_val[i], {i});
} }
} else {
REQUIRE_THROWS(caller.call("rx_framescaught", {}, -1, GET));
}
} }
TEST_CASE("Caller::rx_missingpackets", "[.cmdcall][.rx]") { TEST_CASE("Caller::rx_missingpackets", "[.cmdcall][.rx]") {
Detector det; Detector det;
Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
auto prev_val = det.getFileWrite(); auto prev_val = det.getFileWrite();
det.setFileWrite(false); // avoid writing or error on file creation det.setFileWrite(false); // avoid writing or error on file creation
Caller caller(&det); Caller caller(&det);
@ -149,7 +177,8 @@ TEST_CASE("Caller::rx_missingpackets", "[.cmdcall][.rx]") {
} }
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type != defs::CHIPTESTBOARD && det_type != defs::MOENCH) { if (det_type != defs::CHIPTESTBOARD && det_type != defs::MOENCH) {
// 0 missing packets (takes into account that acquisition is stopped) // 0 missing packets (takes into account that acquisition is
// stopped)
det.startReceiver(); det.startReceiver();
det.startDetector(); det.startDetector();
det.stopDetector(); det.stopDetector();
@ -167,15 +196,23 @@ TEST_CASE("Caller::rx_missingpackets", "[.cmdcall][.rx]") {
det.setFileWrite(prev_val[i], {i}); det.setFileWrite(prev_val[i], {i});
} }
det.setNumberOfFrames(prev_frames); det.setNumberOfFrames(prev_frames);
} else {
REQUIRE_THROWS(caller.call("rx_missingpackets", {}, -1, GET));
}
} }
TEST_CASE("Caller::rx_frameindex", "[.cmdcall][.rx]") { TEST_CASE("Caller::rx_frameindex", "[.cmdcall][.rx]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
caller.call("rx_frameindex", {}, -1, GET); caller.call("rx_frameindex", {}, -1, GET);
// This is a get only command // This is a get only command
REQUIRE_THROWS(caller.call("rx_frameindex", {"2"}, -1, PUT)); REQUIRE_THROWS(caller.call("rx_frameindex", {"2"}, -1, PUT));
} else {
REQUIRE_THROWS(caller.call("rx_frameindex", {}, -1, GET));
}
} }
/* Network Configuration (Detector<->Receiver) */ /* Network Configuration (Detector<->Receiver) */
@ -183,7 +220,12 @@ TEST_CASE("Caller::rx_frameindex", "[.cmdcall][.rx]") {
TEST_CASE("Caller::rx_printconfig", "[.cmdcall][.rx]") { TEST_CASE("Caller::rx_printconfig", "[.cmdcall][.rx]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
REQUIRE_NOTHROW(caller.call("rx_printconfig", {}, -1, GET)); REQUIRE_NOTHROW(caller.call("rx_printconfig", {}, -1, GET));
} else {
REQUIRE_THROWS(caller.call("rx_printconfig", {}, -1, GET));
}
} }
/* Receiver Config */ /* Receiver Config */
@ -191,10 +233,12 @@ TEST_CASE("Caller::rx_printconfig", "[.cmdcall][.rx]") {
TEST_CASE("Caller::rx_hostname", "[.cmdcall][.rx]") { TEST_CASE("Caller::rx_hostname", "[.cmdcall][.rx]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
auto prev_val = det.getRxHostname(); auto prev_val = det.getRxHostname();
// Cannot set rx_hostname (will reset parameters in rxr and no shm variables // Cannot set rx_hostname (will reset parameters in rxr and no shm
// to update) // variables to update)
// { // {
// // disable receiver // // disable receiver
// std::ostringstream oss; // std::ostringstream oss;
@ -218,6 +262,9 @@ TEST_CASE("Caller::rx_hostname", "[.cmdcall][.rx]") {
caller.call("rx_hostname", {}, 0, GET, oss); caller.call("rx_hostname", {}, 0, GET, oss);
REQUIRE(oss.str() == "rx_hostname " + prev_val[0] + "\n"); REQUIRE(oss.str() == "rx_hostname " + prev_val[0] + "\n");
} }
} else {
REQUIRE_THROWS(caller.call("rx_hostname", {"localhost"}, -1, PUT));
}
} }
TEST_CASE("Caller::rx_tcpport", "[.cmdcall][.rx]") { TEST_CASE("Caller::rx_tcpport", "[.cmdcall][.rx]") {
@ -262,6 +309,8 @@ TEST_CASE("Caller::rx_tcpport", "[.cmdcall][.rx]") {
TEST_CASE("Caller::rx_fifodepth", "[.cmdcall][.rx]") { TEST_CASE("Caller::rx_fifodepth", "[.cmdcall][.rx]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
auto prev_val = det.getRxFifoDepth(); auto prev_val = det.getRxFifoDepth();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -281,11 +330,16 @@ TEST_CASE("Caller::rx_fifodepth", "[.cmdcall][.rx]") {
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
det.setRxFifoDepth(prev_val[i], {i}); det.setRxFifoDepth(prev_val[i], {i});
} }
} else {
REQUIRE_THROWS(caller.call("rx_fifodepth", {}, -1, GET));
}
} }
TEST_CASE("Caller::rx_silent", "[.cmdcall][.rx]") { TEST_CASE("Caller::rx_silent", "[.cmdcall][.rx]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
auto prev_val = det.getRxSilentMode(); auto prev_val = det.getRxSilentMode();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -305,11 +359,16 @@ TEST_CASE("Caller::rx_silent", "[.cmdcall][.rx]") {
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
det.setRxSilentMode(prev_val[i], {i}); det.setRxSilentMode(prev_val[i], {i});
} }
} else {
REQUIRE_THROWS(caller.call("rx_silent", {}, -1, GET));
}
} }
TEST_CASE("Caller::rx_discardpolicy", "[.cmdcall][.rx]") { TEST_CASE("Caller::rx_discardpolicy", "[.cmdcall][.rx]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
auto prev_val = det.getRxFrameDiscardPolicy(); auto prev_val = det.getRxFrameDiscardPolicy();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -334,11 +393,16 @@ TEST_CASE("Caller::rx_discardpolicy", "[.cmdcall][.rx]") {
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
det.setRxFrameDiscardPolicy(prev_val[i], {i}); det.setRxFrameDiscardPolicy(prev_val[i], {i});
} }
} else {
REQUIRE_THROWS(caller.call("rx_discardpolicy", {}, -1, GET));
}
} }
TEST_CASE("Caller::rx_padding", "[.cmdcall][.rx]") { TEST_CASE("Caller::rx_padding", "[.cmdcall][.rx]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
auto prev_val = det.getPartialFramesPadding(); auto prev_val = det.getPartialFramesPadding();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -358,11 +422,16 @@ TEST_CASE("Caller::rx_padding", "[.cmdcall][.rx]") {
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
det.setPartialFramesPadding(prev_val[i], {i}); det.setPartialFramesPadding(prev_val[i], {i});
} }
} else {
REQUIRE_THROWS(caller.call("rx_padding", {}, -1, GET));
}
} }
TEST_CASE("Caller::rx_udpsocksize", "[.cmdcall][.rx]") { TEST_CASE("Caller::rx_udpsocksize", "[.cmdcall][.rx]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
int64_t prev_val = det.getRxUDPSocketBufferSize().tsquash( int64_t prev_val = det.getRxUDPSocketBufferSize().tsquash(
"Need same udp socket buffer size to test"); "Need same udp socket buffer size to test");
std::string s_new_val = std::to_string(prev_val); std::string s_new_val = std::to_string(prev_val);
@ -378,11 +447,16 @@ TEST_CASE("Caller::rx_udpsocksize", "[.cmdcall][.rx]") {
REQUIRE(oss.str() >= "rx_udpsocksize " + s_new_val + "\n"); REQUIRE(oss.str() >= "rx_udpsocksize " + s_new_val + "\n");
} }
det.setRxUDPSocketBufferSize(prev_val); det.setRxUDPSocketBufferSize(prev_val);
} else {
REQUIRE_THROWS(caller.call("rx_udpsocksize", {}, -1, GET));
}
} }
TEST_CASE("Caller::rx_realudpsocksize", "[.cmdcall][.rx]") { TEST_CASE("Caller::rx_realudpsocksize", "[.cmdcall][.rx]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
uint64_t val = 0; uint64_t val = 0;
{ {
std::ostringstream oss; std::ostringstream oss;
@ -397,11 +471,16 @@ TEST_CASE("Caller::rx_realudpsocksize", "[.cmdcall][.rx]") {
uint64_t rval = std::stol(s); uint64_t rval = std::stol(s);
REQUIRE(rval >= val * 2); REQUIRE(rval >= val * 2);
} }
} else {
REQUIRE_THROWS(caller.call("rx_realudpsocksize", {}, -1, GET));
}
} }
TEST_CASE("Caller::rx_lock", "[.cmdcall][.rx]") { TEST_CASE("Caller::rx_lock", "[.cmdcall][.rx]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
auto prev_val = det.getRxLock(); auto prev_val = det.getRxLock();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -421,28 +500,43 @@ TEST_CASE("Caller::rx_lock", "[.cmdcall][.rx]") {
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
det.setRxLock(prev_val[i], {i}); det.setRxLock(prev_val[i], {i});
} }
} else {
REQUIRE_THROWS(caller.call("rx_lock", {}, -1, GET));
}
} }
TEST_CASE("Caller::rx_lastclient", "[.cmdcall][.rx]") { TEST_CASE("Caller::rx_lastclient", "[.cmdcall][.rx]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
std::ostringstream oss; std::ostringstream oss;
REQUIRE_NOTHROW(caller.call("rx_lastclient", {}, -1, GET, oss)); REQUIRE_NOTHROW(caller.call("rx_lastclient", {}, -1, GET, oss));
if (test::my_ip != "undefined") { if (test::my_ip != "undefined") {
REQUIRE(oss.str() == "rx_lastclient " + test::my_ip + "\n"); REQUIRE(oss.str() == "rx_lastclient " + test::my_ip + "\n");
} }
} else {
REQUIRE_THROWS(caller.call("rx_lastclient", {}, -1, GET));
}
} }
TEST_CASE("Caller::rx_threads", "[.cmdcall][.rx]") { TEST_CASE("Caller::rx_threads", "[.cmdcall][.rx]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
std::ostringstream oss; std::ostringstream oss;
REQUIRE_NOTHROW(caller.call("rx_threads", {}, -1, GET, oss)); REQUIRE_NOTHROW(caller.call("rx_threads", {}, -1, GET, oss));
} else {
REQUIRE_THROWS(caller.call("rx_threads", {}, -1, GET));
}
} }
TEST_CASE("Caller::rx_arping", "[.cmdcall][.rx]") { TEST_CASE("Caller::rx_arping", "[.cmdcall][.rx]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
auto prev_val = det.getRxArping(); auto prev_val = det.getRxArping();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -462,13 +556,16 @@ TEST_CASE("Caller::rx_arping", "[.cmdcall][.rx]") {
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
det.setRxArping(prev_val[i], {i}); det.setRxArping(prev_val[i], {i});
} }
} else {
REQUIRE_THROWS(caller.call("rx_arping", {}, -1, GET));
}
} }
TEST_CASE("Caller::rx_roi", "[.cmdcall]") { TEST_CASE("Caller::rx_roi", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
if (det_type == defs::CHIPTESTBOARD) { if (det_type == defs::CHIPTESTBOARD) {
REQUIRE_THROWS(caller.call("rx_roi", {"5", "10"}, -1, PUT)); REQUIRE_THROWS(caller.call("rx_roi", {"5", "10"}, -1, PUT));
} else { } else {
@ -501,7 +598,8 @@ TEST_CASE("Caller::rx_roi", "[.cmdcall]") {
} }
{ {
std::ostringstream oss; std::ostringstream oss;
caller.call("rx_roi", {"10", "22", "18", "19"}, -1, PUT, oss); caller.call("rx_roi", {"10", "22", "18", "19"}, -1, PUT,
oss);
REQUIRE(oss.str() == "rx_roi [10, 22, 18, 19]\n"); REQUIRE(oss.str() == "rx_roi [10, 22, 18, 19]\n");
} }
{ {
@ -524,13 +622,16 @@ TEST_CASE("Caller::rx_roi", "[.cmdcall]") {
det.setRxROI(prev_val); det.setRxROI(prev_val);
} }
} }
} else {
REQUIRE_THROWS(caller.call("rx_roi", {}, -1, GET));
}
} }
TEST_CASE("Caller::rx_clearroi", "[.cmdcall]") { TEST_CASE("Caller::rx_clearroi", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
if (det_type == defs::CHIPTESTBOARD) { if (det_type == defs::CHIPTESTBOARD) {
REQUIRE_THROWS(caller.call("rx_clearroi", {}, -1, PUT)); REQUIRE_THROWS(caller.call("rx_clearroi", {}, -1, PUT));
} else { } else {
@ -544,6 +645,9 @@ TEST_CASE("Caller::rx_clearroi", "[.cmdcall]") {
det.setRxROI(prev_val); det.setRxROI(prev_val);
} }
} }
} else {
REQUIRE_THROWS(caller.call("rx_clearroi", {}, -1, PUT));
}
} }
/* File */ /* File */
@ -551,6 +655,8 @@ TEST_CASE("Caller::rx_clearroi", "[.cmdcall]") {
TEST_CASE("Caller::fformat", "[.cmdcall]") { TEST_CASE("Caller::fformat", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
auto prev_val = det.getFileFormat(); auto prev_val = det.getFileFormat();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -565,11 +671,16 @@ TEST_CASE("Caller::fformat", "[.cmdcall]") {
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
det.setFileFormat(prev_val[i], {i}); det.setFileFormat(prev_val[i], {i});
} }
} else {
REQUIRE_THROWS(caller.call("fformat", {}, -1, GET));
}
} }
TEST_CASE("Caller::fpath", "[.cmdcall]") { TEST_CASE("Caller::fpath", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
auto prev_val = det.getFilePath(); auto prev_val = det.getFilePath();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -584,11 +695,16 @@ TEST_CASE("Caller::fpath", "[.cmdcall]") {
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
det.setFilePath(prev_val[i], {i}); det.setFilePath(prev_val[i], {i});
} }
} else {
REQUIRE_THROWS(caller.call("fpath", {}, -1, GET));
}
} }
TEST_CASE("Caller::fname", "[.cmdcall]") { TEST_CASE("Caller::fname", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
auto prev_val = det.getFileNamePrefix(); auto prev_val = det.getFileNamePrefix();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -611,11 +727,16 @@ TEST_CASE("Caller::fname", "[.cmdcall]") {
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
det.setFileNamePrefix(prev_val[i], {i}); det.setFileNamePrefix(prev_val[i], {i});
} }
} else {
REQUIRE_THROWS(caller.call("fname", {}, -1, GET));
}
} }
TEST_CASE("Caller::findex", "[.cmdcall]") { TEST_CASE("Caller::findex", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
auto prev_val = det.getAcquisitionIndex(); auto prev_val = det.getAcquisitionIndex();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -635,11 +756,16 @@ TEST_CASE("Caller::findex", "[.cmdcall]") {
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
det.setAcquisitionIndex(prev_val[i], {i}); det.setAcquisitionIndex(prev_val[i], {i});
} }
} else {
REQUIRE_THROWS(caller.call("findex", {}, -1, GET));
}
} }
TEST_CASE("Caller::fwrite", "[.cmdcall]") { TEST_CASE("Caller::fwrite", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
auto prev_val = det.getFileWrite(); auto prev_val = det.getFileWrite();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -659,11 +785,16 @@ TEST_CASE("Caller::fwrite", "[.cmdcall]") {
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
det.setFileWrite(prev_val[i], {i}); det.setFileWrite(prev_val[i], {i});
} }
} else {
REQUIRE_THROWS(caller.call("fwrite", {}, -1, GET));
}
} }
TEST_CASE("Caller::fmaster", "[.cmdcall]") { TEST_CASE("Caller::fmaster", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
auto prev_val = det.getMasterFileWrite(); auto prev_val = det.getMasterFileWrite();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -681,11 +812,16 @@ TEST_CASE("Caller::fmaster", "[.cmdcall]") {
REQUIRE(oss.str() == "fmaster 1\n"); REQUIRE(oss.str() == "fmaster 1\n");
} }
det.setMasterFileWrite(prev_val); det.setMasterFileWrite(prev_val);
} else {
REQUIRE_THROWS(caller.call("fmaster", {}, -1, GET));
}
} }
TEST_CASE("Caller::foverwrite", "[.cmdcall]") { TEST_CASE("Caller::foverwrite", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
auto prev_val = det.getFileOverWrite(); auto prev_val = det.getFileOverWrite();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -705,11 +841,16 @@ TEST_CASE("Caller::foverwrite", "[.cmdcall]") {
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
det.setFileOverWrite(prev_val[i], {i}); det.setFileOverWrite(prev_val[i], {i});
} }
} else {
REQUIRE_THROWS(caller.call("foverwrite", {}, -1, GET));
}
} }
TEST_CASE("Caller::rx_framesperfile", "[.cmdcall][.rx]") { TEST_CASE("Caller::rx_framesperfile", "[.cmdcall][.rx]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
auto prev_val = det.getFramesPerFile(); auto prev_val = det.getFramesPerFile();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -734,6 +875,9 @@ TEST_CASE("Caller::rx_framesperfile", "[.cmdcall][.rx]") {
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
det.setFramesPerFile(prev_val[i], {i}); det.setFramesPerFile(prev_val[i], {i});
} }
} else {
REQUIRE_THROWS(caller.call("rx_framesperfile", {}, -1, GET));
}
} }
/* ZMQ Streaming Parameters (Receiver<->Client) */ /* ZMQ Streaming Parameters (Receiver<->Client) */
@ -741,6 +885,8 @@ TEST_CASE("Caller::rx_framesperfile", "[.cmdcall][.rx]") {
TEST_CASE("Caller::rx_zmqstream", "[.cmdcall][.rx]") { TEST_CASE("Caller::rx_zmqstream", "[.cmdcall][.rx]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
auto prev_val = det.getRxZmqDataStream(); auto prev_val = det.getRxZmqDataStream();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -762,11 +908,16 @@ TEST_CASE("Caller::rx_zmqstream", "[.cmdcall][.rx]") {
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
det.setRxZmqDataStream(prev_val[i], {i}); det.setRxZmqDataStream(prev_val[i], {i});
} }
} else {
REQUIRE_THROWS(caller.call("rx_zmqstream", {}, -1, GET));
}
} }
TEST_CASE("Caller::rx_zmqfreq", "[.cmdcall][.rx]") { TEST_CASE("Caller::rx_zmqfreq", "[.cmdcall][.rx]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
auto prev_val = det.getRxZmqFrequency(); auto prev_val = det.getRxZmqFrequency();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -786,11 +937,16 @@ TEST_CASE("Caller::rx_zmqfreq", "[.cmdcall][.rx]") {
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
det.setRxZmqFrequency(prev_val[i], {i}); det.setRxZmqFrequency(prev_val[i], {i});
} }
} else {
REQUIRE_THROWS(caller.call("rx_zmqfreq", {}, -1, GET));
}
} }
TEST_CASE("Caller::rx_zmqstartfnum", "[.cmdcall][.rx]") { TEST_CASE("Caller::rx_zmqstartfnum", "[.cmdcall][.rx]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
auto prev_val = det.getRxZmqStartingFrame(); auto prev_val = det.getRxZmqStartingFrame();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -810,11 +966,16 @@ TEST_CASE("Caller::rx_zmqstartfnum", "[.cmdcall][.rx]") {
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
det.setRxZmqStartingFrame(prev_val[i], {i}); det.setRxZmqStartingFrame(prev_val[i], {i});
} }
} else {
REQUIRE_THROWS(caller.call("rx_zmqstartfnum", {}, -1, GET));
}
} }
TEST_CASE("Caller::rx_zmqport", "[.cmdcall][.rx]") { TEST_CASE("Caller::rx_zmqport", "[.cmdcall][.rx]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
auto prev_val_zmqport = det.getRxZmqPort(); auto prev_val_zmqport = det.getRxZmqPort();
auto prev_val_numinterfaces = det.getNumberofUDPInterfaces().tsquash( auto prev_val_numinterfaces = det.getNumberofUDPInterfaces().tsquash(
"inconsistent number of udp interfaces to test"); "inconsistent number of udp interfaces to test");
@ -832,18 +993,18 @@ TEST_CASE("Caller::rx_zmqport", "[.cmdcall][.rx]") {
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
std::ostringstream oss; std::ostringstream oss;
caller.call("rx_zmqport", {}, i, GET, oss); caller.call("rx_zmqport", {}, i, GET, oss);
REQUIRE(oss.str() == "rx_zmqport " + REQUIRE(oss.str() ==
std::to_string(port + i * socketsperdetector) + "rx_zmqport " +
'\n'); std::to_string(port + i * socketsperdetector) + '\n');
} }
port = 30001; port = 30001;
caller.call("rx_zmqport", {std::to_string(port)}, -1, PUT); caller.call("rx_zmqport", {std::to_string(port)}, -1, PUT);
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
std::ostringstream oss; std::ostringstream oss;
caller.call("rx_zmqport", {}, i, GET, oss); caller.call("rx_zmqport", {}, i, GET, oss);
REQUIRE(oss.str() == "rx_zmqport " + REQUIRE(oss.str() ==
std::to_string(port + i * socketsperdetector) + "rx_zmqport " +
'\n'); std::to_string(port + i * socketsperdetector) + '\n');
} }
test_valid_port_caller("rx_zmqport", {}, -1, PUT); test_valid_port_caller("rx_zmqport", {}, -1, PUT);
test_valid_port_caller("rx_zmqport", {}, 0, PUT); test_valid_port_caller("rx_zmqport", {}, 0, PUT);
@ -858,11 +1019,16 @@ TEST_CASE("Caller::rx_zmqport", "[.cmdcall][.rx]") {
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) { if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
det.setNumberofUDPInterfaces(prev_val_numinterfaces); det.setNumberofUDPInterfaces(prev_val_numinterfaces);
} }
} else {
REQUIRE_THROWS(caller.call("rx_zmqport", {}, -1, GET));
}
} }
TEST_CASE("Caller::rx_zmqip", "[.cmdcall][.rx]") { TEST_CASE("Caller::rx_zmqip", "[.cmdcall][.rx]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
auto prev_val = det.getRxZmqIP(); auto prev_val = det.getRxZmqIP();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -878,13 +1044,18 @@ TEST_CASE("Caller::rx_zmqip", "[.cmdcall][.rx]") {
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
det.setRxZmqIP(prev_val[i], {i}); det.setRxZmqIP(prev_val[i], {i});
} }
} else {
REQUIRE_THROWS(caller.call("rx_zmqip", {}, -1, GET));
}
} }
TEST_CASE("Caller::rx_zmqhwm", "[.cmdcall]") { TEST_CASE("Caller::rx_zmqhwm", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto prev_val = auto det_type = det.getDetectorType().squash();
det.getRxZmqHwm().tsquash("Inconsistent values for rx_zmqhwm to test"); if (det_type != defs::XILINX_CHIPTESTBOARD) {
auto prev_val = det.getRxZmqHwm().tsquash(
"Inconsistent values for rx_zmqhwm to test");
{ {
std::ostringstream oss; std::ostringstream oss;
caller.call("rx_zmqhwm", {"50"}, -1, PUT, oss); caller.call("rx_zmqhwm", {"50"}, -1, PUT, oss);
@ -906,6 +1077,9 @@ TEST_CASE("Caller::rx_zmqhwm", "[.cmdcall]") {
REQUIRE(oss.str() == "rx_zmqhwm -1\n"); REQUIRE(oss.str() == "rx_zmqhwm -1\n");
} }
det.setRxZmqHwm(prev_val); det.setRxZmqHwm(prev_val);
} else {
REQUIRE_THROWS(caller.call("rx_zmqhwm", {}, -1, GET));
}
} }
/* CTB Specific */ /* CTB Specific */
@ -976,18 +1150,22 @@ TEST_CASE("Caller::rx_dbitoffset", "[.cmdcall][.rx]") {
TEST_CASE("Caller::rx_jsonaddheader", "[.cmdcall][.rx]") { TEST_CASE("Caller::rx_jsonaddheader", "[.cmdcall][.rx]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
auto prev_val = det.getAdditionalJsonHeader(); auto prev_val = det.getAdditionalJsonHeader();
{ {
std::ostringstream oss; std::ostringstream oss;
caller.call("rx_jsonaddheader", {"key1", "value1", "key2", "value2"}, caller.call("rx_jsonaddheader",
-1, PUT, oss); {"key1", "value1", "key2", "value2"}, -1, PUT, oss);
REQUIRE(oss.str() == "rx_jsonaddheader {key1: value1, key2: value2}\n"); REQUIRE(oss.str() ==
"rx_jsonaddheader {key1: value1, key2: value2}\n");
} }
{ {
std::ostringstream oss; std::ostringstream oss;
caller.call("rx_jsonaddheader", {}, -1, GET, oss); caller.call("rx_jsonaddheader", {}, -1, GET, oss);
REQUIRE(oss.str() == "rx_jsonaddheader {key1: value1, key2: value2}\n"); REQUIRE(oss.str() ==
"rx_jsonaddheader {key1: value1, key2: value2}\n");
} }
{ {
std::ostringstream oss; std::ostringstream oss;
@ -997,11 +1175,16 @@ TEST_CASE("Caller::rx_jsonaddheader", "[.cmdcall][.rx]") {
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
det.setAdditionalJsonHeader(prev_val[i], {i}); det.setAdditionalJsonHeader(prev_val[i], {i});
} }
} else {
REQUIRE_THROWS(caller.call("rx_jsonaddheader", {}, -1, GET));
}
} }
TEST_CASE("Caller::rx_jsonpara", "[.cmdcall][.rx]") { TEST_CASE("Caller::rx_jsonpara", "[.cmdcall][.rx]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
auto prev_val = det.getAdditionalJsonHeader(); auto prev_val = det.getAdditionalJsonHeader();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -1027,6 +1210,9 @@ TEST_CASE("Caller::rx_jsonpara", "[.cmdcall][.rx]") {
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
det.setAdditionalJsonHeader(prev_val[i], {i}); det.setAdditionalJsonHeader(prev_val[i], {i});
} }
} else {
REQUIRE_THROWS(caller.call("rx_jsonpara", {}, -1, GET));
}
} }
/* Insignificant */ /* Insignificant */

View File

@ -27,30 +27,6 @@ TEST_CASE("CALLER::Caller::Calling help doesn't throw or cause segfault") {
caller.call(cmd, {}, -1, slsDetectorDefs::HELP_ACTION, os)); caller.call(cmd, {}, -1, slsDetectorDefs::HELP_ACTION, os));
} }
TEST_CASE("CALLER::Caller::period", "[.cmdcall]") {
Detector det;
Caller caller(&det);
auto prev_val = det.getPeriod();
{
std::ostringstream oss;
caller.call("period", {"1.25s"}, -1, PUT, oss);
REQUIRE(oss.str() == "period 1.25s\n");
}
{
std::ostringstream oss;
caller.call("period", {}, -1, GET, oss);
REQUIRE(oss.str() == "period 1.25s\n");
}
{
std::ostringstream oss;
caller.call("period", {"0"}, -1, PUT, oss);
REQUIRE(oss.str() == "period 0\n");
}
for (int i = 0; i != det.size(); ++i) {
det.setPeriod(prev_val[i], {i});
}
}
TEST_CASE("CALLER::Unknown command", "[.cmdcall]") { TEST_CASE("CALLER::Unknown command", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
@ -161,7 +137,7 @@ TEST_CASE("CALLER::serialnumber", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::EIGER) { if (det_type == defs::EIGER || det_type == defs::XILINX_CHIPTESTBOARD) {
REQUIRE_THROWS(caller.call("serialnumber", {}, -1, GET)); REQUIRE_THROWS(caller.call("serialnumber", {}, -1, GET));
} else { } else {
REQUIRE_NOTHROW(caller.call("serialnumber", {}, -1, GET)); REQUIRE_NOTHROW(caller.call("serialnumber", {}, -1, GET));
@ -203,7 +179,8 @@ TEST_CASE("CALLER::settingslist", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD) { if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD) {
REQUIRE_THROWS(caller.call("settingslist", {}, -1, GET)); REQUIRE_THROWS(caller.call("settingslist", {}, -1, GET));
} else { } else {
REQUIRE_NOTHROW(caller.call("settingslist", {}, -1, GET)); REQUIRE_NOTHROW(caller.call("settingslist", {}, -1, GET));
@ -848,12 +825,13 @@ TEST_CASE("CALLER::exptime", "[.cmdcall][.time]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
std::chrono::nanoseconds prev_val; std::chrono::nanoseconds prev_val;
if (det_type != defs::MYTHEN3) { if (det_type != defs::MYTHEN3) {
prev_val = det.getExptime().tsquash("inconsistent exptime to test"); prev_val = det.getExptime().tsquash("inconsistent exptime to test");
} else { } else {
auto t = auto t = det.getExptimeForAllGates().tsquash(
det.getExptimeForAllGates().tsquash("inconsistent exptime to test"); "inconsistent exptime to test");
if (t[0] != t[1] || t[1] != t[2]) { if (t[0] != t[1] || t[1] != t[2]) {
throw RuntimeError("inconsistent exptime for all gates"); throw RuntimeError("inconsistent exptime for all gates");
} }
@ -892,11 +870,16 @@ TEST_CASE("CALLER::exptime", "[.cmdcall][.time]") {
} }
} }
det.setExptime(-1, prev_val); det.setExptime(-1, prev_val);
} else {
REQUIRE_THROWS(caller.call("exptime", {}, -1, GET));
}
} }
TEST_CASE("CALLER::period", "[.cmdcall]") { TEST_CASE("CALLER::period", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
auto prev_val = det.getPeriod(); auto prev_val = det.getPeriod();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -916,12 +899,16 @@ TEST_CASE("CALLER::period", "[.cmdcall]") {
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
det.setPeriod(prev_val[i], {i}); det.setPeriod(prev_val[i], {i});
} }
} else {
REQUIRE_THROWS(caller.call("period", {}, -1, GET));
}
} }
TEST_CASE("CALLER::delay", "[.cmdcall]") { TEST_CASE("CALLER::delay", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
if (det_type == defs::EIGER) { if (det_type == defs::EIGER) {
REQUIRE_THROWS(caller.call("delay", {"1"}, -1, PUT)); REQUIRE_THROWS(caller.call("delay", {"1"}, -1, PUT));
REQUIRE_THROWS(caller.call("delay", {}, -1, GET)); REQUIRE_THROWS(caller.call("delay", {}, -1, GET));
@ -949,6 +936,9 @@ TEST_CASE("CALLER::delay", "[.cmdcall]") {
det.setDelayAfterTrigger(prev_val[i], {i}); det.setDelayAfterTrigger(prev_val[i], {i});
} }
} }
} else {
REQUIRE_THROWS(caller.call("delay", {}, -1, GET));
}
} }
TEST_CASE("CALLER::framesl", "[.cmdcall]") { TEST_CASE("CALLER::framesl", "[.cmdcall]") {
@ -980,6 +970,7 @@ TEST_CASE("CALLER::delayl", "[.cmdcall]") {
switch (det_type) { switch (det_type) {
case defs::EIGER: case defs::EIGER:
case defs::CHIPTESTBOARD: case defs::CHIPTESTBOARD:
case defs::XILINX_CHIPTESTBOARD:
case defs::GOTTHARD2: case defs::GOTTHARD2:
case defs::MYTHEN3: case defs::MYTHEN3:
REQUIRE_THROWS(caller.call("delayl", {}, -1, GET)); REQUIRE_THROWS(caller.call("delayl", {}, -1, GET));
@ -997,6 +988,7 @@ TEST_CASE("CALLER::periodl", "[.cmdcall]") {
switch (det_type) { switch (det_type) {
case defs::EIGER: case defs::EIGER:
case defs::CHIPTESTBOARD: case defs::CHIPTESTBOARD:
case defs::XILINX_CHIPTESTBOARD:
case defs::GOTTHARD2: case defs::GOTTHARD2:
case defs::MYTHEN3: case defs::MYTHEN3:
REQUIRE_THROWS(caller.call("periodl", {}, -1, GET)); REQUIRE_THROWS(caller.call("periodl", {}, -1, GET));
@ -1059,6 +1051,7 @@ TEST_CASE("CALLER::drlist", "[.cmdcall]") {
TEST_CASE("CALLER::timing", "[.cmdcall]") { TEST_CASE("CALLER::timing", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
auto prev_val = det.getTimingMode(); auto prev_val = det.getTimingMode();
det.setTimingMode(defs::AUTO_TIMING); det.setTimingMode(defs::AUTO_TIMING);
{ {
@ -1075,7 +1068,6 @@ TEST_CASE("CALLER::timing", "[.cmdcall]") {
caller.call("timing", {}, -1, GET, oss2); caller.call("timing", {}, -1, GET, oss2);
REQUIRE(oss2.str() == "timing trigger\n"); REQUIRE(oss2.str() == "timing trigger\n");
} }
auto det_type = det.getDetectorType().squash();
if (det_type == defs::EIGER) { if (det_type == defs::EIGER) {
{ {
std::ostringstream oss1, oss2; std::ostringstream oss1, oss2;
@ -1417,6 +1409,7 @@ TEST_CASE("CALLER::highvoltage", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
auto prev_val = det.getHighVoltage(); auto prev_val = det.getHighVoltage();
// selected values // selected values
if (det_type == defs::GOTTHARD) { if (det_type == defs::GOTTHARD) {
@ -1509,6 +1502,10 @@ TEST_CASE("CALLER::highvoltage", "[.cmdcall]") {
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
det.setHighVoltage(prev_val[i], {i}); det.setHighVoltage(prev_val[i], {i});
} }
} else {
REQUIRE_THROWS(caller.call("highvoltage", {"0"}, -1, PUT));
REQUIRE_THROWS(caller.call("highvoltage", {}, -1, GET));
}
} }
TEST_CASE("CALLER::powerchip", "[.cmdcall]") { TEST_CASE("CALLER::powerchip", "[.cmdcall]") {
@ -2005,7 +2002,8 @@ TEST_CASE("CALLER::temp_fpga", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type != defs::CHIPTESTBOARD) { if (det_type != defs::CHIPTESTBOARD &&
det_type != defs::XILINX_CHIPTESTBOARD) {
REQUIRE_NOTHROW(caller.call("temp_fpga", {}, -1, GET)); REQUIRE_NOTHROW(caller.call("temp_fpga", {}, -1, GET));
std::ostringstream oss; std::ostringstream oss;
REQUIRE_NOTHROW(caller.call("temp_fpga", {}, 0, GET, oss)); REQUIRE_NOTHROW(caller.call("temp_fpga", {}, 0, GET, oss));
@ -2056,15 +2054,21 @@ TEST_CASE("CALLER::daclist", "[.cmdcall]") {
TEST_CASE("CALLER::dacvalues", "[.cmdcall]") { TEST_CASE("CALLER::dacvalues", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
REQUIRE_NOTHROW(caller.call("dacvalues", {}, -1, GET)); REQUIRE_NOTHROW(caller.call("dacvalues", {}, -1, GET));
REQUIRE_THROWS(caller.call("dacvalues", {}, -1, PUT)); REQUIRE_THROWS(caller.call("dacvalues", {}, -1, PUT));
} else {
REQUIRE_THROWS(caller.call("dacvalues", {}, -1, GET));
}
} }
TEST_CASE("CALLER::defaultdac", "[.cmdcall]") { TEST_CASE("CALLER::defaultdac", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type != defs::CHIPTESTBOARD) { if (det_type != defs::CHIPTESTBOARD &&
det_type != defs::XILINX_CHIPTESTBOARD) {
REQUIRE_THROWS(caller.call("defaultdac", {}, -1, GET)); REQUIRE_THROWS(caller.call("defaultdac", {}, -1, GET));
REQUIRE_THROWS(caller.call("defaultdac", {"blabla"}, -1, PUT)); REQUIRE_THROWS(caller.call("defaultdac", {"blabla"}, -1, PUT));
auto daclist = det.getDacList(); auto daclist = det.getDacList();
@ -2123,7 +2127,8 @@ TEST_CASE("CALLER::resetdacs", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type != defs::CHIPTESTBOARD) { if (det_type != defs::CHIPTESTBOARD &&
det_type != defs::XILINX_CHIPTESTBOARD) {
auto prev_val = det.getSettings(); auto prev_val = det.getSettings();
REQUIRE_THROWS(caller.call("resetdacs", {}, -1, GET)); REQUIRE_THROWS(caller.call("resetdacs", {}, -1, GET));
@ -2241,6 +2246,8 @@ TEST_CASE("CALLER::clearbusy", "[.cmdcall]") {
TEST_CASE("CALLER::start", "[.cmdcall]") { TEST_CASE("CALLER::start", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
// PUT only command // PUT only command
REQUIRE_THROWS(caller.call("start", {}, -1, GET)); REQUIRE_THROWS(caller.call("start", {}, -1, GET));
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
@ -2248,8 +2255,8 @@ TEST_CASE("CALLER::start", "[.cmdcall]") {
if (det_type != defs::MYTHEN3) { if (det_type != defs::MYTHEN3) {
prev_val = det.getExptime().tsquash("inconsistent exptime to test"); prev_val = det.getExptime().tsquash("inconsistent exptime to test");
} else { } else {
auto t = auto t = det.getExptimeForAllGates().tsquash(
det.getExptimeForAllGates().tsquash("inconsistent exptime to test"); "inconsistent exptime to test");
if (t[0] != t[1] || t[1] != t[2]) { if (t[0] != t[1] || t[1] != t[2]) {
throw RuntimeError("inconsistent exptime for all gates"); throw RuntimeError("inconsistent exptime for all gates");
} }
@ -2257,7 +2264,8 @@ TEST_CASE("CALLER::start", "[.cmdcall]") {
} }
auto prev_frames = auto prev_frames =
det.getNumberOfFrames().tsquash("inconsistent #frames in test"); det.getNumberOfFrames().tsquash("inconsistent #frames in test");
auto prev_period = det.getPeriod().tsquash("inconsistent period in test"); auto prev_period =
det.getPeriod().tsquash("inconsistent period in test");
det.setExptime(-1, std::chrono::microseconds(200)); det.setExptime(-1, std::chrono::microseconds(200));
det.setPeriod(std::chrono::milliseconds(1)); det.setPeriod(std::chrono::milliseconds(1));
det.setNumberOfFrames(2000); det.setNumberOfFrames(2000);
@ -2275,11 +2283,16 @@ TEST_CASE("CALLER::start", "[.cmdcall]") {
det.setExptime(-1, prev_val); det.setExptime(-1, prev_val);
det.setPeriod(prev_period); det.setPeriod(prev_period);
det.setNumberOfFrames(prev_frames); det.setNumberOfFrames(prev_frames);
} else {
REQUIRE_THROWS(caller.call("start", {}, -1, GET));
}
} }
TEST_CASE("CALLER::stop", "[.cmdcall]") { TEST_CASE("CALLER::stop", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
// PUT only command // PUT only command
REQUIRE_THROWS(caller.call("stop", {}, -1, GET)); REQUIRE_THROWS(caller.call("stop", {}, -1, GET));
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
@ -2287,8 +2300,8 @@ TEST_CASE("CALLER::stop", "[.cmdcall]") {
if (det_type != defs::MYTHEN3) { if (det_type != defs::MYTHEN3) {
prev_val = det.getExptime().tsquash("inconsistent exptime to test"); prev_val = det.getExptime().tsquash("inconsistent exptime to test");
} else { } else {
auto t = auto t = det.getExptimeForAllGates().tsquash(
det.getExptimeForAllGates().tsquash("inconsistent exptime to test"); "inconsistent exptime to test");
if (t[0] != t[1] || t[1] != t[2]) { if (t[0] != t[1] || t[1] != t[2]) {
throw RuntimeError("inconsistent exptime for all gates"); throw RuntimeError("inconsistent exptime for all gates");
} }
@ -2296,7 +2309,8 @@ TEST_CASE("CALLER::stop", "[.cmdcall]") {
} }
auto prev_frames = auto prev_frames =
det.getNumberOfFrames().tsquash("inconsistent #frames in test"); det.getNumberOfFrames().tsquash("inconsistent #frames in test");
auto prev_period = det.getPeriod().tsquash("inconsistent period in test"); auto prev_period =
det.getPeriod().tsquash("inconsistent period in test");
det.setExptime(-1, std::chrono::microseconds(200)); det.setExptime(-1, std::chrono::microseconds(200));
det.setPeriod(std::chrono::milliseconds(1)); det.setPeriod(std::chrono::milliseconds(1));
det.setNumberOfFrames(2000); det.setNumberOfFrames(2000);
@ -2320,18 +2334,22 @@ TEST_CASE("CALLER::stop", "[.cmdcall]") {
det.setExptime(-1, prev_val); det.setExptime(-1, prev_val);
det.setPeriod(prev_period); det.setPeriod(prev_period);
det.setNumberOfFrames(prev_frames); det.setNumberOfFrames(prev_frames);
} else {
REQUIRE_THROWS(caller.call("stop", {}, -1, GET));
}
} }
TEST_CASE("CALLER::status", "[.cmdcall]") { TEST_CASE("CALLER::status", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
std::chrono::nanoseconds prev_val; std::chrono::nanoseconds prev_val;
if (det_type != defs::MYTHEN3) { if (det_type != defs::MYTHEN3) {
prev_val = det.getExptime().tsquash("inconsistent exptime to test"); prev_val = det.getExptime().tsquash("inconsistent exptime to test");
} else { } else {
auto t = auto t = det.getExptimeForAllGates().tsquash(
det.getExptimeForAllGates().tsquash("inconsistent exptime to test"); "inconsistent exptime to test");
if (t[0] != t[1] || t[1] != t[2]) { if (t[0] != t[1] || t[1] != t[2]) {
throw RuntimeError("inconsistent exptime for all gates"); throw RuntimeError("inconsistent exptime for all gates");
} }
@ -2339,7 +2357,8 @@ TEST_CASE("CALLER::status", "[.cmdcall]") {
} }
auto prev_frames = auto prev_frames =
det.getNumberOfFrames().tsquash("inconsistent #frames in test"); det.getNumberOfFrames().tsquash("inconsistent #frames in test");
auto prev_period = det.getPeriod().tsquash("inconsistent period in test"); auto prev_period =
det.getPeriod().tsquash("inconsistent period in test");
det.setExptime(-1, std::chrono::microseconds(200)); det.setExptime(-1, std::chrono::microseconds(200));
det.setPeriod(std::chrono::milliseconds(1)); det.setPeriod(std::chrono::milliseconds(1));
det.setNumberOfFrames(2000); det.setNumberOfFrames(2000);
@ -2359,6 +2378,9 @@ TEST_CASE("CALLER::status", "[.cmdcall]") {
det.setExptime(-1, prev_val); det.setExptime(-1, prev_val);
det.setPeriod(prev_period); det.setPeriod(prev_period);
det.setNumberOfFrames(prev_frames); det.setNumberOfFrames(prev_frames);
} else {
REQUIRE_THROWS(caller.call("status", {}, -1, GET));
}
} }
TEST_CASE("CALLER::nextframenumber", "[.cmdcall]") { TEST_CASE("CALLER::nextframenumber", "[.cmdcall]") {
@ -2433,6 +2455,7 @@ TEST_CASE("CALLER::scan", "[.cmdcall]") {
defs::dacIndex ind = defs::DAC_0; defs::dacIndex ind = defs::DAC_0;
defs::dacIndex notImplementedInd = defs::DAC_0; defs::dacIndex notImplementedInd = defs::DAC_0;
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
switch (det_type) { switch (det_type) {
case defs::CHIPTESTBOARD: case defs::CHIPTESTBOARD:
ind = defs::DAC_0; ind = defs::DAC_0;
@ -2475,8 +2498,8 @@ TEST_CASE("CALLER::scan", "[.cmdcall]") {
} else { } else {
{ {
std::ostringstream oss; std::ostringstream oss;
caller.call("scan", {ToString(ind), "500", "1500", "500"}, -1, PUT, caller.call("scan", {ToString(ind), "500", "1500", "500"}, -1,
oss); PUT, oss);
CHECK(oss.str() == CHECK(oss.str() ==
"scan [" + ToString(ind) + ", 500, 1500, 500]\n"); "scan [" + ToString(ind) + ", 500, 1500, 500]\n");
} }
@ -2489,8 +2512,8 @@ TEST_CASE("CALLER::scan", "[.cmdcall]") {
} }
{ {
std::ostringstream oss; std::ostringstream oss;
caller.call("scan", {ToString(ind), "500", "1500", "500", "2s"}, -1, caller.call("scan", {ToString(ind), "500", "1500", "500", "2s"},
PUT, oss); -1, PUT, oss);
CHECK(oss.str() == CHECK(oss.str() ==
"scan [" + ToString(ind) + ", 500, 1500, 500, 2s]\n"); "scan [" + ToString(ind) + ", 500, 1500, 500, 2s]\n");
} }
@ -2513,18 +2536,18 @@ TEST_CASE("CALLER::scan", "[.cmdcall]") {
} }
{ {
std::ostringstream oss; std::ostringstream oss;
caller.call("scan", {ToString(ind), "1500", "500", "-500"}, -1, PUT, caller.call("scan", {ToString(ind), "1500", "500", "-500"}, -1,
oss); PUT, oss);
CHECK(oss.str() == CHECK(oss.str() ==
"scan [" + ToString(ind) + ", 1500, 500, -500]\n"); "scan [" + ToString(ind) + ", 1500, 500, -500]\n");
} }
CHECK_THROWS(caller.call( CHECK_THROWS(caller.call(
"scan", {ToString(notImplementedInd), "500", "1500", "500"}, -1, "scan", {ToString(notImplementedInd), "500", "1500", "500"}, -1,
PUT)); PUT));
CHECK_THROWS(caller.call("scan", {ToString(ind), "500", "1500", "-500"}, CHECK_THROWS(caller.call(
-1, PUT)); "scan", {ToString(ind), "500", "1500", "-500"}, -1, PUT));
CHECK_THROWS(caller.call("scan", {ToString(ind), "1500", "500", "500"}, CHECK_THROWS(caller.call(
-1, PUT)); "scan", {ToString(ind), "1500", "500", "500"}, -1, PUT));
if (det_type == defs::MYTHEN3 || defs::EIGER) { if (det_type == defs::MYTHEN3 || defs::EIGER) {
{ {
@ -2550,10 +2573,14 @@ TEST_CASE("CALLER::scan", "[.cmdcall]") {
// Reset all dacs to previous value // Reset all dacs to previous value
// for (int i = 0; i != det.size(); ++i) { // for (int i = 0; i != det.size(); ++i) {
// det.setDAC(ind, previous[i], false, {i}); // det.setDAC(ind, previous[i], false, {i});
// det.setDAC(notImplementedInd, notImplementedPrevious[i], false, // det.setDAC(notImplementedInd, notImplementedPrevious[i],
// {i}); // false, {i});
// } // }
} }
} else {
REQUIRE_THROWS(caller.call(
"scan", {ToString(defs::DAC_0), "500", "1500", "500"}, -1, PUT));
}
} }
TEST_CASE("CALLER::scanerrmsg", "[.cmdcall]") { TEST_CASE("CALLER::scanerrmsg", "[.cmdcall]") {
@ -2608,6 +2635,8 @@ TEST_CASE("CALLER::numinterfaces", "[.cmdcall]") {
TEST_CASE("CALLER::udp_srcip", "[.cmdcall]") { TEST_CASE("CALLER::udp_srcip", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
auto prev_val = det.getSourceUDPIP(); auto prev_val = det.getSourceUDPIP();
REQUIRE_THROWS(caller.call("udp_srcip", {"0.0.0.0"}, -1, PUT)); REQUIRE_THROWS(caller.call("udp_srcip", {"0.0.0.0"}, -1, PUT));
{ {
@ -2618,6 +2647,9 @@ TEST_CASE("CALLER::udp_srcip", "[.cmdcall]") {
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
det.setSourceUDPIP(prev_val[i], {i}); det.setSourceUDPIP(prev_val[i], {i});
} }
} else {
REQUIRE_THROWS(caller.call("udp_srcip", {}, -1, GET));
}
} }
TEST_CASE("CALLER::udp_dstlist", "[.cmdcall]") { TEST_CASE("CALLER::udp_dstlist", "[.cmdcall]") {
@ -2652,9 +2684,14 @@ TEST_CASE("CALLER::udp_numdst", "[.cmdcall]") {
TEST_CASE("CALLER::udp_cleardst", "[.cmdcall]") { TEST_CASE("CALLER::udp_cleardst", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
REQUIRE_THROWS(caller.call("udp_cleardst", {}, -1, GET)); REQUIRE_THROWS(caller.call("udp_cleardst", {}, -1, GET));
/* dont clear all udp destinations */ /* dont clear all udp destinations */
/*REQUIRE_NOTHROW(caller.call("udp_cleardst", {}, -1, PUT));*/ /*REQUIRE_NOTHROW(caller.call("udp_cleardst", {}, -1, PUT));*/
} else {
REQUIRE_THROWS(caller.call("udp_cleardst", {}, -1, PUT));
}
} }
TEST_CASE("CALLER::udp_firstdst", "[.cmdcall]") { TEST_CASE("CALLER::udp_firstdst", "[.cmdcall]") {
@ -2700,8 +2737,11 @@ TEST_CASE("CALLER::udp_dstip", "[.cmdcall]") {
TEST_CASE("CALLER::udp_srcmac", "[.cmdcall]") { TEST_CASE("CALLER::udp_srcmac", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
auto prev_val = det.getSourceUDPMAC(); auto prev_val = det.getSourceUDPMAC();
REQUIRE_THROWS(caller.call("udp_srcmac", {"00:00:00:00:00:00"}, -1, PUT)); REQUIRE_THROWS(
caller.call("udp_srcmac", {"00:00:00:00:00:00"}, -1, PUT));
{ {
std::ostringstream oss; std::ostringstream oss;
caller.call("udp_srcmac", {"00:50:c2:42:34:12"}, -1, PUT, oss); caller.call("udp_srcmac", {"00:50:c2:42:34:12"}, -1, PUT, oss);
@ -2712,6 +2752,9 @@ TEST_CASE("CALLER::udp_srcmac", "[.cmdcall]") {
det.setSourceUDPMAC(prev_val[i], {i}); det.setSourceUDPMAC(prev_val[i], {i});
} }
} }
} else {
REQUIRE_THROWS(caller.call("udp_srcmac", {}, -1, GET));
}
} }
TEST_CASE("CALLER::udp_dstmac", "[.cmdcall]") { TEST_CASE("CALLER::udp_dstmac", "[.cmdcall]") {
@ -2723,6 +2766,8 @@ TEST_CASE("CALLER::udp_dstmac", "[.cmdcall]") {
TEST_CASE("CALLER::udp_dstport", "[.cmdcall]") { TEST_CASE("CALLER::udp_dstport", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
auto prev_val = det.getDestinationUDPPort(); auto prev_val = det.getDestinationUDPPort();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -2739,6 +2784,9 @@ TEST_CASE("CALLER::udp_dstport", "[.cmdcall]") {
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
det.setDestinationUDPPort(prev_val[i], {i}); det.setDestinationUDPPort(prev_val[i], {i});
} }
} else {
REQUIRE_THROWS(caller.call("udp_dstport", {}, -1, GET));
}
} }
TEST_CASE("CALLER::udp_srcip2", "[.cmdcall]") { TEST_CASE("CALLER::udp_srcip2", "[.cmdcall]") {
@ -2844,15 +2892,25 @@ TEST_CASE("CALLER::udp_dstport2", "[.cmdcall]") {
TEST_CASE("CALLER::udp_reconfigure", "[.cmdcall]") { TEST_CASE("CALLER::udp_reconfigure", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
REQUIRE_THROWS(caller.call("udp_reconfigure", {}, -1, GET)); REQUIRE_THROWS(caller.call("udp_reconfigure", {}, -1, GET));
REQUIRE_NOTHROW(caller.call("udp_reconfigure", {}, -1, PUT)); REQUIRE_NOTHROW(caller.call("udp_reconfigure", {}, -1, PUT));
} else {
REQUIRE_THROWS(caller.call("udp_reconfigure", {}, -1, PUT));
}
} }
TEST_CASE("CALLER::udp_validate", "[.cmdcall]") { TEST_CASE("CALLER::udp_validate", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
REQUIRE_THROWS(caller.call("udp_validate", {}, -1, GET)); REQUIRE_THROWS(caller.call("udp_validate", {}, -1, GET));
REQUIRE_NOTHROW(caller.call("udp_validate", {}, -1, PUT)); REQUIRE_NOTHROW(caller.call("udp_validate", {}, -1, PUT));
} else {
REQUIRE_THROWS(caller.call("udp_validate", {}, -1, PUT));
}
} }
TEST_CASE("CALLER::tengiga", "[.cmdcall]") { TEST_CASE("CALLER::tengiga", "[.cmdcall]") {
@ -3072,6 +3130,8 @@ TEST_CASE("CALLER::zmqport", "[.cmdcall]") {
TEST_CASE("CALLER::zmqip", "[.cmdcall]") { TEST_CASE("CALLER::zmqip", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
std::ostringstream oss1, oss2; std::ostringstream oss1, oss2;
auto zmqip = det.getClientZmqIp(); auto zmqip = det.getClientZmqIp();
caller.call("zmqip", {}, 0, GET, oss1); caller.call("zmqip", {}, 0, GET, oss1);
@ -3083,6 +3143,7 @@ TEST_CASE("CALLER::zmqip", "[.cmdcall]") {
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
det.setRxZmqIP(zmqip[i], {i}); det.setRxZmqIP(zmqip[i], {i});
} }
}
} }
TEST_CASE("CALLER::zmqhwm", "[.cmdcall]") { TEST_CASE("CALLER::zmqhwm", "[.cmdcall]") {
@ -3238,6 +3299,7 @@ TEST_CASE("CALLER::reg", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type != defs::XILINX_CHIPTESTBOARD) {
if (det_type != defs::EIGER) { if (det_type != defs::EIGER) {
uint32_t addr = 0x64; uint32_t addr = 0x64;
std::string saddr = ToStringHex(addr); std::string saddr = ToStringHex(addr);
@ -3257,6 +3319,9 @@ TEST_CASE("CALLER::reg", "[.cmdcall]") {
else { else {
REQUIRE_NOTHROW(caller.call("reg", {"0x64"}, -1, GET)); REQUIRE_NOTHROW(caller.call("reg", {"0x64"}, -1, GET));
} }
} else {
REQUIRE_THROWS(caller.call("reg", {}, -1, GET));
}
} }
TEST_CASE("CALLER::adcreg", "[.cmdcall]") { TEST_CASE("CALLER::adcreg", "[.cmdcall]") {
@ -3281,7 +3346,7 @@ TEST_CASE("CALLER::setbit", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type != defs::EIGER) { if (det_type != defs::EIGER && det_type != defs::XILINX_CHIPTESTBOARD) {
uint32_t addr = 0x64; uint32_t addr = 0x64;
std::string saddr = ToStringHex(addr); std::string saddr = ToStringHex(addr);
auto prev_val = det.readRegister(addr); auto prev_val = det.readRegister(addr);
@ -3303,7 +3368,7 @@ TEST_CASE("CALLER::clearbit", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type != defs::EIGER) { if (det_type != defs::EIGER && det_type != defs::XILINX_CHIPTESTBOARD) {
uint32_t addr = 0x64; uint32_t addr = 0x64;
std::string saddr = ToStringHex(addr); std::string saddr = ToStringHex(addr);
auto prev_val = det.readRegister(addr); auto prev_val = det.readRegister(addr);
@ -3325,7 +3390,9 @@ TEST_CASE("CALLER::getbit", "[.cmdcall]") {
Detector det; Detector det;
Caller caller(&det); Caller caller(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type != defs::EIGER) { if (det_type == defs::XILINX_CHIPTESTBOARD) {
REQUIRE_THROWS(caller.call("getbit", {"0x64", "1"}, -1, GET));
} else if (det_type != defs::EIGER) {
uint32_t addr = 0x64; uint32_t addr = 0x64;
std::string saddr = ToStringHex(addr); std::string saddr = ToStringHex(addr);
auto prev_val = det.readRegister(addr); auto prev_val = det.readRegister(addr);

View File

@ -4,11 +4,11 @@
#define RELEASE "developer" #define RELEASE "developer"
#define APILIB "developer 0x230224" #define APILIB "developer 0x230224"
#define APIRECEIVER "developer 0x230224" #define APIRECEIVER "developer 0x230224"
#define APIXILINXCTB "developer 0x240104" #define APICTB "developer 0x240110"
#define APICTB "developer 0x240104" #define APIGOTTHARD "developer 0x240110"
#define APIGOTTHARD "developer 0x240104" #define APIGOTTHARD2 "developer 0x240110"
#define APIGOTTHARD2 "developer 0x240104" #define APIJUNGFRAU "developer 0x240110"
#define APIJUNGFRAU "developer 0x240104" #define APIMYTHEN3 "developer 0x240110"
#define APIMYTHEN3 "developer 0x240104" #define APIMOENCH "developer 0x240110"
#define APIMOENCH "developer 0x240104" #define APIEIGER "developer 0x240110"
#define APIEIGER "developer 0x240104" #define APIXILINXCTB "developer 0x240111"

View File

@ -99,7 +99,9 @@ def loadConfig(name, rx_hostname, settingsdir):
Log(Fore.GREEN, 'Loading config') Log(Fore.GREEN, 'Loading config')
try: try:
d = Detector() d = Detector()
if name == 'eiger': if name == 'xilinx_ctb':
d.hostname = 'localhost'
elif name == 'eiger':
d.hostname = 'localhost:' + str(DEFAULT_TCP_CNTRL_PORTNO) + '+localhost:' + str(HALFMOD2_TCP_CNTRL_PORTNO) d.hostname = 'localhost:' + str(DEFAULT_TCP_CNTRL_PORTNO) + '+localhost:' + str(HALFMOD2_TCP_CNTRL_PORTNO)
#d.udp_dstport = {2: 50003} #d.udp_dstport = {2: 50003}
# will set up for every module # will set up for every module
@ -174,6 +176,7 @@ if args.servers is None:
'gotthard', 'gotthard',
'ctb', 'ctb',
'moench', 'moench',
'xilinx_ctb'
] ]
else: else:
servers = args.servers servers = args.servers