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,8 +58,8 @@ 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"));
return FAIL; return FAIL;
@ -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};
@ -167,7 +166,7 @@ int validateKernelVersion(char *expectedVersion) {
#endif #endif
#endif #endif
currentVersion[sizeof(currentVersion) - 1] = '\0'; currentVersion[sizeof(currentVersion) - 1] = '\0';
// convert kernel date string into time // convert kernel date string into time
time_t kernelDate; time_t kernelDate;
if (getTimeFromString(currentVersion, &kernelDate) == FAIL) { if (getTimeFromString(currentVersion, &kernelDate) == FAIL) {

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,24 +313,24 @@ 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:
return -1; return -1;
@ -369,29 +371,29 @@ 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
default: default:
@ -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)) {
test_dac_caller(static_cast<defs::dacIndex>(i), "dac", 0); if (det_type == defs::CHIPTESTBOARD) {
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;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

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