Xilinx ctb (#884)

* updated registers, arm64

* compiler set to aarch64 for xilinx server

* updated RegisterDefs.h

* merge into generate branch and resolving conflicts and adding the xilinx changes to callerspecial and commands.yaml

* compiles and can print firmware version (using a different csp0 address)

* fixing other servers (gotthard, jungfrau, moench, mythen3) that it returns in case of mapping failure, xilinxctb: added that it checks type, prints proper fw version, checks kernel date, added armprocessor define to use in common places, added specifiers to supress overflow and truncation warnings

* added detector ip and mac adddress to the printout

* fixed tests and recompiled servers
This commit is contained in:
maliakal_d 2024-01-04 17:10:16 +01:00 committed by GitHub
parent 4f4125a3b2
commit 9738cb7d74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
35 changed files with 1602 additions and 316 deletions

View File

@ -11,6 +11,7 @@ install(TARGETS slsProjectCSettings
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
add_subdirectory(ctbDetectorServer)
add_subdirectory(xilinx_ctbDetectorServer)
add_subdirectory(eigerDetectorServer)
add_subdirectory(gotthardDetectorServer)
add_subdirectory(jungfrauDetectorServer)

View File

@ -90,6 +90,7 @@ void basictests() {
"Could not map to memory. Cannot proceed. Check Firmware.\n");
LOG(logERROR, (initErrorMessage));
initError = FAIL;
return;
}
#ifndef VIRTUAL
// does check only if flag is 0 (by default), set by command line

View File

@ -88,6 +88,7 @@ void basictests() {
"Could not map to memory. Cannot proceed. Check Firmware.\n");
LOG(logERROR, (initErrorMessage));
initError = FAIL;
return;
}
#ifndef VIRTUAL
// does check only if flag is 0 (by default), set by command line

View File

@ -82,6 +82,7 @@ void basictests() {
"Could not map to memory. Cannot proceed. Check Firmware.\n");
LOG(logERROR, ("%s\n\n", initErrorMessage));
initError = FAIL;
return;
}
#ifndef VIRTUAL
// does check only if flag is 0 (by default), set by command line

View File

@ -92,6 +92,7 @@ void basictests() {
"Could not map to memory. Cannot proceed. Check Firmware.\n");
LOG(logERROR, (initErrorMessage));
initError = FAIL;
return;
}
#ifndef VIRTUAL
// does check only if flag is 0 (by default), set by command line

View File

@ -0,0 +1,10 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#pragma once
#include <inttypes.h>
#include <sys/types.h>
int mapCSP0(void);
void bus_w(u_int32_t offset, u_int32_t data);
u_int32_t bus_r(u_int32_t offset);

View File

@ -25,6 +25,10 @@
#include "blackfin.h"
#endif
#ifdef ARMPROCESSOR
#include "arm64.h"
#endif
#ifdef MYTHEN3D
#include "mythen3.h"
#endif
@ -61,9 +65,10 @@ typedef struct udpStruct_s {
int isInitCheckDone();
int getInitResult(char **mess);
void basictests();
int checkType();
#if defined(GOTTHARDD) || defined(JUNGFRAUD) || defined(MOENCHD) || \
defined(CHIPTESTBOARDD) || defined(MYTHEN3D) || defined(GOTTHARD2D)
int checkType();
int testFpga();
int testBus();
#endif
@ -81,13 +86,17 @@ u_int64_t getFirmwareVersion();
#ifdef EIGERD
uint64_t getFrontEndFirmwareVersion(enum fpgaPosition fpgaPosition);
#endif
#ifndef XILINX_CHIPTESTBOARDD
u_int64_t getFirmwareAPIVersion();
void getHardwareVersion(char *version);
#endif
#ifdef EIGERD
int getHardwareVersionNumber();
#else
#ifndef XILINX_CHIPTESTBOARDD
u_int16_t getHardwareVersionNumber();
#endif
#endif
#if defined(JUNGFRAUD) || defined(MOENCHD) || defined(CHIPTESTBOARDD)
u_int16_t getHardwareSerialNumber();
#endif
@ -111,7 +120,6 @@ int updateModuleId();
void setModuleId(int modid);
#endif
#endif
u_int64_t getDetectorMAC();
u_int32_t getDetectorIP();
@ -136,7 +144,7 @@ int updateDatabytesandAllocateRAM();
void updateDataBytes();
#endif
#ifndef CHIPTESTBOARDD
#if !defined(CHIPTESTBOARDD) && !defined(XILINX_CHIPTESTBOARDD)
int resetToDefaultDacs(int hardReset);
int getDefaultDac(enum DACINDEX index, enum detectorSettings sett, int *retval);
int setDefaultDac(enum DACINDEX index, enum detectorSettings sett, int value);
@ -191,8 +199,10 @@ void setMasterSlaveConfiguration();
#endif
// parameters - dr, roi
#ifndef XILINX_CHIPTESTBOARDD
int setDynamicRange(int dr);
int getDynamicRange(int *retval);
#endif
#ifdef GOTTHARDD
int setROI(ROI arg);
ROI getROI();
@ -241,6 +251,7 @@ int getMaxStoragecellStart();
int setNextFrameNumber(uint64_t value);
int getNextFrameNumber(uint64_t *value);
#endif
#ifndef XILINX_CHIPTESTBOARDD
void setNumFrames(int64_t val);
int64_t getNumFrames();
void setNumTriggers(int64_t val);
@ -251,6 +262,7 @@ int64_t getExpTime();
#endif
int setPeriod(int64_t val);
int64_t getPeriod();
#endif
#ifdef MYTHEN3D
void setNumIntGates(int val);
void setNumGates(int val);
@ -337,10 +349,12 @@ int setTrimbits(int *trimbits);
int setAllTrimbits(int val);
int getAllTrimbits();
#endif
#ifndef XILINX_CHIPTESTBOARDD
#ifndef CHIPTESTBOARDD
enum detectorSettings setSettings(enum detectorSettings sett);
#endif
enum detectorSettings getSettings();
#endif
#if defined(JUNGFRAUD)
enum gainMode getGainMode();
void setGainMode(enum gainMode mode);
@ -366,10 +380,14 @@ void setDAC(enum DACINDEX ind, int val, int mV, int counterEnableCheck);
void setGeneralDAC(enum DACINDEX ind, int val, int mV);
void setVthDac(int index, int enable);
#else
#ifndef XILINX_CHIPTESTBOARDD
void setDAC(enum DACINDEX ind, int val, int mV);
#endif
#endif
#ifndef XILINX_CHIPTESTBOARDD
int getDAC(enum DACINDEX ind, int mV);
int getMaxDacSteps();
#endif
#if defined(CHIPTESTBOARDD)
int dacToVoltage(int dac);
int checkVLimitCompliant(int mV);
@ -394,14 +412,17 @@ void powerOff();
#if defined(MYTHEN3D) || defined(GOTTHARD2D)
int getADC(enum ADCINDEX ind, int *value);
#else
#ifndef XILINX_CHIPTESTBOARDD
int getADC(enum ADCINDEX ind);
#endif
#endif
#ifdef CHIPTESTBOARDD
int getSlowADC(int ichan);
int getSlowADCTemperature();
#endif
#ifndef XILINX_CHIPTESTBOARDD
int setHighVoltage(int val);
#endif
// parameters - timing, extsig
#if defined(EIGERD) || defined(GOTTHARD2D) || defined(JUNGFRAUD) || \
@ -426,8 +447,10 @@ void setSynchronization(int enable);
void updatingRegisters();
int updateClockDivs();
#endif
#ifndef XILINX_CHIPTESTBOARDD
void setTiming(enum timingMode arg);
enum timingMode getTiming();
#endif
#ifdef MYTHEN3D
void setInitialExtSignals();
int setChipStatusRegister(int csr);
@ -478,7 +501,9 @@ void calcChecksum(udp_header *udp);
int getAdcConfigured();
#endif
#ifndef XILINX_CHIPTESTBOARDD
int configureMAC();
#endif
int setDetectorPosition(int pos[]);
int *getDetectorPosition();
@ -674,11 +699,13 @@ int setTransmissionDelayRight(int value);
#endif
// aquisition
#ifndef XILINX_CHIPTESTBOARDD
int startStateMachine();
#ifdef VIRTUAL
void *start_timer(void *arg);
#endif
int stopStateMachine();
#endif
#ifdef MYTHEN3D
int softwareTrigger();
#endif
@ -688,12 +715,16 @@ int softwareTrigger(int block);
#if defined(EIGERD) || defined(MYTHEN3D) || defined(CHIPTESTBOARDD)
int startReadOut();
#endif
#ifndef XILINX_CHIPTESTBOARDD
enum runStatus getRunStatus();
#endif
#ifdef EIGERD
void waitForAcquisitionEnd(int *ret, char *mess);
#else
#ifndef XILINX_CHIPTESTBOARDD
void waitForAcquisitionEnd();
#endif
#endif
#if defined(CHIPTESTBOARDD)
int validateUDPSocket();
void readandSendUDPFrames();
@ -714,6 +745,7 @@ u_int32_t runState(enum TLogLevel lev);
#endif
// common
#ifndef XILINX_CHIPTESTBOARDD
int calculateDataBytes();
int getTotalNumberOfChannels();
#if defined(CHIPTESTBOARDD)
@ -722,3 +754,4 @@ void getNumberOfChannels(int *nchanx, int *nchany);
int getNumberOfChips();
int getNumberOfDACs();
int getNumberOfChannelsPerChip();
#endif

View File

@ -0,0 +1,75 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#include "arm64.h"
#include "RegisterDefs.h"
#include "clogger.h"
#include "common.h"
#include "sls/ansi.h"
#include "sls/sls_detector_defs.h"
#include <fcntl.h> // open
#include <sys/mman.h> // mmap
/* global variables */
#define CSP0 (0xB0010000)/// 0xB008_0000
#define MEM_SIZE 0x100000
u_int32_t *csp0base = 0;
void bus_w(u_int32_t offset, u_int32_t data) {
volatile u_int32_t *ptr1;
ptr1 = (u_int32_t *)(csp0base + offset / (sizeof(u_int32_t)));
*ptr1 = data;
}
u_int32_t bus_r(u_int32_t offset) {
volatile u_int32_t *ptr1;
ptr1 = (u_int32_t *)(csp0base + offset / (sizeof(u_int32_t)));
return *ptr1;
}
uint64_t getU64BitReg(int aLSB, int aMSB) {
uint64_t retval = bus_r(aMSB);
retval = (retval << 32) | bus_r(aLSB);
return retval;
}
void setU64BitReg(uint64_t value, int aLSB, int aMSB) {
bus_w(aLSB, value & (0xffffffff));
bus_w(aMSB, (value >> 32) & (0xffffffff));
}
int mapCSP0(void) {
// if not mapped
if (csp0base == 0) {
LOG(logINFO, ("Mapping memory\n"));
#ifdef VIRTUAL
csp0base = malloc(MEM_SIZE);
if (csp0base == NULL) {
LOG(logERROR, ("Could not allocate virtual memory.\n"));
return FAIL;
}
LOG(logINFO, ("memory allocated\n"));
#else
int fd;
fd = open("/dev/mem", O_RDWR | O_SYNC, 0);
if (fd == -1) {
LOG(logERROR, ("Can't find /dev/mem\n"));
return FAIL;
}
LOG(logDEBUG1, ("/dev/mem opened\n"));
csp0base = (u_int32_t*)mmap(0, MEM_SIZE, PROT_READ | PROT_WRITE,
MAP_FILE | MAP_SHARED, fd, CSP0);
if (csp0base == MAP_FAILED) {
LOG(logERROR, ("Can't map memmory area\n"));
return FAIL;
}
#endif
LOG(logINFO, ("csp0base mapped from %p to %p\n", csp0base,
(csp0base + MEM_SIZE)));
} else
LOG(logINFO, ("Memory already mapped before\n"));
return OK;
}

View File

@ -114,6 +114,10 @@ int getTimeFromString(char *buf, time_t *result) {
t.tm_mday, t.tm_mon, t.tm_year + 1900, t.tm_hour, t.tm_min, t.tm_sec));
*result = mktime(&t);
if (*result == -1) {
LOG(logERROR, ("Could not convert time structure to time_t\n"));
return FAIL;
}
return OK;
}
@ -130,6 +134,7 @@ int getKernelVersion(char *retvals) {
return OK;
}
int validateKernelVersion(char *expectedVersion) {
// extract kernel date string
char version[255] = {0};
@ -143,15 +148,26 @@ int validateKernelVersion(char *expectedVersion) {
#ifdef VIRTUAL
strcpy(currentVersion, expectedVersion);
#else
#ifndef ARMPROCESSOR
// remove first word (#version number)
const char *ptr = strchr(version, ' ');
const char *ptr = strstr(version, " ");
if (ptr == NULL) {
LOG(logERROR, ("Could not parse kernel version\n"));
return FAIL;
}
strcpy(currentVersion, version + (ptr - version + 1));
strcpy(currentVersion, ptr + 1);
#else
// remove first two words (#version number and SMP)
const char *ptr = strstr(version, "SMP ");
if (ptr == NULL) {
LOG(logERROR, ("Could not parse kernel version\n"));
return FAIL;
}
strcpy(currentVersion, ptr + 4);
#endif
#endif
currentVersion[sizeof(currentVersion) - 1] = '\0';
// convert kernel date string into time
time_t kernelDate;
if (getTimeFromString(currentVersion, &kernelDate) == FAIL) {
@ -159,6 +175,7 @@ int validateKernelVersion(char *expectedVersion) {
("Could not parse retrieved kernel date, %s\n", currentVersion));
return FAIL;
}
LOG(logDEBUG, ("Kernel Date: [%s]\n", ctime(&kernelDate)));
// convert expected date into time
time_t expDate;
@ -167,11 +184,12 @@ int validateKernelVersion(char *expectedVersion) {
("Could not parse expected kernel date, %s\n", expectedVersion));
return FAIL;
}
LOG(logDEBUG, ("Expected Date: [%s]\n", ctime(&expDate)));
// compare if kernel time is older than expected time
if (kernelDate < expDate) {
LOG(logERROR, ("Kernel Version Incompatible (too old)! Expected: [%s], "
"Got [%s]\n",
LOG(logERROR, ("Kernel Version Incompatible (too old)!\nExpected: '%s'"
"\nGot : '%s'\n",
expectedVersion, currentVersion));
return FAIL;
}

View File

@ -33,6 +33,8 @@ const enum detectorType myDetectorType = MOENCH;
const enum detectorType myDetectorType = MYTHEN3;
#elif GOTTHARD2D
const enum detectorType myDetectorType = GOTTHARD2;
#elif XILINX_CHIPTESTBOARDD
const enum detectorType myDetectorType = XILINX_CHIPTESTBOARD;
#else
const enum detectorType myDetectorType = GENERIC;
#endif
@ -717,6 +719,9 @@ int set_timing_mode(int file_des) {
return printSocketReadError();
LOG(logDEBUG1, ("Setting external communication mode to %d\n", arg));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// set
if (((int)arg != GET_FLAG) && (Server_VerifyLock() == OK)) {
switch (arg) {
@ -753,7 +758,7 @@ int set_timing_mode(int file_des) {
validate(&ret, mess, (int)arg, (int)retval, "set timing mode", DEC);
#endif
LOG(logDEBUG1, ("Timing Mode: %d\n", retval));
#endif
return Server_SendResult(file_des, INT32, &retval, sizeof(retval));
}
@ -787,7 +792,7 @@ int get_serial_number(int file_des) {
ret = OK;
memset(mess, 0, sizeof(mess));
int64_t retval = -1;
#ifdef EIGERD
#if defined(EIGERD) || defined(XILINX_CHIPTESTBOARDD)
functionNotImplemented();
#else
retval = getDetectorNumber();
@ -1119,6 +1124,8 @@ enum DACINDEX getDACIndex(enum dacIndex ind) {
case IBIAS_SFP:
serverDacIndex = MO_IBIAS_SFP;
break;
#elif XILINX_CHIPTESTBOARDD
#endif
default:
@ -1137,8 +1144,9 @@ enum DACINDEX getDACIndex(enum dacIndex ind) {
int validateAndSetDac(enum dacIndex ind, int val, int mV) {
int retval = -1;
enum DACINDEX serverDacIndex = 0;
#ifndef XILINX_CHIPTESTBOARDD
enum DACINDEX serverDacIndex = 0;
// valid enums
switch (ind) {
case HIGH_VOLTAGE:
@ -1389,6 +1397,7 @@ int validateAndSetDac(enum dacIndex ind, int val, int mV) {
#endif
break;
}
#endif
return retval;
}
@ -1401,6 +1410,9 @@ int set_dac(int file_des) {
if (receiveData(file_des, args, sizeof(args), INT32) < 0)
return printSocketReadError();
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
enum dacIndex ind = args[0];
int mV = args[1];
int val = args[2];
@ -1411,6 +1423,7 @@ int set_dac(int file_des) {
if ((val == GET_FLAG) || (Server_VerifyLock() == OK)) {
retval = validateAndSetDac(ind, val, mV);
}
#endif
return Server_SendResult(file_des, INT32, &retval, sizeof(retval));
}
@ -1423,6 +1436,9 @@ int get_adc(int file_des) {
if (receiveData(file_des, &ind, sizeof(ind), INT32) < 0)
return printSocketReadError();
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
enum ADCINDEX serverAdcIndex = 0;
// get
@ -1544,6 +1560,7 @@ int get_adc(int file_des) {
LOG(logDEBUG1, ("ADC(%d): %d\n", serverAdcIndex, retval));
#endif
}
#endif
return Server_SendResult(file_des, INT32, &retval, sizeof(retval));
}
@ -1560,6 +1577,9 @@ int write_register(int file_des) {
uint32_t val = args[1];
LOG(logDEBUG1, ("Writing to register 0x%x, data 0x%x\n", addr, val));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// only set
if (Server_VerifyLock() == OK) {
#ifdef GOTTHARDD
@ -1594,6 +1614,7 @@ int write_register(int file_des) {
}
LOG(logDEBUG1, ("Write register (0x%x): 0x%x\n", retval));
}
#endif
return Server_SendResult(file_des, INT32, &retval, sizeof(retval));
}
@ -1608,6 +1629,10 @@ int read_register(int file_des) {
LOG(logDEBUG1, ("Reading from register 0x%x\n", addr));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// get
#ifdef GOTTHARDD
retval = readRegister16And32(addr);
@ -1624,7 +1649,7 @@ int read_register(int file_des) {
retval = readRegister(addr);
#endif
LOG(logINFO, ("Read register (0x%x): 0x%x\n", addr, retval));
#endif
return Server_SendResult(file_des, INT32, &retval, sizeof(retval));
}
@ -1828,7 +1853,7 @@ int set_settings(int file_des) {
if (receiveData(file_des, &isett, sizeof(isett), INT32) < 0)
return printSocketReadError();
#ifdef CHIPTESTBOARDD
#if defined(CHIPTESTBOARDD) || defined(XILINX_CHIPTESTBOARDD)
functionNotImplemented();
#else
LOG(logDEBUG1, ("Setting settings %d\n", isett));
@ -1905,6 +1930,9 @@ int acquire(int blocking, int file_des) {
} else {
LOG(logINFOBLUE, ("Unblocking Acquisition\n"));
}
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// only set
if (Server_VerifyLock() == OK) {
#if defined(JUNGFRAUD)
@ -2003,10 +2031,12 @@ int acquire(int blocking, int file_des) {
}
}
}
#endif
return Server_SendResult(file_des, INT32, NULL, 0);
}
void *start_state_machine(void *arg) {
#ifndef XILINX_CHIPTESTBOARDD
int *blocking = (int *)arg;
int times = 1;
// start of scan
@ -2132,6 +2162,7 @@ void *start_state_machine(void *arg) {
if (scan && sharedMemory_getScanStatus() != ERROR) {
sharedMemory_setScanStatus(IDLE);
}
#endif
return NULL;
}
@ -2149,6 +2180,9 @@ int stop_acquisition(int file_des) {
memset(mess, 0, sizeof(mess));
LOG(logDEBUG1, ("Stopping Acquisition\n"));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// only set
if (Server_VerifyLock() == OK) {
ret = stopStateMachine();
@ -2158,6 +2192,7 @@ int stop_acquisition(int file_des) {
}
LOG(logDEBUG1, ("Stopping Acquisition ret: %d\n", ret));
}
#endif
return Server_SendResult(file_des, INT32, NULL, 0);
}
@ -2167,9 +2202,13 @@ int get_run_status(int file_des) {
enum runStatus retval = ERROR;
LOG(logDEBUG1, ("Getting status\n"));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// only get
retval = getRunStatus();
LOG(logDEBUG1, ("Status: %d\n", retval));
#endif
return Server_SendResult(file_des, INT32, &retval, sizeof(retval));
}
@ -2180,6 +2219,9 @@ int get_num_frames(int file_des) {
memset(mess, 0, sizeof(mess));
int64_t retval = -1;
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// get only
if (!scan) {
retval = getNumFrames();
@ -2189,6 +2231,7 @@ int get_num_frames(int file_des) {
LOG(logDEBUG1, ("retval num frames (num scan steps) %lld\n",
(long long int)retval));
}
#endif
return Server_SendResult(file_des, INT64, &retval, sizeof(retval));
}
@ -2201,6 +2244,9 @@ int set_num_frames(int file_des) {
return printSocketReadError();
LOG(logDEBUG1, ("Setting number of frames %lld\n", (long long int)arg));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// only set
if (Server_VerifyLock() == OK) {
// only set number of frames if normal mode (not scan)
@ -2246,6 +2292,7 @@ int set_num_frames(int file_des) {
}
}
}
#endif
return Server_SendResult(file_des, INT64, NULL, 0);
}
@ -2254,9 +2301,13 @@ int get_num_triggers(int file_des) {
memset(mess, 0, sizeof(mess));
int64_t retval = -1;
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// get only
retval = getNumTriggers();
LOG(logDEBUG1, ("retval num triggers %lld\n", (long long int)retval));
#endif
return Server_SendResult(file_des, INT64, &retval, sizeof(retval));
}
@ -2269,6 +2320,9 @@ int set_num_triggers(int file_des) {
return printSocketReadError();
LOG(logDEBUG1, ("Setting number of triggers %lld\n", (long long int)arg));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// only set
if (Server_VerifyLock() == OK) {
#if JUNGFRAUD
@ -2288,6 +2342,7 @@ int set_num_triggers(int file_des) {
validate64(&ret, mess, arg, retval, "set number of triggers", DEC);
}
}
#endif
return Server_SendResult(file_des, INT64, NULL, 0);
}
@ -2447,6 +2502,9 @@ int get_exptime(int file_des) {
if (receiveData(file_des, &gateIndex, sizeof(gateIndex), INT32) < 0)
return printSocketReadError();
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// get only
#ifdef MYTHEN3D
if (gateIndex < 0 || gateIndex > 2) {
@ -2470,6 +2528,7 @@ int get_exptime(int file_des) {
retval = getExpTime();
LOG(logDEBUG1, ("retval exptime %lld ns\n", (long long int)retval));
}
#endif
#endif
return Server_SendResult(file_des, INT64, &retval, sizeof(retval));
}
@ -2486,6 +2545,9 @@ int set_exptime(int file_des) {
LOG(logDEBUG1, ("Setting exptime %lld ns (gateIndex:%d)\n",
(long long int)val, gateIndex));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// only set
if (Server_VerifyLock() == OK) {
#ifdef MYTHEN3D
@ -2550,6 +2612,7 @@ int set_exptime(int file_des) {
}
#endif
}
#endif
return Server_SendResult(file_des, INT64, NULL, 0);
}
@ -2558,9 +2621,13 @@ int get_period(int file_des) {
memset(mess, 0, sizeof(mess));
int64_t retval = -1;
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// get only
retval = getPeriod();
LOG(logDEBUG1, ("retval period %lld ns\n", (long long int)retval));
#endif
return Server_SendResult(file_des, INT64, &retval, sizeof(retval));
}
@ -2573,6 +2640,9 @@ int set_period(int file_des) {
return printSocketReadError();
LOG(logDEBUG1, ("Setting period %lld ns\n", (long long int)arg));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// only set
if (Server_VerifyLock() == OK) {
ret = setPeriod(arg);
@ -2584,6 +2654,7 @@ int set_period(int file_des) {
LOG(logERROR, (mess));
}
}
#endif
return Server_SendResult(file_des, INT64, NULL, 0);
}
@ -2991,6 +3062,9 @@ int set_dynamic_range(int file_des) {
return printSocketReadError();
LOG(logDEBUG1, ("Setting dr to %d\n", dr));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// set & get
if ((dr == GET_FLAG) || (Server_VerifyLock() == OK)) {
// check dr
@ -3039,6 +3113,7 @@ int set_dynamic_range(int file_des) {
break;
}
}
#endif
return Server_SendResult(file_des, INT32, &retval, sizeof(retval));
}
@ -3153,7 +3228,7 @@ int enable_ten_giga(int file_des) {
LOG(logDEBUG, ("Setting 10GbE: %d\n", arg));
#if defined(JUNGFRAUD) || defined(MOENCHD) || defined(GOTTHARDD) || \
defined(GOTTHARD2D)
defined(GOTTHARD2D) || defined(XILINX_CHIPTESTBOARDD)
functionNotImplemented();
#else
// set & get
@ -4322,7 +4397,7 @@ int reboot_controller(int file_des) {
ret = OK;
memset(mess, 0, sizeof(mess));
#ifdef EIGERD
#if defined(EIGERD) || defined(XILINX_CHIPTESTBOARDD)
functionNotImplemented();
#elif VIRTUAL
ret = GOODBYE;
@ -4951,6 +5026,9 @@ int set_detector_position(int file_des) {
LOG(logDEBUG, ("Setting detector positions: [maxy:%u, modIndex:%u]\n",
args[0], args[1]));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// only set
if (Server_VerifyLock() == OK) {
// if in update mode, there is no need to do this (also detector not set
@ -4961,10 +5039,14 @@ int set_detector_position(int file_des) {
calculate_and_set_position();
}
}
#endif
return Server_SendResult(file_des, INT32, NULL, 0);
}
int check_detector_idle(const char *s) {
#ifdef XILINX_CHIPTESTBOARDD
return FAIL;
#else
enum runStatus status = getRunStatus();
if (status != IDLE && status != RUN_FINISHED && status != STOPPED &&
status != ERROR) {
@ -4976,6 +5058,7 @@ int check_detector_idle(const char *s) {
LOG(logERROR, (mess));
}
return ret;
#endif
}
int is_udp_configured() {
@ -5042,6 +5125,7 @@ int is_udp_configured() {
}
void configure_mac() {
#ifndef XILINX_CHIPTESTBOARDD
if (isControlServer) {
if (is_udp_configured() == OK) {
ret = configureMAC();
@ -5068,6 +5152,7 @@ void configure_mac() {
}
configured = FAIL;
LOG(logWARNING, ("Configure FAIL, not all parameters configured yet\n"));
#endif
}
int set_source_udp_ip(int file_des) {
@ -5080,6 +5165,9 @@ int set_source_udp_ip(int file_des) {
arg = __builtin_bswap32(arg);
LOG(logINFO, ("Setting udp source ip: 0x%x\n", arg));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// only set
if (Server_VerifyLock() == OK) {
if (check_detector_idle("configure mac") == OK) {
@ -5092,6 +5180,7 @@ int set_source_udp_ip(int file_des) {
}
}
}
#endif
return Server_SendResult(file_des, INT32, NULL, 0);
}
@ -5101,11 +5190,14 @@ int get_source_udp_ip(int file_des) {
uint32_t retval = -1;
LOG(logDEBUG1, ("Getting udp source ip\n"));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// get only
retval = udpDetails[0].srcip;
retval = __builtin_bswap32(retval);
LOG(logDEBUG1, ("udp soure ip retval: 0x%x\n", retval));
#endif
return Server_SendResult(file_des, INT32, &retval, sizeof(retval));
}
@ -5165,6 +5257,9 @@ int set_dest_udp_ip(int file_des) {
arg = __builtin_bswap32(arg);
LOG(logINFO, ("Setting udp destination ip: 0x%x\n", arg));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// only set
if (Server_VerifyLock() == OK) {
if (check_detector_idle("configure mac") == OK) {
@ -5174,6 +5269,7 @@ int set_dest_udp_ip(int file_des) {
}
}
}
#endif
return Server_SendResult(file_des, INT32, NULL, 0);
}
@ -5183,11 +5279,14 @@ int get_dest_udp_ip(int file_des) {
uint32_t retval = -1;
LOG(logDEBUG1, ("Getting destination ip\n"));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// get only
retval = udpDetails[0].dstip;
retval = __builtin_bswap32(retval);
LOG(logDEBUG1, ("udp destination ip retval: 0x%x\n", retval));
#endif
return Server_SendResult(file_des, INT32, &retval, sizeof(retval));
}
@ -5243,6 +5342,9 @@ int set_source_udp_mac(int file_des) {
return printSocketReadError();
LOG(logINFO, ("Setting udp source mac: 0x%lx\n", arg));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// only set
if (Server_VerifyLock() == OK) {
if (check_detector_idle("configure mac") == OK) {
@ -5264,6 +5366,7 @@ int set_source_udp_mac(int file_des) {
}
}
}
#endif
return Server_SendResult(file_des, INT64, NULL, 0);
}
@ -5272,11 +5375,13 @@ int get_source_udp_mac(int file_des) {
memset(mess, 0, sizeof(mess));
uint64_t retval = -1;
LOG(logDEBUG1, ("Getting udp source mac\n"));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// get only
retval = udpDetails[0].srcmac;
LOG(logDEBUG1, ("udp soure mac retval: 0x%lx\n", retval));
#endif
return Server_SendResult(file_des, INT64, &retval, sizeof(retval));
}
@ -5333,6 +5438,9 @@ int set_dest_udp_mac(int file_des) {
return printSocketReadError();
LOG(logINFO, ("Setting udp destination mac: 0x%lx\n", arg));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// only set
if (Server_VerifyLock() == OK) {
if (check_detector_idle("configure mac") == OK) {
@ -5342,6 +5450,7 @@ int set_dest_udp_mac(int file_des) {
}
}
}
#endif
return Server_SendResult(file_des, INT64, NULL, 0);
}
@ -5350,11 +5459,13 @@ int get_dest_udp_mac(int file_des) {
memset(mess, 0, sizeof(mess));
uint64_t retval = -1;
LOG(logDEBUG1, ("Getting udp destination mac\n"));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// get only
retval = udpDetails[0].dstmac;
LOG(logDEBUG1, ("udp destination mac retval: 0x%lx\n", retval));
#endif
return Server_SendResult(file_des, INT64, &retval, sizeof(retval));
}
@ -5408,6 +5519,9 @@ int set_dest_udp_port(int file_des) {
return printSocketReadError();
LOG(logINFO, ("Setting udp destination port: %hu\n", arg));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// only set
if (Server_VerifyLock() == OK) {
if (check_detector_idle("configure mac") == OK) {
@ -5417,6 +5531,7 @@ int set_dest_udp_port(int file_des) {
}
}
}
#endif
return Server_SendResult(file_des, INT16, NULL, 0);
}
@ -5425,11 +5540,13 @@ int get_dest_udp_port(int file_des) {
memset(mess, 0, sizeof(mess));
uint16_t retval = -1;
LOG(logDEBUG1, ("Getting destination port"));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// get only
retval = udpDetails[0].dstport;
LOG(logDEBUG, ("udp destination port retval: %hu\n", retval));
#endif
return Server_SendResult(file_des, INT16, &retval, sizeof(retval));
}
@ -5485,7 +5602,8 @@ int set_num_interfaces(int file_des) {
return printSocketReadError();
LOG(logINFO, ("Setting number of interfaces: %d\n", arg));
#if !defined(JUNGFRAUD) && !defined(MOENCHD) && !defined(GOTTHARD2D)
#if !defined(JUNGFRAUD) && !defined(MOENCHD) && !defined(GOTTHARD2D) && \
!defined(XLINX_CHIPTESTBOARDD)
// fixed number of udp interfaces
int num_interfaces = getNumberofUDPInterfaces();
if (arg != num_interfaces) {
@ -5557,7 +5675,6 @@ int get_num_interfaces(int file_des) {
// get only
retval = getNumberofUDPInterfaces();
LOG(logDEBUG1, ("Number of udp interfaces retval: %u\n", retval));
return Server_SendResult(file_des, INT32, &retval, sizeof(retval));
}
@ -7020,6 +7137,10 @@ int get_receiver_parameters(int file_des) {
memset(mess, 0, sizeof(mess));
LOG(logDEBUG1, ("Getting receiver parameters\n"));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
Server_SendResult(file_des, INT32, NULL, 0);
#else
// get only
Server_SendResult(file_des, INT32, NULL, 0);
@ -7477,7 +7598,7 @@ int get_receiver_parameters(int file_des) {
return printSocketReadError();
LOG(logINFO, ("Sent %d bytes for receiver parameters\n", n));
#endif
return OK;
}
@ -7819,6 +7940,9 @@ int set_scan(int file_des) {
if (receiveData(file_des, &dacTime, sizeof(dacTime), INT64) < 0)
return printSocketReadError();
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// only set
if (Server_VerifyLock() == OK) {
int enable = args[0];
@ -7908,6 +8032,7 @@ int set_scan(int file_des) {
}
}
}
#endif
return Server_SendResult(file_des, INT64, &retval, sizeof(retval));
}
@ -8265,6 +8390,9 @@ int reconfigure_udp(int file_des) {
ret = OK;
memset(mess, 0, sizeof(mess));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
if (Server_VerifyLock() == OK) {
LOG(logINFO, ("Reconfiguring UDP\n"));
if (check_detector_idle("configure mac") == OK) {
@ -8277,6 +8405,7 @@ int reconfigure_udp(int file_des) {
}
}
}
#endif
return Server_SendResult(file_des, INT32, NULL, 0);
}
@ -8377,7 +8506,7 @@ int reset_to_default_dacs(int file_des) {
return printSocketReadError();
LOG(logDEBUG1, ("Resetting dacs to defaults (hard reset: %d)\n", arg));
#ifdef CHIPTESTBOARDD
#if defined(CHIPTESTBOARDD) || defined(XILINX_CHIPTESTBOARDD)
functionNotImplemented();
#else
if (Server_VerifyLock() == OK) {
@ -8792,7 +8921,7 @@ int get_default_dac(int file_des) {
LOG(logDEBUG1,
("Getting default dac [dacindex:%d, settings: %d]\n", dacindex, sett));
#ifdef CHIPTESTBOARDD
#if defined(CHIPTESTBOARDD) || defined(XILINX_CHIPTESTBOARDD)
functionNotImplemented();
#else
// get only
@ -8832,7 +8961,7 @@ int set_default_dac(int file_des) {
LOG(logDEBUG1, ("Setting default dac [dacindex: %d, settings: %d] to %d\n",
(int)dacindex, (int)sett, value));
#ifdef CHIPTESTBOARDD
#if defined(CHIPTESTBOARDD) || defined(XILINX_CHIPTESTBOARDD)
functionNotImplemented();
#else
// only set
@ -9452,6 +9581,11 @@ int clear_all_udp_dst(int file_des) {
memset(mess, 0, sizeof(mess));
LOG(logINFO, ("Clearing all udp destinations\n"));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
if (Server_VerifyLock() == OK) {
if (check_detector_idle("clear all udp destinations") == OK) {
memset(udpDetails, 0, sizeof(udpDetails));
@ -9479,6 +9613,7 @@ int clear_all_udp_dst(int file_des) {
}
}
}
#endif
return Server_SendResult(file_des, INT32, NULL, 0);
}
@ -9618,7 +9753,9 @@ int get_kernel_version(int file_des) {
memset(retvals, 0, MAX_STR_LENGTH);
LOG(logDEBUG1, ("Getting kernel version\n"));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// get only
ret = getKernelVersion(retvals);
if (ret == FAIL) {
@ -9631,13 +9768,14 @@ int get_kernel_version(int file_des) {
} else {
LOG(logDEBUG1, ("kernel version: [%s]\n", retvals));
}
#endif
return Server_SendResult(file_des, OTHER, retvals, sizeof(retvals));
}
int update_kernel(int file_des) {
ret = OK;
memset(mess, 0, sizeof(mess));
#ifdef EIGERD
#if defined(EIGERD) || defined(XILINX_CHIPTESTBOARDD)
functionNotImplemented();
return Server_SendResult(file_des, INT32, NULL, 0);
#else
@ -9689,7 +9827,8 @@ int receive_program(int file_des, enum PROGRAM_INDEX index) {
LOG(logINFO, ("\tServer Name: %s\n", serverName));
}
#if !defined(GOTTHARD2D) && !defined(MYTHEN3D) && !defined(EIGERD)
#if !defined(GOTTHARD2D) && !defined(MYTHEN3D) && !defined(EIGERD) && \
!defined(XILINX_CHIPTESTBOARDD)
int forceDeleteNormalFile = 0;
if (receiveData(file_des, &forceDeleteNormalFile,
sizeof(forceDeleteNormalFile), INT32) < 0)
@ -9725,7 +9864,8 @@ int receive_program(int file_des, enum PROGRAM_INDEX index) {
}
if (ret == OK) {
#if defined(GOTTHARD2D) || defined(MYTHEN3D) || defined(EIGERD)
#if defined(GOTTHARD2D) || defined(MYTHEN3D) || defined(EIGERD) || \
defined(XILINX_CHIPTESTBOARDD)
receive_program_default(file_des, index, functionType, filesize,
checksum, serverName);
#else
@ -9871,7 +10011,8 @@ void receive_program_via_blackfin(int file_des, enum PROGRAM_INDEX index,
void receive_program_default(int file_des, enum PROGRAM_INDEX index,
char *functionType, uint64_t filesize,
char *checksum, char *serverName) {
#if !defined(GOTTHARD2D) && !defined(MYTHEN3D) && !defined(EIGERD)
#if !defined(GOTTHARD2D) && !defined(MYTHEN3D) && !defined(EIGERD) && \
!defined(XILINX_CHIPTESTBOARDD)
ret = FAIL;
sprintf(mess,
"Could not %s. program via blackfin not implmented for this "
@ -10389,8 +10530,12 @@ int get_hardware_version(int file_des) {
memset(mess, 0, sizeof(mess));
char retvals[MAX_STR_LENGTH];
memset(retvals, 0, MAX_STR_LENGTH);
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
getHardwareVersion(retvals);
LOG(logDEBUG1, ("hardware version retval: %s\n", retvals));
#endif
return Server_SendResult(file_des, OTHER, retvals, sizeof(retvals));
}
@ -10443,6 +10588,10 @@ int set_bit(int file_des) {
int nBit = (int)args[1];
LOG(logDEBUG1, ("Setting bit %d of reg 0x%x\n", nBit, addr));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// only set
if (Server_VerifyLock() == OK) {
if (nBit < 0 || nBit > 31) {
@ -10473,6 +10622,7 @@ int set_bit(int file_des) {
}
}
}
#endif
return Server_SendResult(file_des, INT32, NULL, 0);
}
@ -10487,6 +10637,9 @@ int clear_bit(int file_des) {
int nBit = (int)args[1];
LOG(logDEBUG1, ("Clearing bit %d of reg 0x%x\n", nBit, addr));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
// only set
if (Server_VerifyLock() == OK) {
if (nBit < 0 || nBit > 31) {
@ -10517,6 +10670,7 @@ int clear_bit(int file_des) {
}
}
}
#endif
return Server_SendResult(file_des, INT32, NULL, 0);
}
@ -10532,6 +10686,9 @@ int get_bit(int file_des) {
int nBit = (int)args[1];
LOG(logDEBUG1, ("Getting bit %d of reg 0x%x\n", nBit, addr));
#ifdef XILINX_CHIPTESTBOARDD
functionNotImplemented();
#else
if (nBit < 0 || nBit > 31) {
ret = FAIL;
sprintf(mess,
@ -10556,6 +10713,7 @@ int get_bit(int file_des) {
LOG(logDEBUG1, ("regval: 0x%x bit value:0%d\n", regval, retval));
#endif
}
#endif
return Server_SendResult(file_des, INT32, &retval, sizeof(retval));
}

View File

@ -0,0 +1,38 @@
# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
add_executable(xilinx_ctbDetectorServer_virtual
slsDetectorFunctionList.c
../slsDetectorServer/src/slsDetectorServer.c
../slsDetectorServer/src/slsDetectorServer_funcs.c
../slsDetectorServer/src/communication_funcs.c
../slsDetectorServer/src/arm64.c
../slsDetectorServer/src/common.c
../slsDetectorServer/src/sharedMemory.c
../../slsSupportLib/src/md5.c
)
include_directories(
../slsDetectorServer/include
../../slsSupportLib/include
../../slsDetectorSoftware/include/sls/
)
target_include_directories(xilinx_ctbDetectorServer_virtual
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
)
target_compile_definitions(xilinx_ctbDetectorServer_virtual
PUBLIC XILINX_CHIPTESTBOARDD ARMPROCESSOR VIRTUAL STOP_SERVER
)
target_link_libraries(xilinx_ctbDetectorServer_virtual
PUBLIC pthread rt slsProjectCSettings
)
set_target_properties(xilinx_ctbDetectorServer_virtual PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
install(TARGETS xilinx_ctbDetectorServer_virtual
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

View File

@ -0,0 +1,47 @@
# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
current_dir = $(shell pwd)
main_inc = ../slsDetectorServer/include/
main_src = ../slsDetectorServer/src/
support_lib = ../../slsSupportLib/include/
det_lib = ../../slsDetectorSoftware/include/sls/
md5_dir = ../../slsSupportLib/src/
CROSS = aarch64-none-linux-gnu-
CC = $(CROSS)gcc
#TODO: allow these warnings and fix code
CFLAGS += -Wall -std=gnu99 -Wno-format-overflow -Wno-format-truncation -DXILINX_CHIPTESTBOARDD -DARMPROCESSOR -DSTOP_SERVER -I$(main_inc) -I$(support_lib) -I$(det_lib) -I$(current_dir) #-DDEBUG1 #-DVERBOSEI #-DVERBOSE
#CFLAGS += -Wall -std=gnu99 -DXILINX_CHIPTESTBOARDD -DARMPROCESSOR -DSTOP_SERVER -I$(main_inc) -I$(support_lib) -I$(det_lib) -I$(current_dir) #-DDEBUG1 #-DVERBOSEI #-DVERBOSE
LDLIBS += -lm -lrt -pthread
PROGS = xilinx_ctbDetectorServer
DESTDIR ?= bin
INSTMODE = 0777
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
OBJS = $(SRCS:.c=.o)
all: clean $(PROGS)
version: clean versioning $(PROGS)
boot: $(OBJS)
version_branch=$(API_BRANCH)
version_name=APIXILINXCTB
version_path=slsDetectorServers/xilinx_ctbDetectorServer
versioning:
cd ../../ && echo $(PWD) && echo `tput setaf 6; ./updateAPIVersion.sh $(version_name) $(version_path) $(version_branch); tput sgr0;`
$(PROGS): $(OBJS)
# echo $(OBJS)
mkdir -p $(DESTDIR)
$(CC) -o $@ $^ $(CFLAGS) $(LDLIBS)
mv $(PROGS) $(DESTDIR)
rm $(main_src)*.o $(md5_dir)*.o
clean:
rm -rf $(DESTDIR)/$(PROGS) *.o *.gdb $(main_src)*.o $(md5_dir)*.o

View File

@ -0,0 +1,416 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#pragma once
#define CTRLREG1 (0x0)
#define CTR1_OFST (0)
#define CTR1_MSK (0xffffffff << CTR1_OFST)
#define CTRLREG2 (0x4)
#define CTRL2_OFST (0)
#define CTRL2_MSK (0xffffffff << CTRL2_OFST)
#define STATUSREG1 (0x8)
#define STATUS1_OFST (0)
#define STATUS1_MSK (0xffffffff << STATUS1_OFST)
#define STATUSREG2 (0xC)
#define STATUS2_OFST (0)
#define STATUS2_MSK (0xffffffff << STATUS2_OFST)
#define FPGAVERSIONREG (0x10)
#define COMPDATE_OFST (0)
#define COMPDATE_MSK (0x00ffffff << COMPDATE_OFST)
#define DETTYPE_OFST (24)
#define DETTYPE_MSK (0x000000ff << DETTYPE_OFST)
#define PKTPACKETLENGTHREG (0x28)
#define PACKETLENGTH1G_OFST (0)
#define PACKETLENGTH1G_MSK (0x0000ffff << PACKETLENGTH1G_OFST)
#define PACKETLENGTH10G_OFST (16)
#define PACKETLENGTH10G_MSK (0x0000ffff << PACKETLENGTH10G_OFST)
#define PKTNOPACKETSREG (0x30)
#define NOPACKETS1G_OFST (0)
#define NOPACKETS1G_MSK (0x0000003f << NOPACKETS1G_OFST)
#define NOPACKETS10G_OFST (8)
#define NOPACKETS10G_MSK (0x0000003f << NOPACKETS10G_OFST)
#define PKTCTRLREG (0x38)
#define NSERVERS_OFST (0)
#define NSERVERS_MSK (0x0000003f << NSERVERS_OFST)
#define SERVERSTART_OFST (6)
#define SERVERSTART_MSK (0x0000001f << SERVERSTART_OFST)
#define ETHINTERF_OFST (11)
#define ETHINTERF_MSK (0x00000001 << ETHINTERF_OFST)
#define PKTCOORDREG1 (0x40)
#define COORDX_OFST (0)
#define COORDX_MSK (0x0000ffff << COORDX_OFST)
#define COORDY_OFST (16)
#define COORDY_MSK (0x0000ffff << COORDY_OFST)
#define PKTCOORDREG2 (0x48)
#define COORDZ_OFST (0)
#define COORDZ_MSK (0x0000ffff << COORDZ_OFST)
#define FLOWSTATUSREG (0x100)
#define RSMBUSY_OFST (0)
#define RSMBUSY_MSK (0x00000001 << RSMBUSY_OFST)
#define RSMTRGWAIT_OFST (3)
#define RSMTRGWAIT_MSK (0x00000001 << RSMTRGWAIT_OFST)
#define CSMBUSY_OFST (17)
#define CSMBUSY_MSK (0x00000001 << CSMBUSY_OFST)
#define FLOWCONTROLREG (0x108)
#define STARTF_OFST (0)
#define STARTF_MSK (0x00000001 << STARTF_OFST)
#define STOPF_OFST (1)
#define STOPF_MSK (0x00000001 << STOPF_OFST)
#define RSTF_OFST (2)
#define RSTF_MSK (0x00000001 << RSTF_OFST)
#define SWTRIGGERF_OFST (3)
#define SWTRIGGERF_MSK (0x00000001 << SWTRIGGERF_OFST)
#define TRIGGERENABLE_OFST (4)
#define TRIGGERENABLE_MSK (0x00000001 << TRIGGERENABLE_OFST)
#define TIMEFROMSTARTOUTREG1 (0x110)
#define TIMEFROMSTARTOUT1_OFST (0)
#define TIMEFROMSTARTOUT1_MSK (0xffffffff << TIMEFROMSTARTOUT1_OFST)
#define TIMEFROMSTARTOUTREG2 (0x114)
#define TIMEFROMSTARTOUT2_OFST (0)
#define TIMEFROMSTARTOUT2_MSK (0xffffffff << TIMEFROMSTARTOUT2_OFST)
#define FRAMESFROMSTARTOUTREG1 (0x118)
#define FRAMESFROMSTARTOUT1_OFST (0)
#define FRAMESFROMSTARTOUT1_MSK (0xffffffff << FRAMESFROMSTARTOUT1_OFST)
#define FRAMESFROMSTARTOUTREG2 (0x11C)
#define FRAMESFROMSTARTOUT2_OFST (0)
#define FRAMESFROMSTARTOUT2_MSK (0xffffffff << FRAMESFROMSTARTOUT2_OFST)
#define FRAMETIMEOUTREG1 (0x120)
#define FRAMETIMEOUT1_OFST (0)
#define FRAMETIMEOUT1_MSK (0xffffffff << FRAMETIMEOUT1_OFST)
#define FRAMETIMEOUTREG2 (0x124)
#define FRAMETIMEOUT2_OFST (0)
#define FRAMETIMEOUT2_MSK (0xffffffff << FRAMETIMEOUT2_OFST)
#define DELAYOUTREG1 (0x128)
#define DELAYOUT1_OFST (0)
#define DELAYOUT1_MSK (0xffffffff << DELAYOUT1_OFST)
#define DELAYOUTREG2 (0x12C)
#define DELAYOUT2_OFST (0)
#define DELAYOUT2_MSK (0xffffffff << DELAYOUT2_OFST)
#define CYCLESOUTREG1 (0x130)
#define CYCLESOUT1_OFST (0)
#define CYCLESOUT1_MSK (0xffffffff << CYCLESOUT1_OFST)
#define CYCLESOUTREG2 (0x134)
#define CYCLESOUT2_OFST (0)
#define CYCLESOUT2_MSK (0xffffffff << CYCLESOUT2_OFST)
#define FRAMESOUTREG1 (0x138)
#define FRAMESOUT1_OFST (0)
#define FRAMESOUT1_MSK (0xffffffff << FRAMESOUT1_OFST)
#define FRAMESOUTREG2 (0x13C)
#define FRAMESOUT2_OFST (0)
#define FRAMESOUT2_MSK (0xffffffff << FRAMESOUT2_OFST)
#define PERIODOUTREG1 (0x140)
#define PERIODOUT1_OFST (0)
#define PERIODOUT1_MSK (0xffffffff << PERIODOUT1_OFST)
#define PERIODOUTREG2 (0x144)
#define PERIODOUT2_OFST (0)
#define PERIODOUT2_MSK (0xffffffff << PERIODOUT2_OFST)
#define DELAYINREG1 (0x148)
#define DELAYIN1_OFST (0)
#define DELAYIN1_MSK (0xffffffff << DELAYIN1_OFST)
#define DELAYINREG2 (0x14C)
#define DELAYIN2_OFST (0)
#define DELAYIN2_MSK (0xffffffff << DELAYIN2_OFST)
#define CYCLESINREG1 (0x150)
#define CYCLESIN1_OFST (0)
#define CYCLESIN1_MSK (0xffffffff << CYCLESIN1_OFST)
#define CYCLESINREG2 (0x154)
#define CYCLESIN2_OFST (0)
#define CYCLESIN2_MSK (0xffffffff << CYCLESIN2_OFST)
#define FRAMESINREG1 (0x158)
#define FRAMESIN1_OFST (0)
#define FRAMESIN1_MSK (0xffffffff << FRAMESIN1_OFST)
#define FRAMESINREG2 (0x15C)
#define FRAMESIN2_OFST (0)
#define FRAMESIN2_MSK (0xffffffff << FRAMESIN2_OFST)
#define PERIODINREG1 (0x160)
#define PERIODIN1_OFST (0)
#define PERIODIN1_MSK (0xffffffff << PERIODIN1_OFST)
#define PERIODINREG2 (0x164)
#define PERIODIN2_OFST (0)
#define PERIODIN2_MSK (0xffffffff << PERIODIN2_OFST)
#define PATTERNOUTREG0 (0x200)
#define PATTERNOUT0_OFST (0)
#define PATTERNOUT0_MSK (0xffffffff << PATTERNOUT0_OFST)
#define PATTERNOUTREG1 (0x204)
#define PATTERNOUT1_OFST (0)
#define PATTERNOUT1_MSK (0xffffffff << PATTERNOUT1_OFST)
#define PATTERNINREG0 (0x208)
#define PATTERNIN0_OFST (0)
#define PATTERNIN0_MSK (0xffffffff << PATTERNIN0_OFST)
#define PATTERNINREG1 (0x20C)
#define PATTERNIN1_OFST (0)
#define PATTERNIN1_MSK (0xffffffff << PATTERNIN1_OFST)
#define PATTERNIOMASKREG0 (0x210)
#define PATTERNIOMASK0_OFST (0)
#define PATTERNIOMASK0_MSK (0xffffffff << PATTERNIOMASK0_OFST)
#define PATTERNIOMASKREG1 (0x214)
#define PATTERNIOMASK1_OFST (0)
#define PATTERNIOMASK1_MSK (0xffffffff << PATTERNIOMASK1_OFST)
#define PATTERNIOSETREG0 (0x218)
#define PATTERNIOSET0_OFST (0)
#define PATTERNIOSET0_MSK (0xffffffff << PATTERNIOSET0_OFST)
#define PATTERNIOSETREG1 (0x21C)
#define PATTERNIOSET1_OFST (0)
#define PATTERNIOSET1_MSK (0xffffffff << PATTERNIOSET1_OFST)
#define PATTERNCONTROLREG (0x220)
#define PATTERNWRBIT_OFST (0)
#define PATTERNWRBIT_MSK (0x00000001 << PATTERNWRBIT_OFST)
#define PATTERNRDBIT_OFST (1)
#define PATTERNRDBIT_MSK (0x00000001 << PATTERNRDBIT_OFST)
#define PATTERNADDRESSPTR_OFST (16)
#define PATTERNADDRESSPTR_MSK (0x00001fff << PATTERNADDRESSPTR_OFST)
#define PATTERNLIMITADDRESSREG (0x228)
#define PATTERNLIMITADDRESS_OFST (0)
#define PATTERNLIMITADDRESS_MSK (0xffffffff << PATTERNLIMITADDRESS_OFST)
#define PATTERNLOOP1ADDRESSREG (0x230)
#define PATTERNLOOP1ADDRESS_OFST (0)
#define PATTERNLOOP1ADDRESS_MSK (0xffffffff << PATTERNLOOP1ADDRESS_OFST)
#define PATTERNNLOOPS1REG (0x238)
#define PATTERNNLOOPS1_OFST (0)
#define PATTERNNLOOPS1_MSK (0xffffffff << PATTERNNLOOPS1_OFST)
#define PATTERNWAIT1ADDRESSREG (0x240)
#define PATTERNWAIT1ADDRESS_OFST (0)
#define PATTERNWAIT1ADDRESS_MSK (0xffffffff << PATTERNWAIT1ADDRESS_OFST)
#define PATTERNWAIT1TIMEREG1 (0x248)
#define PATTERNWAIT1TIME1_OFST (0)
#define PATTERNWAIT1TIME1_MSK (0xffffffff << PATTERNWAIT1TIME1_OFST)
#define PATTERNWAIT1TIMEREG2 (0x24C)
#define PATTERNWAIT1TIME2_OFST (0)
#define PATTERNWAIT1TIME2_MSK (0xffffffff << PATTERNWAIT1TIME2_OFST)
#define PATTERNLOOP2ADDRESSREG (0x250)
#define PATTERNLOOP2ADDRESS_OFST (0)
#define PATTERNLOOP2ADDRESS_MSK (0xffffffff << PATTERNLOOP2ADDRESS_OFST)
#define PATTERNNLOOPS2REG (0x258)
#define PATTERNNLOOPS2_OFST (0)
#define PATTERNNLOOPS2_MSK (0xffffffff << PATTERNNLOOPS2_OFST)
#define PATTERNWAIT2ADDRESSREG (0x260)
#define PATTERNWAIT2ADDRESS_OFST (0)
#define PATTERNWAIT2ADDRESS_MSK (0xffffffff << PATTERNWAIT2ADDRESS_OFST)
#define PATTERNWAIT2TIMEREG1 (0x268)
#define PATTERNWAIT2TIME1_OFST (0)
#define PATTERNWAIT2TIME1_MSK (0xffffffff << PATTERNWAIT2TIME1_OFST)
#define PATTERNWAIT2TIMEREG2 (0x26C)
#define PATTERNWAIT2TIME2_OFST (0)
#define PATTERNWAIT2TIME2_MSK (0xffffffff << PATTERNWAIT2TIME2_OFST)
#define PATTERNLOOP3ADDRESSREG (0x270)
#define PATTERNLOOP3ADDRESS_OFST (0)
#define PATTERNLOOP3ADDRESS_MSK (0xffffffff << PATTERNLOOP3ADDRESS_OFST)
#define PATTERNNLOOPS3REG (0x278)
#define PATTERNNLOOPS3_OFST (0)
#define PATTERNNLOOPS3_MSK (0xffffffff << PATTERNNLOOPS3_OFST)
#define PATTERNWAIT3ADDRESSREG (0x280)
#define PATTERNWAIT3ADDRESS_OFST (0)
#define PATTERNWAIT3ADDRESS_MSK (0xffffffff << PATTERNWAIT3ADDRESS_OFST)
#define PATTERNWAIT3TIMEREG1 (0x288)
#define PATTERNWAIT3TIME1_OFST (0)
#define PATTERNWAIT3TIME1_MSK (0xffffffff << PATTERNWAIT3TIME1_OFST)
#define PATTERNWAIT3TIMEREG2 (0x28C)
#define PATTERNWAIT3TIME2_OFST (0)
#define PATTERNWAIT3TIME2_MSK (0xffffffff << PATTERNWAIT3TIME2_OFST)
#define PATTERNLOOP4ADDRESSREG (0x290)
#define PATTERNLOOP4ADDRESS_OFST (0)
#define PATTERNLOOP4ADDRESS_MSK (0xffffffff << PATTERNLOOP4ADDRESS_OFST)
#define PATTERNNLOOPS4REG (0x298)
#define PATTERNNLOOPS4_OFST (0)
#define PATTERNNLOOPS4_MSK (0xffffffff << PATTERNNLOOPS4_OFST)
#define PATTERNWAIT4ADDRESSREG (0x300)
#define PATTERNWAIT4ADDRESS_OFST (0)
#define PATTERNWAIT4ADDRESS_MSK (0xffffffff << PATTERNWAIT4ADDRESS_OFST)
#define PATTERNWAIT4TIMEREG1 (0x308)
#define PATTERNWAI4TIME1_OFST (0)
#define PATTERNWAI4TIME1_MSK (0xffffffff << PATTERNWAI4TIME1_OFST)
#define PATTERNWAIT4TIMEREG2 (0x30C)
#define PATTERNWAIT4TIME2_OFST (0)
#define PATTERNWAIT4TIME2_MSK (0xffffffff << PATTERNWAIT4TIME2_OFST)
#define PATTERNLOOP5ADDRESSREG (0x310)
#define PATTERNLOOP5ADDRESS_OFST (0)
#define PATTERNLOOP5ADDRESS_MSK (0xffffffff << PATTERNLOOP5ADDRESS_OFST)
#define PATTERNNLOOPS5REG (0x318)
#define PATTERNNLOOPS5_OFST (0)
#define PATTERNNLOOPS5_MSK (0xffffffff << PATTERNNLOOPS5_OFST)
#define PATTERNWAIT5ADDRESSREG (0x320)
#define PATTERNWAIT5ADDRESS_OFST (0)
#define PATTERNWAIT5ADDRESS_MSK (0xffffffff << PATTERNWAIT5ADDRESS_OFST)
#define PATTERNWAIT5TIMEREG1 (0x328)
#define PATTERNWAIT5TIME1_OFST (0)
#define PATTERNWAIT5TIME1_MSK (0xffffffff << PATTERNWAIT5TIME1_OFST)
#define PATTERNWAIT5TIMEREG2 (0x32C)
#define PATTERNWAIT5TIME2_OFST (0)
#define PATTERNWAIT5TIME2_MSK (0xffffffff << PATTERNWAIT5TIME2_OFST)
#define PATTERNLOOP6ADDRESSREG (0x330)
#define PATTERNLOOP6ADDRESS_OFST (0)
#define PATTERNLOOP6ADDRESS_MSK (0xffffffff << PATTERNLOOP6ADDRESS_OFST)
#define PATTERNNLOOPS6REG (0x338)
#define PATTERNNLOOPS6_OFST (0)
#define PATTERNNLOOPS6_MSK (0xffffffff << PATTERNNLOOPS6_OFST)
#define PATTERNWAIT6ADDRESSREG (0x340)
#define PATTERNWAIT6ADDRESS_OFST (0)
#define PATTERNWAIT6ADDRESS_MSK (0xffffffff << PATTERNWAIT6ADDRESS_OFST)
#define PATTERNWAIT6TIMEREG1 (0x348)
#define PATTERNWAIT6TIME1_OFST (0)
#define PATTERNWAIT6TIME1_MSK (0xffffffff << PATTERNWAIT6TIME1_OFST)
#define PATTERNWAIT6TIMEREG2 (0x34C)
#define PATTERNWAIT6TIME2_OFST (0)
#define PATTERNWAIT6TIME2_MSK (0xffffffff << PATTERNWAIT6TIME2_OFST)
#define EXPCTRLREG (0x400)
#define STARTP_OFST (0)
#define STARTP_MSK (0x00000001 << STARTP_OFST)
#define EXPFRAMESREG (0x408)
#define NOFRAMES_OFST (0)
#define NOFRAMES_MSK (0xffffffff << NOFRAMES_OFST)
#define EXPTIMEREG (0x410)
#define EXPTIME_OFST (0)
#define EXPTIME_MSK (0xffffffff << EXPTIME_OFST)

View File

@ -0,0 +1,211 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#include "slsDetectorFunctionList.h"
#include "arm64.h"
#include "clogger.h"
#include "common.h"
#include "sharedMemory.h"
#include "sls/versionAPI.h"
#include <string.h>
#include <unistd.h> // usleep
#include <arpa/inet.h> // INET_ADDRSTRLEN
// Global variable from slsDetectorServer_funcs
extern int debugflag;
extern int updateFlag;
extern const enum detectorType myDetectorType;
// Global variable from communication_funcs.c
extern int isControlServer;
int initError = OK;
int initCheckDone = 0;
char initErrorMessage[MAX_STR_LENGTH];
int detPos[2] = {0, 0};
int isInitCheckDone() { return initCheckDone; }
int getInitResult(char **mess) {
*mess = initErrorMessage;
return initError;
}
void basictests() {
initError = OK;
initCheckDone = 0;
memset(initErrorMessage, 0, MAX_STR_LENGTH);
#ifdef VIRTUAL
LOG(logINFOBLUE, ("****** Xilinx Chip Test Board Virtual Server ******\n"));
#else
LOG(logINFOBLUE, ("********** Xilinx Chip Test Board Server **********\n"));
#endif
if (mapCSP0() == FAIL) {
strcpy(initErrorMessage,
"Could not map to memory. Cannot proceed. Check Firmware.\n");
LOG(logERROR, (initErrorMessage));
initError = FAIL;
return;
}
#ifndef VIRTUAL
/*if ((!debugflag) && (!updateFlag) &&
((validateKernelVersion(KERNEL_DATE_VRSN) == FAIL) ||
(checkType() == FAIL) || (testFpga() == FAIL) ||
(testBus() == FAIL))) {*/
if ((!debugflag) && (!updateFlag) &&
((validateKernelVersion(KERNEL_DATE_VRSN) == FAIL) ||
(checkType() == FAIL) /*|| (testFpga() == FAIL) ||
(testBus() == FAIL)*/)) {
sprintf(initErrorMessage,
"Could not pass basic tests of FPGA and bus. Cannot proceed. "
"Check Firmware. (Firmware version:0x%lx) \n",
getFirmwareVersion());
LOG(logERROR, ("%s\n\n", initErrorMessage));
initError = FAIL;
return;
}
#endif
uint32_t ipadd = getDetectorIP();
uint64_t macadd = getDetectorMAC();
int64_t fwversion = getFirmwareVersion();
char swversion[MAX_STR_LENGTH] = {0};
memset(swversion, 0, MAX_STR_LENGTH);
getServerVersion(swversion);
uint32_t requiredFirmwareVersion = REQRD_FRMWRE_VRSN;
LOG(logINFOBLUE,
("**************************************************\n"
"Detector IP Addr:\t\t 0x%x\n"
"Detector MAC Addr:\t\t 0x%lx\n\n"
"Firmware Version:\t\t 0x%lx\n"
"Software Version:\t\t %s\n"
"Required Firmware Version:\t 0x%x\n"
"********************************************************\n",
ipadd, macadd, fwversion, swversion, requiredFirmwareVersion));
}
int checkType() {
#ifdef VIRTUAL
return OK;
#endif
u_int32_t type =
((bus_r(FPGAVERSIONREG) & DETTYPE_MSK) >> DETTYPE_OFST);
if (type != XILINX_CHIPTESTBOARD) {
LOG(logERROR,
("This is not a Xilinx CTB firmware (read %d, expected %d)\n", type,
XILINX_CHIPTESTBOARD));
return FAIL;
}
return OK;
}
/* Ids */
void getServerVersion(char *version) { strcpy(version, APIXILINXCTB); }
uint64_t getFirmwareVersion() {
#ifdef VIRTUAL
return REQRD_FRMWRE_VRSN;
#endif
return ((bus_r(FPGAVERSIONREG) & COMPDATE_MSK) >> COMPDATE_OFST);
}
u_int64_t getDetectorMAC() {
#ifdef VIRTUAL
return 0;
#else
char output[255], mac[255] = "";
u_int64_t res = 0;
FILE *sysFile =
popen("ifconfig eth0 | grep ether | awk '{ print $2 }'", "r");
fgets(output, sizeof(output), sysFile);
pclose(sysFile);
// getting rid of ":"
char *pch;
pch = strtok(output, ":");
while (pch != NULL) {
strcat(mac, pch);
pch = strtok(NULL, ":");
}
sscanf(mac, "%lx", &res);
return res;
#endif
}
u_int32_t getDetectorIP() {
#ifdef VIRTUAL
return 0;
#endif
char temp[INET_ADDRSTRLEN] = "";
u_int32_t res = 0;
// execute and get address
char output[255];
FILE *sysFile = popen(
"ifconfig | grep 'inet '| grep -v '127.0.0.1' | awk '{ print $2 }'",
"r");
fgets(output, sizeof(output), sysFile);
pclose(sysFile);
// converting IPaddress to hex.
char *pcword = strtok(output, ".");
while (pcword != NULL) {
sprintf(output, "%02x", atoi(pcword));
strcat(temp, output);
pcword = strtok(NULL, ".");
}
strcpy(output, temp);
sscanf(output, "%x", &res);
// LOG(logINFO, ("ip:%x\n",res);
return res;
}
/* initialization */
void initControlServer() {
if (!updateFlag && initError == OK) {
setupDetector();
}
initCheckDone = 1;
}
void initStopServer() {
if (!updateFlag && initError == OK) {
usleep(CTRL_SRVR_INIT_TIME_US);
if (mapCSP0() == FAIL) {
initError = FAIL;
strcpy(initErrorMessage,
"Stop Server: Map Fail. Cannot proceed. Check Firmware.\n");
LOG(logERROR, (initErrorMessage));
initCheckDone = 1;
return;
}
#ifdef VIRTUAL
sharedMemory_setStop(0);
#endif
}
initCheckDone = 1;
}
/* set up detector */
void setupDetector() {
LOG(logINFO, ("This Server is for 1 Xilinx Chip Test Board\n"));
#ifdef VIRTUAL
sharedMemory_setStatus(IDLE);
#endif
LOG(logINFO, ("Goodbye...\n"));
}
int setDetectorPosition(int pos[]) {
memcpy(detPos, pos, sizeof(detPos));
return OK;
}
int *getDetectorPosition() { return detPos; }
int getNumberofUDPInterfaces() { return 1; }

View File

@ -0,0 +1,18 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#pragma once
#include "RegisterDefs.h"
#include "sls/sls_detector_defs.h"
#define REQRD_FRMWRE_VRSN (0x230000)
#define KERNEL_DATE_VRSN "Wed Nov 29 17:32:14 CET 2023"
#define LINKED_SERVER_NAME "xilinx_ctbDetectorServer"
#define CTRL_SRVR_INIT_TIME_US (2 * 1000 * 1000)
/* Hardware Definitions */
#define NCHAN (1)
enum ADCINDEX { V_PWR_IO };
enum DACINDEX { D0 };

View File

@ -311,19 +311,27 @@ CTB_NAMED_LIST:
infer_action: true
actions:
GET:
check_det_id: true
extra_variables:
- name: det_type
type: auto
value: det->getDetectorType().squash(defs::GENERIC);
exceptions:
- condition: 'cmd != "daclist" && det->getDetectorType().squash() != defs::CHIPTESTBOARD'
- condition: 'cmd != "daclist" && det_type != defs::CHIPTESTBOARD && det_type != defs::XILINX_CHIPTESTBOARD'
message: 'cmd + " only allowed for CTB."'
check_det_id: true
argc: 0
output: [ 'ToString(t)' ]
PUT:
check_det_id: true
extra_variables:
- name: det_type
type: auto
value: det->getDetectorType().squash(defs::GENERIC);
exceptions:
- condition: 'cmd != "daclist" && det->getDetectorType().squash() != defs::CHIPTESTBOARD'
- condition: 'cmd != "daclist" && det_type != defs::CHIPTESTBOARD && det_type != defs::XILINX_CHIPTESTBOARD'
message: 'cmd + " only allowed for CTB."'
- condition: 'cmd == "daclist" && det->getDetectorType().squash() != defs::CHIPTESTBOARD'
- condition: 'cmd == "daclist" && det_type != defs::CHIPTESTBOARD && det_type != defs::XILINX_CHIPTESTBOARD'
message: '"This detector already has fixed dac names. Cannot change them."'
check_det_id: true
input: [ 'args' ]
argc: -1 # unknown number of args
input_types: [ std::string ]
@ -337,12 +345,11 @@ CTB_SINGLE_DACNAME:
extra_variables:
- name: index
type: defs::dacIndex
value: 0
check_det_id: true
value: 0
exceptions:
- condition: 'det->getDetectorType().squash() != defs::CHIPTESTBOARD'
- condition: 'det->getDetectorType().squash(defs::GENERIC) != defs::CHIPTESTBOARD && det->getDetectorType().squash(defs::GENERIC) != defs::XILINX_CHIPTESTBOARD'
message: 'cmd + " only allowed for CTB."'
check_det_id: true
argc: 1
input: [ "static_cast<defs::dacIndex>(StringTo<int>(args[0]) + index)" ]
input_types: [ defs::dacIndex ]
@ -353,11 +360,10 @@ CTB_SINGLE_DACNAME:
- name: index
type: defs::dacIndex
value: 0
check_det_id: true
exceptions:
- condition: 'det->getDetectorType().squash() != defs::CHIPTESTBOARD'
- condition: 'det->getDetectorType().squash(defs::GENERIC) != defs::CHIPTESTBOARD && det->getDetectorType().squash(defs::GENERIC) != defs::XILINX_CHIPTESTBOARD'
message: 'cmd + " only allowed for CTB."'
check_det_id: true
argc: 2
input: [ "static_cast<defs::dacIndex>(StringTo<int>(args[0]) + index)","args[1]" ]
input_types: [ defs::dacIndex , std::string ]
@ -375,7 +381,7 @@ CTB_GET_DACINDEX:
check_det_id: true
exceptions:
- condition: 'det->getDetectorType().squash() != defs::CHIPTESTBOARD'
- condition: 'det->getDetectorType().squash(defs::GENERIC) != defs::CHIPTESTBOARD && det->getDetectorType().squash(defs::GENERIC) != defs::XILINX_CHIPTESTBOARD'
message: 'cmd + " only allowed for CTB."'
argc: 1
input: [ 'args[0]' ]
@ -389,7 +395,7 @@ CTB_SINGLE_NAME:
GET:
check_det_id: true
exceptions:
- condition: 'det->getDetectorType().squash() != defs::CHIPTESTBOARD'
- condition: 'det->getDetectorType().squash(defs::GENERIC) != defs::CHIPTESTBOARD && det->getDetectorType().squash(defs::GENERIC) != defs::XILINX_CHIPTESTBOARD'
message: 'cmd + " only allowed for CTB."'
argc: 1
input: [ "args[0]" ]
@ -399,7 +405,7 @@ CTB_SINGLE_NAME:
PUT:
check_det_id: true
exceptions:
- condition: 'det->getDetectorType().squash() != defs::CHIPTESTBOARD'
- condition: 'det->getDetectorType().squash(defs::GENERIC) != defs::CHIPTESTBOARD && det->getDetectorType().squash(defs::GENERIC) != defs::XILINX_CHIPTESTBOARD'
message: 'cmd + " only allowed for CTB."'
argc: 2
cast_input: [ true, false ]
@ -414,7 +420,7 @@ CTB_GET_INDEX:
GET:
check_det_id: true
exceptions:
- condition: 'det->getDetectorType().squash() != defs::CHIPTESTBOARD'
- condition: 'det->getDetectorType().squash(defs::GENERIC) != defs::CHIPTESTBOARD && det->getDetectorType().squash(defs::GENERIC) != defs::XILINX_CHIPTESTBOARD'
message: 'cmd + " only allowed for CTB."'
argc: 1
input: [ 'args[0]' ]
@ -490,14 +496,14 @@ burstperiod:
################# TIME_GET_COMMAND #############
delayl:
help: "\n\t[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][CTB] Delay Left in Acquisition. \n\t[Gotthard2] only in continuous mode."
help: "\n\t[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Delay Left in Acquisition. \n\t[Gotthard2] only in continuous mode."
inherit_actions: TIME_GET_COMMAND
actions:
GET:
function: getDelayAfterTriggerLeft
periodl:
help: "\n\t[Gotthard][Jungfrau][Moench][CTB][Mythen3][Gotthard2] Period left for current frame. \n\t[Gotthard2] only in continuous mode."
help: "\n\t[Gotthard][Jungfrau][Moench][Ctb][Mythen3][Gotthard2] Period left for current frame. \n\t[Gotthard2] only in continuous mode."
inherit_actions: TIME_GET_COMMAND
actions:
GET:
@ -525,14 +531,14 @@ exptimel:
function: getExptimeLeft
runtime:
help: "[(optional unit) ns|us|ms|s]\n\t[Jungfrau][Moench][Mythen3][Gotthard2][CTB] Time from detector start up.\n\t[Gotthard2] not in burst and auto mode."
help: "[(optional unit) ns|us|ms|s]\n\t[Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Time from detector start up.\n\t[Gotthard2] not in burst and auto mode."
inherit_actions: TIME_GET_COMMAND
actions:
GET:
function: getActualTime
frametime:
help: "[(optional unit) ns|us|ms|s]\n\t[Jungfrau][Moench][Mythen3][Gotthard2][CTB] Timestamp at a frame start.\n\t[Gotthard2] not in burst and auto mode."
help: "[(optional unit) ns|us|ms|s]\n\t[Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Timestamp at a frame start.\n\t[Gotthard2] not in burst and auto mode."
inherit_actions: TIME_GET_COMMAND
actions:
GET:
@ -740,7 +746,7 @@ filterresistor:
function: setFilterResistor
dbitpipeline:
help: "[n_value]\n\t[Ctb][Gotthard2] Pipeline of the clock for latching digital bits.\n\t[Gotthard2] Options: 0-7\n\t[CTB] Options: 0-255"
help: "[n_value]\n\t[Ctb][Gotthard2] Pipeline of the clock for latching digital bits.\n\t[Gotthard2] Options: 0-7\n\t[Ctb] Options: 0-255"
inherit_actions: INTEGER_COMMAND_VEC_ID
actions:
GET:
@ -758,7 +764,7 @@ readnrows:
function: setReadNRows
nextframenumber:
help: "[n_value]\n\t[Eiger][Jungfrau][Moench][CTB] Next frame number. Stopping acquisition might result in different frame numbers for different modules."
help: "[n_value]\n\t[Eiger][Jungfrau][Moench][Ctb] Next frame number. Stopping acquisition might result in different frame numbers for different modules."
inherit_actions: INTEGER_COMMAND_VEC_ID
actions:
GET:
@ -1256,7 +1262,7 @@ dpulse:
input_types: [ bool ]
asamples:
help: "[n_samples]\n\t[CTB] Number of analog samples expected."
help: "[n_samples]\n\t[Ctb] Number of analog samples expected."
inherit_actions: INTEGER_COMMAND_VEC_ID
actions:
GET:
@ -1283,7 +1289,7 @@ runclk:
function: setRUNClock
dsamples:
help: "[n_value]\n\t[CTB] Number of digital samples expected."
help: "[n_value]\n\t[Ctb] Number of digital samples expected."
inherit_actions: INTEGER_COMMAND_VEC_ID
actions:
GET:
@ -1292,7 +1298,7 @@ dsamples:
function: setNumberOfDigitalSamples
tsamples:
help: "[n_value]\n\t[CTB] Number of transceiver samples expected."
help: "[n_value]\n\t[Ctb] Number of transceiver samples expected."
inherit_actions: INTEGER_COMMAND_VEC_ID
actions:
GET:
@ -1301,7 +1307,7 @@ tsamples:
function: setNumberOfTransceiverSamples
romode:
help: "[analog|digital|analog_digital|transceiver|digital_transceiver]\n\t[CTB] Readout mode. Default is analog."
help: "[analog|digital|analog_digital|transceiver|digital_transceiver]\n\t[Ctb] Readout mode. Default is analog."
inherit_actions: INTEGER_COMMAND_VEC_ID
actions:
GET:
@ -1872,35 +1878,35 @@ moduleid:
type:
inherit_actions: GET_COMMAND
help: "\n\tReturns detector type. Can be Eiger, Jungfrau, Gotthard, Moench, Mythen3, Gotthard2, ChipTestBoard"
help: "\n\tReturns detector type. Can be Eiger, Jungfrau, Gotthard, Moench, Mythen3, Gotthard2, ChipTestBoard, Xilinx_ChipTestBoard"
actions:
GET:
function: getDetectorType
framesl:
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] Number of frames left in acquisition. \n\t[Gotthard2] only in continuous auto mode."
actions:
GET:
function: getNumberOfFramesLeft
triggersl:
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] Number of triggers left in acquisition. Only when external trigger used."
actions:
GET:
function: getNumberOfTriggersLeft
maxadcphaseshift:
inherit_actions: GET_COMMAND
help: "\n\t[Jungfrau][Moench][CTB] Absolute maximum Phase shift of ADC clock."
help: "\n\t[Jungfrau][Moench][Ctb] Absolute maximum Phase shift of ADC clock."
actions:
GET:
function: getMaxADCPhaseShift
maxdbitphaseshift:
inherit_actions: GET_COMMAND
help: "\n\t[CTB][Jungfrau] Absolute maximum Phase shift of of the clock to latch digital bits."
help: "\n\t[Ctb][Jungfrau] Absolute maximum Phase shift of of the clock to latch digital bits."
actions:
GET:
function: getMaxDBITPhaseShift
@ -2005,7 +2011,7 @@ lastclient:
framecounter:
inherit_actions: GET_COMMAND
help: "\n\t[Jungfrau][Moench][Mythen3][Gotthard2][CTB] Number of frames from start run control.\n\t[Gotthard2] only in continuous mode."
help: "\n\t[Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Number of frames from start run control.\n\t[Gotthard2] only in continuous mode."
actions:
GET:
function: getNumberOfFramesFromStart
@ -2013,7 +2019,7 @@ framecounter:
################# GET_COMMAND_HEX ############################
serialnumber:
inherit_actions: GET_COMMAND
help: "\n\t[Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][CTB]\nSerial number of detector."
help: "\n\t[Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][Ctb]\nSerial number of detector."
actions:
GET:
function: getSerialNumber
@ -2236,7 +2242,7 @@ im_io:
################# CTB_NAMED_LIST #############################
daclist:
inherit_actions: CTB_NAMED_LIST
help: "[dacname1 dacname2 .. dacname18] \n\t\t[ChipTestBoard] Set the list of dac names for this detector.\n\t\t[All] Gets the list of dac names for every dac for this detector."
help: "[dacname1 dacname2 .. dacname18] \n\t\t[Ctb][Xilinx_Ctb] Set the list of dac names for this detector.\n\t\t[All] Gets the list of dac names for every dac for this detector."
actions:
GET:
function: getDacNames
@ -2245,7 +2251,7 @@ daclist:
adclist:
inherit_actions: CTB_NAMED_LIST
help: "[adcname1 adcname2 .. adcname32] \n\t\t[ChipTestBoard] Set the list of adc names for this board."
help: "[adcname1 adcname2 .. adcname32] \n\t\t[Ctb][Xilinx_Ctb] Set the list of adc names for this board."
actions:
GET:
function: getAdcNames
@ -2254,7 +2260,7 @@ adclist:
signallist:
inherit_actions: CTB_NAMED_LIST
help: "[signalname1 signalname2 .. signalname63] \n\t\t[ChipTestBoard] Set the list of signal names for this board."
help: "[signalname1 signalname2 .. signalname63] \n\t\t[Ctb][Xilinx_Ctb] Set the list of signal names for this board."
actions:
GET:
function: getSignalNames
@ -2263,7 +2269,7 @@ signallist:
powerlist:
inherit_actions: CTB_NAMED_LIST
help: "[powername1 powername2 .. powername4] \n\t\t[ChipTestBoard] Set the list of power names for this board."
help: "[powername1 powername2 .. powername4] \n\t\t[Ctb][Xilinx_Ctb] Set the list of power names for this board."
actions:
GET:
function: getPowerNames
@ -2272,7 +2278,7 @@ powerlist:
slowadclist:
inherit_actions: CTB_NAMED_LIST
help: "[slowadcname1 slowadcname2 .. slowadcname7] \n\t\t[ChipTestBoard] Set the list of slowadc names for this board."
help: "[slowadcname1 slowadcname2 .. slowadcname7] \n\t\t[Ctb][Xilinx_Ctb] Set the list of slowadc names for this board."
actions:
GET:
function: getSlowADCNames
@ -2281,7 +2287,7 @@ slowadclist:
################# CTB_VALUES ################################
powervalues:
help: "[name] \n\t\t[ChipTestBoard] Get values of all powers."
help: "[name] \n\t\t[Ctb][Xilinx_Ctb] Get values of all powers."
actions:
GET:
argc: 0
@ -2293,7 +2299,7 @@ powervalues:
printable_name: "*name_it++"
slowadcvalues:
help: "[name] \n\t\t[ChipTestBoard] Get values of all slow adcs."
help: "[name] \n\t\t[Ctb][Xilinx_Ctb] Get values of all slow adcs."
actions:
GET:
argc: 0
@ -2319,7 +2325,7 @@ tempvalues:
################# CTB_SINGLE_DACNAME ########################
dacname:
inherit_actions: CTB_SINGLE_DACNAME
help: "[0-17][name] \n\t\t[ChipTestBoard] Set the dac at the given position to the given name."
help: "[0-17][name] \n\t\t[Ctb][Xilinx_Ctb] Set the dac at the given position to the given name."
actions:
GET:
function: getDacName
@ -2336,7 +2342,7 @@ dacname:
powername:
inherit_actions: CTB_SINGLE_DACNAME
help: "[0-4][name] \n\t\t[ChipTestBoard] Set the power at the given position to the given name."
help: "[0-4][name] \n\t\t[Ctb][Xilinx_Ctb] Set the power at the given position to the given name."
actions:
GET:
function: getPowerName
@ -2353,7 +2359,7 @@ powername:
slowadcname:
inherit_actions: CTB_SINGLE_DACNAME
help: "[0-7][name] \n\t\t[ChipTestBoard] Set the slowadc at the given position to the given name."
help: "[0-7][name] \n\t\t[Ctb][Xilinx_Ctb] Set the slowadc at the given position to the given name."
actions:
GET:
function: getSlowADCName
@ -2371,7 +2377,7 @@ slowadcname:
################# CTB_GET_DACINDEX ##########################
dacindex:
inherit_actions: CTB_GET_DACINDEX
help: "[name] \n\t\t[ChipTestBoard] Get the dac index for the given name."
help: "[name] \n\t\t[Ctb][Xilinx_Ctb] Get the dac index for the given name."
actions:
GET:
function: getDacIndex
@ -2382,7 +2388,7 @@ dacindex:
powerindex:
inherit_actions: CTB_GET_DACINDEX
help: "[name] \n\t\t[ChipTestBoard] Get the power index for the given name."
help: "[name] \n\t\t[Ctb][Xilinx_Ctb] Get the power index for the given name."
actions:
GET:
function: getPowerIndex
@ -2393,7 +2399,7 @@ powerindex:
slowadcindex:
inherit_actions: CTB_GET_DACINDEX
help: "[name] \n\t\t[ChipTestBoard] Get the slowadc index for the given name."
help: "[name] \n\t\t[Ctb][Xilinx_Ctb] Get the slowadc index for the given name."
actions:
GET:
function: getSlowADCIndex
@ -2405,7 +2411,7 @@ slowadcindex:
################# CTB_SINGLE_NAME ###########################
adcname:
inherit_actions: CTB_SINGLE_NAME
help: "[0-31][name] \n\t\t[ChipTestBoard] Set the adc at the given position to the given name."
help: "[0-31][name] \n\t\t[Ctb][Xilinx_Ctb] Set the adc at the given position to the given name."
actions:
GET:
function: getAdcName
@ -2414,7 +2420,7 @@ adcname:
signalname:
inherit_actions: CTB_SINGLE_NAME
help: "[0-63][name] \n\t\t[ChipTestBoard] Set the signal at the given position to the given name."
help: "[0-63][name] \n\t\t[Ctb][Xilinx_Ctb] Set the signal at the given position to the given name."
actions:
GET:
function: getSignalName
@ -2424,14 +2430,14 @@ signalname:
################# CTB_GET_INDEX #############################
adcindex:
inherit_actions: CTB_GET_INDEX
help: "[name] \n\t\t[ChipTestBoard] Get the adc index for the given name."
help: "[name] \n\t\t[Ctb][Xilinx_Ctb] Get the adc index for the given name."
actions:
GET:
function: getAdcIndex
signalindex:
inherit_actions: CTB_GET_INDEX
help: "[name] \n\t\t[ChipTestBoard] Get the signal index for the given name."
help: "[name] \n\t\t[Ctb][Xilinx_Ctb] Get the signal index for the given name."
actions:
GET:
function: getSignalIndex
@ -2877,16 +2883,24 @@ readoutspeed:
help: "\n\t[0 or full_speed|1 or half_speed|2 or quarter_speed]\n\t[Eiger][Jungfrau][Moench] Readout speed of chip.\n\t[Eiger][Moench] Default speed is full_speed.\n\t[Jungfrau] Default speed is half_speed. full_speed option only available from v2.0 boards and is recommended to set number of interfaces to 2. Also overwrites adcphase to recommended default.\n\t [144|108]\n\t\t[Gotthard2] Readout speed of chip in MHz. Default is 108."
actions:
GET:
extra_variables:
- name: det_type
type: auto
value: det->getDetectorType().squash(defs::GENERIC);
exceptions:
- condition: 'det->getDetectorType().squash() == defs::CHIPTESTBOARD'
- condition: 'det_type == defs::CHIPTESTBOARD || det_type == defs::XILINX_CHIPTESTBOARD'
message: '"ReadoutSpeed not implemented. Did you mean runclk?"'
argc: 0
require_det_id: true
function: getReadoutSpeed
output: [ OutString(t) ]
PUT:
extra_variables:
- name: det_type
type: auto
value: det->getDetectorType().squash(defs::GENERIC);
exceptions:
- condition: 'det->getDetectorType().squash() == defs::CHIPTESTBOARD'
- condition: 'det_type == defs::CHIPTESTBOARD || det_type == defs::XILINX_CHIPTESTBOARD'
message: '"ReadoutSpeed not implemented. Did you mean runclk?"'
argc: 1
require_det_id: true
@ -3158,12 +3172,12 @@ dac:
actions:
GET:
exceptions:
- condition: "is_int(args[0]) && det->getDetectorType().squash() != defs::CHIPTESTBOARD"
- condition: "is_int(args[0]) && det->getDetectorType().squash() != defs::CHIPTESTBOARD && det->getDetectorType().squash() != defs::XILINX_CHIPTESTBOARD"
message: '"Dac indices can only be used for chip test board. Use daclist to get list of dac names for current detector."'
extra_variables:
- name: dacIndex
type: defs::dacIndex
value: "(det->getDetectorType().squash() == defs::CHIPTESTBOARD && !is_int(args[0])) ? det->getDacIndex(args[0]) : StringTo<defs::dacIndex>(args[0])"
value: "((det->getDetectorType().squash() == defs::CHIPTESTBOARD || det->getDetectorType().squash() == defs::XILINX_CHIPTESTBOARD) && !is_int(args[0])) ? det->getDacIndex(args[0]) : StringTo<defs::dacIndex>(args[0])"
function: getDAC
require_det_id: true
input_types: [ defs::dacIndex, bool ]
@ -3175,7 +3189,7 @@ dac:
output: [ 'args[0]', "' '", OutString(t) ]
- argc: 2
exceptions:
- condition: "is_int(args[0]) && det->getDetectorType().squash() != defs::CHIPTESTBOARD"
- condition: "is_int(args[0]) && det->getDetectorType().squash() != defs::CHIPTESTBOARD && det->getDetectorType().squash() != defs::XILINX_CHIPTESTBOARD"
message: '"Dac indices can only be used for chip test board. Use daclist to get list of dac names for current detector."'
- condition: 'args[1] != "mv" && args[1] != "mV"'
message: '"Unknown argument " + args[1] + ". Did you mean mV?"'
@ -3184,12 +3198,12 @@ dac:
output: [ 'args[0]', "' '" , OutString(t), '" mV"' ]
PUT:
exceptions:
- condition: "is_int(args[0]) && det->getDetectorType().squash() != defs::CHIPTESTBOARD"
- condition: "is_int(args[0]) && det->getDetectorType().squash() != defs::CHIPTESTBOARD && det->getDetectorType().squash() != defs::XILINX_CHIPTESTBOARD"
message: '"Dac indices can only be used for chip test board. Use daclist to get list of dac names for current detector."'
extra_variables:
- name: dacIndex
type: defs::dacIndex
value: "(det->getDetectorType().squash() == defs::CHIPTESTBOARD && !is_int(args[0])) ? det->getDacIndex(args[0]) : StringTo<defs::dacIndex>(args[0])"
value: "((det->getDetectorType().squash() == defs::CHIPTESTBOARD || det->getDetectorType().squash() == defs::XILINX_CHIPTESTBOARD) && !is_int(args[0])) ? det->getDacIndex(args[0]) : StringTo<defs::dacIndex>(args[0])"
function: setDAC
require_det_id: true
input_types: [ defs::dacIndex, int, bool ]
@ -4141,7 +4155,7 @@ updatekernel:
output: [ '"successful"' ]
update:
help: "\n\tWithout tftp: [server_name (incl fullpath)] [fname.pof (incl full path)] This does not use tftp.\n\t\t[Jungfrau][Moench][Gotthard][CTB] Updates the firmware, detector server, deletes old server, creates the symbolic link and then reboots detector controller. \n\t\t[Mythen3][Gotthard2] will require a script to start up the shorter named server link at start up. \n\t\tserver_name is full path name of detector server binary\n\t\tfname is full path of programming file"
help: "\n\tWithout tftp: [server_name (incl fullpath)] [fname.pof (incl full path)] This does not use tftp.\n\t\t[Jungfrau][Moench][Gotthard][Ctb] Updates the firmware, detector server, deletes old server, creates the symbolic link and then reboots detector controller. \n\t\t[Mythen3][Gotthard2] will require a script to start up the shorter named server link at start up. \n\t\tserver_name is full path name of detector server binary\n\t\tfname is full path of programming file"
actions:
PUT:
argc: 2

View File

@ -202,7 +202,8 @@ adcindex:
check_det_id: true
convert_det_id: true
exceptions:
- condition: det->getDetectorType().squash() != defs::CHIPTESTBOARD
- condition: det->getDetectorType().squash(defs::GENERIC) != defs::CHIPTESTBOARD
&& det->getDetectorType().squash(defs::GENERIC) != defs::XILINX_CHIPTESTBOARD
message: cmd + " only allowed for CTB."
function: getAdcIndex
input:
@ -215,7 +216,7 @@ adcindex:
store_result_in_t: true
command_name: adcindex
function_alias: adcindex
help: "[name] \n\t\t[ChipTestBoard] Get the adc index for the given name."
help: "[name] \n\t\t[Ctb][Xilinx_Ctb] Get the adc index for the given name."
infer_action: true
template: true
adcinvert:
@ -268,8 +269,13 @@ adclist:
check_det_id: true
convert_det_id: true
exceptions:
- condition: cmd != "daclist" && det->getDetectorType().squash() != defs::CHIPTESTBOARD
- condition: cmd != "daclist" && det_type != defs::CHIPTESTBOARD && det_type
!= defs::XILINX_CHIPTESTBOARD
message: cmd + " only allowed for CTB."
extra_variables:
- name: det_type
type: auto
value: det->getDetectorType().squash(defs::GENERIC);
function: getAdcNames
input: []
input_types: []
@ -287,10 +293,16 @@ adclist:
check_det_id: true
convert_det_id: true
exceptions:
- condition: cmd != "daclist" && det->getDetectorType().squash() != defs::CHIPTESTBOARD
- condition: cmd != "daclist" && det_type != defs::CHIPTESTBOARD && det_type
!= defs::XILINX_CHIPTESTBOARD
message: cmd + " only allowed for CTB."
- condition: cmd == "daclist" && det->getDetectorType().squash() != defs::CHIPTESTBOARD
- condition: cmd == "daclist" && det_type != defs::CHIPTESTBOARD && det_type
!= defs::XILINX_CHIPTESTBOARD
message: '"This detector already has fixed dac names. Cannot change them."'
extra_variables:
- name: det_type
type: auto
value: det->getDetectorType().squash(defs::GENERIC);
function: setAdcNames
input:
- args
@ -302,8 +314,8 @@ adclist:
store_result_in_t: false
command_name: adclist
function_alias: adclist
help: "[adcname1 adcname2 .. adcname32] \n\t\t[ChipTestBoard] Set the list of adc\
\ names for this board."
help: "[adcname1 adcname2 .. adcname32] \n\t\t[Ctb][Xilinx_Ctb] Set the list of\
\ adc names for this board."
infer_action: true
template: true
adcname:
@ -318,7 +330,8 @@ adcname:
check_det_id: true
convert_det_id: true
exceptions:
- condition: det->getDetectorType().squash() != defs::CHIPTESTBOARD
- condition: det->getDetectorType().squash(defs::GENERIC) != defs::CHIPTESTBOARD
&& det->getDetectorType().squash(defs::GENERIC) != defs::XILINX_CHIPTESTBOARD
message: cmd + " only allowed for CTB."
function: getAdcName
input:
@ -343,7 +356,8 @@ adcname:
check_det_id: true
convert_det_id: true
exceptions:
- condition: det->getDetectorType().squash() != defs::CHIPTESTBOARD
- condition: det->getDetectorType().squash(defs::GENERIC) != defs::CHIPTESTBOARD
&& det->getDetectorType().squash(defs::GENERIC) != defs::XILINX_CHIPTESTBOARD
message: cmd + " only allowed for CTB."
function: setAdcName
input:
@ -358,8 +372,8 @@ adcname:
store_result_in_t: false
command_name: adcname
function_alias: adcname
help: "[0-31][name] \n\t\t[ChipTestBoard] Set the adc at the given position to the\
\ given name."
help: "[0-31][name] \n\t\t[Ctb][Xilinx_Ctb] Set the adc at the given position to\
\ the given name."
infer_action: true
template: true
adcphase:
@ -708,7 +722,7 @@ asamples:
store_result_in_t: false
command_name: asamples
function_alias: asamples
help: "[n_samples]\n\t[CTB] Number of analog samples expected."
help: "[n_samples]\n\t[Ctb] Number of analog samples expected."
infer_action: true
template: true
autocompdisable:
@ -1711,13 +1725,15 @@ dac:
convert_det_id: true
exceptions:
- condition: is_int(args[0]) && det->getDetectorType().squash() != defs::CHIPTESTBOARD
&& det->getDetectorType().squash() != defs::XILINX_CHIPTESTBOARD
message: '"Dac indices can only be used for chip test board. Use daclist
to get list of dac names for current detector."'
extra_variables:
- name: dacIndex
type: defs::dacIndex
value: '(det->getDetectorType().squash() == defs::CHIPTESTBOARD && !is_int(args[0]))
? det->getDacIndex(args[0]) : StringTo<defs::dacIndex>(args[0])'
value: '((det->getDetectorType().squash() == defs::CHIPTESTBOARD || det->getDetectorType().squash()
== defs::XILINX_CHIPTESTBOARD) && !is_int(args[0])) ? det->getDacIndex(args[0])
: StringTo<defs::dacIndex>(args[0])'
function: getDAC
input:
- dacIndex
@ -1742,6 +1758,7 @@ dac:
convert_det_id: true
exceptions:
- condition: is_int(args[0]) && det->getDetectorType().squash() != defs::CHIPTESTBOARD
&& det->getDetectorType().squash() != defs::XILINX_CHIPTESTBOARD
message: '"Dac indices can only be used for chip test board. Use daclist
to get list of dac names for current detector."'
- condition: args[1] != "mv" && args[1] != "mV"
@ -1749,8 +1766,9 @@ dac:
extra_variables:
- name: dacIndex
type: defs::dacIndex
value: '(det->getDetectorType().squash() == defs::CHIPTESTBOARD && !is_int(args[0]))
? det->getDacIndex(args[0]) : StringTo<defs::dacIndex>(args[0])'
value: '((det->getDetectorType().squash() == defs::CHIPTESTBOARD || det->getDetectorType().squash()
== defs::XILINX_CHIPTESTBOARD) && !is_int(args[0])) ? det->getDacIndex(args[0])
: StringTo<defs::dacIndex>(args[0])'
function: getDAC
input:
- dacIndex
@ -1779,13 +1797,15 @@ dac:
convert_det_id: true
exceptions:
- condition: is_int(args[0]) && det->getDetectorType().squash() != defs::CHIPTESTBOARD
&& det->getDetectorType().squash() != defs::XILINX_CHIPTESTBOARD
message: '"Dac indices can only be used for chip test board. Use daclist
to get list of dac names for current detector."'
extra_variables:
- name: dacIndex
type: defs::dacIndex
value: '(det->getDetectorType().squash() == defs::CHIPTESTBOARD && !is_int(args[0]))
? det->getDacIndex(args[0]) : StringTo<defs::dacIndex>(args[0])'
value: '((det->getDetectorType().squash() == defs::CHIPTESTBOARD || det->getDetectorType().squash()
== defs::XILINX_CHIPTESTBOARD) && !is_int(args[0])) ? det->getDacIndex(args[0])
: StringTo<defs::dacIndex>(args[0])'
function: setDAC
input:
- dacIndex
@ -1814,13 +1834,15 @@ dac:
convert_det_id: true
exceptions:
- condition: is_int(args[0]) && det->getDetectorType().squash() != defs::CHIPTESTBOARD
&& det->getDetectorType().squash() != defs::XILINX_CHIPTESTBOARD
message: '"Dac indices can only be used for chip test board. Use daclist
to get list of dac names for current detector."'
extra_variables:
- name: dacIndex
type: defs::dacIndex
value: '(det->getDetectorType().squash() == defs::CHIPTESTBOARD && !is_int(args[0]))
? det->getDacIndex(args[0]) : StringTo<defs::dacIndex>(args[0])'
value: '((det->getDetectorType().squash() == defs::CHIPTESTBOARD || det->getDetectorType().squash()
== defs::XILINX_CHIPTESTBOARD) && !is_int(args[0])) ? det->getDacIndex(args[0])
: StringTo<defs::dacIndex>(args[0])'
function: setDAC
input:
- dacIndex
@ -1855,7 +1877,8 @@ dacindex:
check_det_id: true
convert_det_id: true
exceptions:
- condition: det->getDetectorType().squash() != defs::CHIPTESTBOARD
- condition: det->getDetectorType().squash(defs::GENERIC) != defs::CHIPTESTBOARD
&& det->getDetectorType().squash(defs::GENERIC) != defs::XILINX_CHIPTESTBOARD
message: cmd + " only allowed for CTB."
extra_variables:
- name: index
@ -1872,7 +1895,7 @@ dacindex:
store_result_in_t: true
command_name: dacindex
function_alias: dacindex
help: "[name] \n\t\t[ChipTestBoard] Get the dac index for the given name."
help: "[name] \n\t\t[Ctb][Xilinx_Ctb] Get the dac index for the given name."
infer_action: true
template: true
daclist:
@ -1885,8 +1908,13 @@ daclist:
check_det_id: true
convert_det_id: true
exceptions:
- condition: cmd != "daclist" && det->getDetectorType().squash() != defs::CHIPTESTBOARD
- condition: cmd != "daclist" && det_type != defs::CHIPTESTBOARD && det_type
!= defs::XILINX_CHIPTESTBOARD
message: cmd + " only allowed for CTB."
extra_variables:
- name: det_type
type: auto
value: det->getDetectorType().squash(defs::GENERIC);
function: getDacNames
input: []
input_types: []
@ -1904,10 +1932,16 @@ daclist:
check_det_id: true
convert_det_id: true
exceptions:
- condition: cmd != "daclist" && det->getDetectorType().squash() != defs::CHIPTESTBOARD
- condition: cmd != "daclist" && det_type != defs::CHIPTESTBOARD && det_type
!= defs::XILINX_CHIPTESTBOARD
message: cmd + " only allowed for CTB."
- condition: cmd == "daclist" && det->getDetectorType().squash() != defs::CHIPTESTBOARD
- condition: cmd == "daclist" && det_type != defs::CHIPTESTBOARD && det_type
!= defs::XILINX_CHIPTESTBOARD
message: '"This detector already has fixed dac names. Cannot change them."'
extra_variables:
- name: det_type
type: auto
value: det->getDetectorType().squash(defs::GENERIC);
function: setDacNames
input:
- args
@ -1919,9 +1953,9 @@ daclist:
store_result_in_t: false
command_name: daclist
function_alias: daclist
help: "[dacname1 dacname2 .. dacname18] \n\t\t[ChipTestBoard] Set the list of dac\
\ names for this detector.\n\t\t[All] Gets the list of dac names for every dac\
\ for this detector."
help: "[dacname1 dacname2 .. dacname18] \n\t\t[Ctb][Xilinx_Ctb] Set the list of\
\ dac names for this detector.\n\t\t[All] Gets the list of dac names for every\
\ dac for this detector."
infer_action: true
template: true
dacname:
@ -1936,7 +1970,8 @@ dacname:
check_det_id: true
convert_det_id: true
exceptions:
- condition: det->getDetectorType().squash() != defs::CHIPTESTBOARD
- condition: det->getDetectorType().squash(defs::GENERIC) != defs::CHIPTESTBOARD
&& det->getDetectorType().squash(defs::GENERIC) != defs::XILINX_CHIPTESTBOARD
message: cmd + " only allowed for CTB."
extra_variables:
- name: index
@ -1965,7 +2000,8 @@ dacname:
check_det_id: true
convert_det_id: true
exceptions:
- condition: det->getDetectorType().squash() != defs::CHIPTESTBOARD
- condition: det->getDetectorType().squash(defs::GENERIC) != defs::CHIPTESTBOARD
&& det->getDetectorType().squash(defs::GENERIC) != defs::XILINX_CHIPTESTBOARD
message: cmd + " only allowed for CTB."
extra_variables:
- name: index
@ -1984,8 +2020,8 @@ dacname:
store_result_in_t: false
command_name: dacname
function_alias: dacname
help: "[0-17][name] \n\t\t[ChipTestBoard] Set the dac at the given position to the\
\ given name."
help: "[0-17][name] \n\t\t[Ctb][Xilinx_Ctb] Set the dac at the given position to\
\ the given name."
infer_action: true
template: true
dacvalues:
@ -2253,7 +2289,7 @@ dbitpipeline:
command_name: dbitpipeline
function_alias: dbitpipeline
help: "[n_value]\n\t[Ctb][Gotthard2] Pipeline of the clock for latching digital\
\ bits.\n\t[Gotthard2] Options: 0-7\n\t[CTB] Options: 0-255"
\ bits.\n\t[Gotthard2] Options: 0-7\n\t[Ctb] Options: 0-255"
infer_action: true
template: true
defaultdac:
@ -2494,7 +2530,7 @@ delayl:
store_result_in_t: true
command_name: delayl
function_alias: delayl
help: "\n\t[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][CTB] Delay Left in Acquisition.\
help: "\n\t[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Delay Left in Acquisition.\
\ \n\t[Gotthard2] only in continuous mode."
infer_action: true
template: true
@ -2728,7 +2764,7 @@ dsamples:
store_result_in_t: false
command_name: dsamples
function_alias: dsamples
help: "[n_value]\n\t[CTB] Number of digital samples expected."
help: "[n_value]\n\t[Ctb] Number of digital samples expected."
infer_action: true
template: true
execcommand:
@ -3870,7 +3906,7 @@ framecounter:
store_result_in_t: true
command_name: framecounter
function_alias: framecounter
help: "\n\t[Jungfrau][Moench][Mythen3][Gotthard2][CTB] Number of frames from start\
help: "\n\t[Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Number of frames from start\
\ run control.\n\t[Gotthard2] only in continuous mode."
infer_action: true
template: true
@ -3934,7 +3970,7 @@ framesl:
store_result_in_t: true
command_name: 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] Number of frames\
\ left in acquisition. \n\t[Gotthard2] only in continuous auto mode."
infer_action: true
template: true
@ -3969,7 +4005,7 @@ frametime:
store_result_in_t: true
command_name: frametime
function_alias: frametime
help: "[(optional unit) ns|us|ms|s]\n\t[Jungfrau][Moench][Mythen3][Gotthard2][CTB]\
help: "[(optional unit) ns|us|ms|s]\n\t[Jungfrau][Moench][Mythen3][Gotthard2][Ctb]\
\ Timestamp at a frame start.\n\t[Gotthard2] not in burst and auto mode."
infer_action: true
template: true
@ -5252,7 +5288,7 @@ maxadcphaseshift:
store_result_in_t: true
command_name: maxadcphaseshift
function_alias: maxadcphaseshift
help: "\n\t[Jungfrau][Moench][CTB] Absolute maximum Phase shift of ADC clock."
help: "\n\t[Jungfrau][Moench][Ctb] Absolute maximum Phase shift of ADC clock."
infer_action: true
template: true
maxclkphaseshift:
@ -5305,7 +5341,7 @@ maxdbitphaseshift:
store_result_in_t: true
command_name: maxdbitphaseshift
function_alias: maxdbitphaseshift
help: "\n\t[CTB][Jungfrau] Absolute maximum Phase shift of of the clock to latch\
help: "\n\t[Ctb][Jungfrau] Absolute maximum Phase shift of of the clock to latch\
\ digital bits."
infer_action: true
template: true
@ -5438,7 +5474,7 @@ nextframenumber:
store_result_in_t: false
command_name: nextframenumber
function_alias: nextframenumber
help: "[n_value]\n\t[Eiger][Jungfrau][Moench][CTB] Next frame number. Stopping acquisition\
help: "[n_value]\n\t[Eiger][Jungfrau][Moench][Ctb] Next frame number. Stopping acquisition\
\ might result in different frame numbers for different modules."
infer_action: true
template: true
@ -7142,7 +7178,7 @@ periodl:
store_result_in_t: true
command_name: periodl
function_alias: periodl
help: "\n\t[Gotthard][Jungfrau][Moench][CTB][Mythen3][Gotthard2] Period left for\
help: "\n\t[Gotthard][Jungfrau][Moench][Ctb][Mythen3][Gotthard2] Period left for\
\ current frame. \n\t[Gotthard2] only in continuous mode."
infer_action: true
template: true
@ -7281,7 +7317,8 @@ powerindex:
check_det_id: true
convert_det_id: true
exceptions:
- condition: det->getDetectorType().squash() != defs::CHIPTESTBOARD
- condition: det->getDetectorType().squash(defs::GENERIC) != defs::CHIPTESTBOARD
&& det->getDetectorType().squash(defs::GENERIC) != defs::XILINX_CHIPTESTBOARD
message: cmd + " only allowed for CTB."
extra_variables:
- name: index
@ -7298,7 +7335,7 @@ powerindex:
store_result_in_t: true
command_name: powerindex
function_alias: powerindex
help: "[name] \n\t\t[ChipTestBoard] Get the power index for the given name."
help: "[name] \n\t\t[Ctb][Xilinx_Ctb] Get the power index for the given name."
infer_action: true
template: true
powerlist:
@ -7311,8 +7348,13 @@ powerlist:
check_det_id: true
convert_det_id: true
exceptions:
- condition: cmd != "daclist" && det->getDetectorType().squash() != defs::CHIPTESTBOARD
- condition: cmd != "daclist" && det_type != defs::CHIPTESTBOARD && det_type
!= defs::XILINX_CHIPTESTBOARD
message: cmd + " only allowed for CTB."
extra_variables:
- name: det_type
type: auto
value: det->getDetectorType().squash(defs::GENERIC);
function: getPowerNames
input: []
input_types: []
@ -7330,10 +7372,16 @@ powerlist:
check_det_id: true
convert_det_id: true
exceptions:
- condition: cmd != "daclist" && det->getDetectorType().squash() != defs::CHIPTESTBOARD
- condition: cmd != "daclist" && det_type != defs::CHIPTESTBOARD && det_type
!= defs::XILINX_CHIPTESTBOARD
message: cmd + " only allowed for CTB."
- condition: cmd == "daclist" && det->getDetectorType().squash() != defs::CHIPTESTBOARD
- condition: cmd == "daclist" && det_type != defs::CHIPTESTBOARD && det_type
!= defs::XILINX_CHIPTESTBOARD
message: '"This detector already has fixed dac names. Cannot change them."'
extra_variables:
- name: det_type
type: auto
value: det->getDetectorType().squash(defs::GENERIC);
function: setPowerNames
input:
- args
@ -7345,7 +7393,7 @@ powerlist:
store_result_in_t: false
command_name: powerlist
function_alias: powerlist
help: "[powername1 powername2 .. powername4] \n\t\t[ChipTestBoard] Set the list\
help: "[powername1 powername2 .. powername4] \n\t\t[Ctb][Xilinx_Ctb] Set the list\
\ of power names for this board."
infer_action: true
template: true
@ -7361,7 +7409,8 @@ powername:
check_det_id: true
convert_det_id: true
exceptions:
- condition: det->getDetectorType().squash() != defs::CHIPTESTBOARD
- condition: det->getDetectorType().squash(defs::GENERIC) != defs::CHIPTESTBOARD
&& det->getDetectorType().squash(defs::GENERIC) != defs::XILINX_CHIPTESTBOARD
message: cmd + " only allowed for CTB."
extra_variables:
- name: index
@ -7390,7 +7439,8 @@ powername:
check_det_id: true
convert_det_id: true
exceptions:
- condition: det->getDetectorType().squash() != defs::CHIPTESTBOARD
- condition: det->getDetectorType().squash(defs::GENERIC) != defs::CHIPTESTBOARD
&& det->getDetectorType().squash(defs::GENERIC) != defs::XILINX_CHIPTESTBOARD
message: cmd + " only allowed for CTB."
extra_variables:
- name: index
@ -7409,7 +7459,7 @@ powername:
store_result_in_t: false
command_name: powername
function_alias: powername
help: "[0-4][name] \n\t\t[ChipTestBoard] Set the power at the given position to\
help: "[0-4][name] \n\t\t[Ctb][Xilinx_Ctb] Set the power at the given position to\
\ the given name."
infer_action: true
template: true
@ -7436,7 +7486,7 @@ powervalues:
store_result_in_t: true
command_name: powervalues
function_alias: powervalues
help: "[name] \n\t\t[ChipTestBoard] Get values of all powers."
help: "[name] \n\t\t[Ctb][Xilinx_Ctb] Get values of all powers."
infer_action: true
programfpga:
actions:
@ -7778,8 +7828,12 @@ readoutspeed:
check_det_id: false
convert_det_id: true
exceptions:
- condition: det->getDetectorType().squash() == defs::CHIPTESTBOARD
- condition: det_type == defs::CHIPTESTBOARD || det_type == defs::XILINX_CHIPTESTBOARD
message: '"ReadoutSpeed not implemented. Did you mean runclk?"'
extra_variables:
- name: det_type
type: auto
value: det->getDetectorType().squash(defs::GENERIC);
function: getReadoutSpeed
input: []
input_types: []
@ -7797,8 +7851,12 @@ readoutspeed:
check_det_id: false
convert_det_id: true
exceptions:
- condition: det->getDetectorType().squash() == defs::CHIPTESTBOARD
- condition: det_type == defs::CHIPTESTBOARD || det_type == defs::XILINX_CHIPTESTBOARD
message: '"ReadoutSpeed not implemented. Did you mean runclk?"'
extra_variables:
- name: det_type
type: auto
value: det->getDetectorType().squash(defs::GENERIC);
function: setReadoutSpeed
input:
- args[0]
@ -8058,7 +8116,7 @@ romode:
store_result_in_t: false
command_name: romode
function_alias: romode
help: "[analog|digital|analog_digital|transceiver|digital_transceiver]\n\t[CTB]\
help: "[analog|digital|analog_digital|transceiver|digital_transceiver]\n\t[Ctb]\
\ Readout mode. Default is analog."
infer_action: true
template: true
@ -8172,7 +8230,7 @@ runtime:
store_result_in_t: true
command_name: runtime
function_alias: runtime
help: "[(optional unit) ns|us|ms|s]\n\t[Jungfrau][Moench][Mythen3][Gotthard2][CTB]\
help: "[(optional unit) ns|us|ms|s]\n\t[Jungfrau][Moench][Mythen3][Gotthard2][Ctb]\
\ Time from detector start up.\n\t[Gotthard2] not in burst and auto mode."
infer_action: true
template: true
@ -9554,7 +9612,7 @@ serialnumber:
store_result_in_t: true
command_name: serialnumber
function_alias: serialnumber
help: "\n\t[Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][CTB]\nSerial number\
help: "\n\t[Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][Ctb]\nSerial number\
\ of detector."
infer_action: true
template: true
@ -9710,7 +9768,8 @@ signalindex:
check_det_id: true
convert_det_id: true
exceptions:
- condition: det->getDetectorType().squash() != defs::CHIPTESTBOARD
- condition: det->getDetectorType().squash(defs::GENERIC) != defs::CHIPTESTBOARD
&& det->getDetectorType().squash(defs::GENERIC) != defs::XILINX_CHIPTESTBOARD
message: cmd + " only allowed for CTB."
function: getSignalIndex
input:
@ -9723,7 +9782,7 @@ signalindex:
store_result_in_t: true
command_name: signalindex
function_alias: signalindex
help: "[name] \n\t\t[ChipTestBoard] Get the signal index for the given name."
help: "[name] \n\t\t[Ctb][Xilinx_Ctb] Get the signal index for the given name."
infer_action: true
template: true
signallist:
@ -9736,8 +9795,13 @@ signallist:
check_det_id: true
convert_det_id: true
exceptions:
- condition: cmd != "daclist" && det->getDetectorType().squash() != defs::CHIPTESTBOARD
- condition: cmd != "daclist" && det_type != defs::CHIPTESTBOARD && det_type
!= defs::XILINX_CHIPTESTBOARD
message: cmd + " only allowed for CTB."
extra_variables:
- name: det_type
type: auto
value: det->getDetectorType().squash(defs::GENERIC);
function: getSignalNames
input: []
input_types: []
@ -9755,10 +9819,16 @@ signallist:
check_det_id: true
convert_det_id: true
exceptions:
- condition: cmd != "daclist" && det->getDetectorType().squash() != defs::CHIPTESTBOARD
- condition: cmd != "daclist" && det_type != defs::CHIPTESTBOARD && det_type
!= defs::XILINX_CHIPTESTBOARD
message: cmd + " only allowed for CTB."
- condition: cmd == "daclist" && det->getDetectorType().squash() != defs::CHIPTESTBOARD
- condition: cmd == "daclist" && det_type != defs::CHIPTESTBOARD && det_type
!= defs::XILINX_CHIPTESTBOARD
message: '"This detector already has fixed dac names. Cannot change them."'
extra_variables:
- name: det_type
type: auto
value: det->getDetectorType().squash(defs::GENERIC);
function: setSignalNames
input:
- args
@ -9770,8 +9840,8 @@ signallist:
store_result_in_t: false
command_name: signallist
function_alias: signallist
help: "[signalname1 signalname2 .. signalname63] \n\t\t[ChipTestBoard] Set the list\
\ of signal names for this board."
help: "[signalname1 signalname2 .. signalname63] \n\t\t[Ctb][Xilinx_Ctb] Set the\
\ list of signal names for this board."
infer_action: true
template: true
signalname:
@ -9786,7 +9856,8 @@ signalname:
check_det_id: true
convert_det_id: true
exceptions:
- condition: det->getDetectorType().squash() != defs::CHIPTESTBOARD
- condition: det->getDetectorType().squash(defs::GENERIC) != defs::CHIPTESTBOARD
&& det->getDetectorType().squash(defs::GENERIC) != defs::XILINX_CHIPTESTBOARD
message: cmd + " only allowed for CTB."
function: getSignalName
input:
@ -9811,7 +9882,8 @@ signalname:
check_det_id: true
convert_det_id: true
exceptions:
- condition: det->getDetectorType().squash() != defs::CHIPTESTBOARD
- condition: det->getDetectorType().squash(defs::GENERIC) != defs::CHIPTESTBOARD
&& det->getDetectorType().squash(defs::GENERIC) != defs::XILINX_CHIPTESTBOARD
message: cmd + " only allowed for CTB."
function: setSignalName
input:
@ -9826,8 +9898,8 @@ signalname:
store_result_in_t: false
command_name: signalname
function_alias: signalname
help: "[0-63][name] \n\t\t[ChipTestBoard] Set the signal at the given position to\
\ the given name."
help: "[0-63][name] \n\t\t[Ctb][Xilinx_Ctb] Set the signal at the given position\
\ to the given name."
infer_action: true
template: true
slowadc:
@ -9863,7 +9935,8 @@ slowadcindex:
check_det_id: true
convert_det_id: true
exceptions:
- condition: det->getDetectorType().squash() != defs::CHIPTESTBOARD
- condition: det->getDetectorType().squash(defs::GENERIC) != defs::CHIPTESTBOARD
&& det->getDetectorType().squash(defs::GENERIC) != defs::XILINX_CHIPTESTBOARD
message: cmd + " only allowed for CTB."
extra_variables:
- name: index
@ -9880,7 +9953,7 @@ slowadcindex:
store_result_in_t: true
command_name: slowadcindex
function_alias: slowadcindex
help: "[name] \n\t\t[ChipTestBoard] Get the slowadc index for the given name."
help: "[name] \n\t\t[Ctb][Xilinx_Ctb] Get the slowadc index for the given name."
infer_action: true
template: true
slowadclist:
@ -9893,8 +9966,13 @@ slowadclist:
check_det_id: true
convert_det_id: true
exceptions:
- condition: cmd != "daclist" && det->getDetectorType().squash() != defs::CHIPTESTBOARD
- condition: cmd != "daclist" && det_type != defs::CHIPTESTBOARD && det_type
!= defs::XILINX_CHIPTESTBOARD
message: cmd + " only allowed for CTB."
extra_variables:
- name: det_type
type: auto
value: det->getDetectorType().squash(defs::GENERIC);
function: getSlowADCNames
input: []
input_types: []
@ -9912,10 +9990,16 @@ slowadclist:
check_det_id: true
convert_det_id: true
exceptions:
- condition: cmd != "daclist" && det->getDetectorType().squash() != defs::CHIPTESTBOARD
- condition: cmd != "daclist" && det_type != defs::CHIPTESTBOARD && det_type
!= defs::XILINX_CHIPTESTBOARD
message: cmd + " only allowed for CTB."
- condition: cmd == "daclist" && det->getDetectorType().squash() != defs::CHIPTESTBOARD
- condition: cmd == "daclist" && det_type != defs::CHIPTESTBOARD && det_type
!= defs::XILINX_CHIPTESTBOARD
message: '"This detector already has fixed dac names. Cannot change them."'
extra_variables:
- name: det_type
type: auto
value: det->getDetectorType().squash(defs::GENERIC);
function: setSlowADCNames
input:
- args
@ -9927,7 +10011,7 @@ slowadclist:
store_result_in_t: false
command_name: slowadclist
function_alias: slowadclist
help: "[slowadcname1 slowadcname2 .. slowadcname7] \n\t\t[ChipTestBoard] Set the\
help: "[slowadcname1 slowadcname2 .. slowadcname7] \n\t\t[Ctb][Xilinx_Ctb] Set the\
\ list of slowadc names for this board."
infer_action: true
template: true
@ -9943,7 +10027,8 @@ slowadcname:
check_det_id: true
convert_det_id: true
exceptions:
- condition: det->getDetectorType().squash() != defs::CHIPTESTBOARD
- condition: det->getDetectorType().squash(defs::GENERIC) != defs::CHIPTESTBOARD
&& det->getDetectorType().squash(defs::GENERIC) != defs::XILINX_CHIPTESTBOARD
message: cmd + " only allowed for CTB."
extra_variables:
- name: index
@ -9972,7 +10057,8 @@ slowadcname:
check_det_id: true
convert_det_id: true
exceptions:
- condition: det->getDetectorType().squash() != defs::CHIPTESTBOARD
- condition: det->getDetectorType().squash(defs::GENERIC) != defs::CHIPTESTBOARD
&& det->getDetectorType().squash(defs::GENERIC) != defs::XILINX_CHIPTESTBOARD
message: cmd + " only allowed for CTB."
extra_variables:
- name: index
@ -9991,8 +10077,8 @@ slowadcname:
store_result_in_t: false
command_name: slowadcname
function_alias: slowadcname
help: "[0-7][name] \n\t\t[ChipTestBoard] Set the slowadc at the given position to\
\ the given name."
help: "[0-7][name] \n\t\t[Ctb][Xilinx_Ctb] Set the slowadc at the given position\
\ to the given name."
infer_action: true
template: true
slowadcvalues:
@ -10018,7 +10104,7 @@ slowadcvalues:
store_result_in_t: true
command_name: slowadcvalues
function_alias: slowadcvalues
help: "[name] \n\t\t[ChipTestBoard] Get values of all slow adcs."
help: "[name] \n\t\t[Ctb][Xilinx_Ctb] Get values of all slow adcs."
infer_action: true
start:
actions:
@ -11373,7 +11459,7 @@ triggersl:
store_result_in_t: true
command_name: 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] Number of triggers\
\ left in acquisition. Only when external trigger used."
infer_action: true
template: true
@ -11530,7 +11616,7 @@ tsamples:
store_result_in_t: false
command_name: tsamples
function_alias: tsamples
help: "[n_value]\n\t[CTB] Number of transceiver samples expected."
help: "[n_value]\n\t[Ctb] Number of transceiver samples expected."
infer_action: true
template: true
txdelay:
@ -11720,7 +11806,7 @@ type:
command_name: type
function_alias: type
help: "\n\tReturns detector type. Can be Eiger, Jungfrau, Gotthard, Moench, Mythen3,\
\ Gotthard2, ChipTestBoard"
\ Gotthard2, ChipTestBoard, Xilinx_ChipTestBoard"
infer_action: true
template: true
udp_cleardst:
@ -12327,7 +12413,7 @@ update:
command_name: update
function_alias: update
help: "\n\tWithout tftp: [server_name (incl fullpath)] [fname.pof (incl full path)]\
\ This does not use tftp.\n\t\t[Jungfrau][Moench][Gotthard][CTB] Updates the firmware,\
\ This does not use tftp.\n\t\t[Jungfrau][Moench][Gotthard][Ctb] Updates the firmware,\
\ detector server, deletes old server, creates the symbolic link and then reboots\
\ detector controller. \n\t\t[Mythen3][Gotthard2] will require a script to start\
\ up the shorter named server link at start up. \n\t\tserver_name is full path\

View File

@ -98,7 +98,7 @@ class Detector {
Result<std::string> getReceiverVersion(Positions pos = {}) const;
/** Options: EIGER, JUNGFRAU, GOTTHARD, MOENCH, MYTHEN3, GOTTHARD2,
* CHIPTESTBOARD */
* CHIPTESTBOARD, XILINX_CHIPTESTBOARD */
Result<defs::detectorType> getDetectorType(Positions pos = {}) const;
/** Gets the total number of modules in shared memory */

View File

@ -264,7 +264,7 @@ std::string Caller::adcindex(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: adcindex" << std::endl;
os << R"V0G0N([name]
[ChipTestBoard] Get the adc index for the given name. )V0G0N"
[Ctb][Xilinx_Ctb] Get the adc index for the given name. )V0G0N"
<< std::endl;
return os.str();
}
@ -289,7 +289,10 @@ std::string Caller::adcindex(int action) {
// generate code for each action
if (action == slsDetectorDefs::GET_ACTION) {
if (args.size() == 1) {
if (det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
if (det->getDetectorType().squash(defs::GENERIC) !=
defs::CHIPTESTBOARD &&
det->getDetectorType().squash(defs::GENERIC) !=
defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError(cmd + " only allowed for CTB.");
}
if (det_id != -1) {
@ -374,7 +377,7 @@ std::string Caller::adclist(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: adclist" << std::endl;
os << R"V0G0N([adcname1 adcname2 .. adcname32]
[ChipTestBoard] Set the list of adc names for this board. )V0G0N"
[Ctb][Xilinx_Ctb] Set the list of adc names for this board. )V0G0N"
<< std::endl;
return os.str();
}
@ -386,6 +389,8 @@ std::string Caller::adclist(int action) {
}
if (args.size() == 0) {
auto det_type = det->getDetectorType().squash(defs::GENERIC);
;
}
}
@ -406,8 +411,10 @@ std::string Caller::adclist(int action) {
// generate code for each action
if (action == slsDetectorDefs::GET_ACTION) {
if (args.size() == 0) {
if (cmd != "daclist" &&
det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
auto det_type = det->getDetectorType().squash(defs::GENERIC);
;
if (cmd != "daclist" && det_type != defs::CHIPTESTBOARD &&
det_type != defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError(cmd + " only allowed for CTB.");
}
if (det_id != -1) {
@ -419,12 +426,14 @@ std::string Caller::adclist(int action) {
}
if (action == slsDetectorDefs::PUT_ACTION) {
if (cmd != "daclist" &&
det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
auto det_type = det->getDetectorType().squash(defs::GENERIC);
;
if (cmd != "daclist" && det_type != defs::CHIPTESTBOARD &&
det_type != defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError(cmd + " only allowed for CTB.");
}
if (cmd == "daclist" &&
det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
if (cmd == "daclist" && det_type != defs::CHIPTESTBOARD &&
det_type != defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError("This detector already has fixed dac names. "
"Cannot change them.");
}
@ -445,7 +454,7 @@ std::string Caller::adcname(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: adcname" << std::endl;
os << R"V0G0N([0-31][name]
[ChipTestBoard] Set the adc at the given position to the given name. )V0G0N"
[Ctb][Xilinx_Ctb] Set the adc at the given position to the given name. )V0G0N"
<< std::endl;
return os.str();
}
@ -490,7 +499,10 @@ std::string Caller::adcname(int action) {
// generate code for each action
if (action == slsDetectorDefs::GET_ACTION) {
if (args.size() == 1) {
if (det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
if (det->getDetectorType().squash(defs::GENERIC) !=
defs::CHIPTESTBOARD &&
det->getDetectorType().squash(defs::GENERIC) !=
defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError(cmd + " only allowed for CTB.");
}
if (det_id != -1) {
@ -504,7 +516,10 @@ std::string Caller::adcname(int action) {
if (action == slsDetectorDefs::PUT_ACTION) {
if (args.size() == 2) {
if (det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
if (det->getDetectorType().squash(defs::GENERIC) !=
defs::CHIPTESTBOARD &&
det->getDetectorType().squash(defs::GENERIC) !=
defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError(cmd + " only allowed for CTB.");
}
if (det_id != -1) {
@ -955,7 +970,7 @@ std::string Caller::asamples(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: asamples" << std::endl;
os << R"V0G0N([n_samples]
[CTB] Number of analog samples expected. )V0G0N"
[Ctb] Number of analog samples expected. )V0G0N"
<< std::endl;
return os.str();
}
@ -2248,7 +2263,9 @@ std::string Caller::dac(int action) {
if (args.size() == 1) {
defs::dacIndex dacIndex =
(det->getDetectorType().squash() == defs::CHIPTESTBOARD &&
((det->getDetectorType().squash() == defs::CHIPTESTBOARD ||
det->getDetectorType().squash() ==
defs::XILINX_CHIPTESTBOARD) &&
!is_int(args[0]))
? det->getDacIndex(args[0])
: StringTo<defs::dacIndex>(args[0]);
@ -2261,7 +2278,9 @@ std::string Caller::dac(int action) {
if (args.size() == 2) {
defs::dacIndex dacIndex =
(det->getDetectorType().squash() == defs::CHIPTESTBOARD &&
((det->getDetectorType().squash() == defs::CHIPTESTBOARD ||
det->getDetectorType().squash() ==
defs::XILINX_CHIPTESTBOARD) &&
!is_int(args[0]))
? det->getDacIndex(args[0])
: StringTo<defs::dacIndex>(args[0]);
@ -2281,7 +2300,9 @@ std::string Caller::dac(int action) {
if (args.size() == 2) {
defs::dacIndex dacIndex =
(det->getDetectorType().squash() == defs::CHIPTESTBOARD &&
((det->getDetectorType().squash() == defs::CHIPTESTBOARD ||
det->getDetectorType().squash() ==
defs::XILINX_CHIPTESTBOARD) &&
!is_int(args[0]))
? det->getDacIndex(args[0])
: StringTo<defs::dacIndex>(args[0]);
@ -2299,7 +2320,9 @@ std::string Caller::dac(int action) {
if (args.size() == 3) {
defs::dacIndex dacIndex =
(det->getDetectorType().squash() == defs::CHIPTESTBOARD &&
((det->getDetectorType().squash() == defs::CHIPTESTBOARD ||
det->getDetectorType().squash() ==
defs::XILINX_CHIPTESTBOARD) &&
!is_int(args[0]))
? det->getDacIndex(args[0])
: StringTo<defs::dacIndex>(args[0]);
@ -2327,12 +2350,15 @@ std::string Caller::dac(int action) {
if (action == slsDetectorDefs::GET_ACTION) {
if (args.size() == 1) {
defs::dacIndex dacIndex =
(det->getDetectorType().squash() == defs::CHIPTESTBOARD &&
((det->getDetectorType().squash() == defs::CHIPTESTBOARD ||
det->getDetectorType().squash() ==
defs::XILINX_CHIPTESTBOARD) &&
!is_int(args[0]))
? det->getDacIndex(args[0])
: StringTo<defs::dacIndex>(args[0]);
if (is_int(args[0]) &&
det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
det->getDetectorType().squash() != defs::CHIPTESTBOARD &&
det->getDetectorType().squash() != defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError(
"Dac indices can only be used for chip test board. Use "
"daclist to get list of dac names for current detector.");
@ -2344,12 +2370,15 @@ std::string Caller::dac(int action) {
if (args.size() == 2) {
defs::dacIndex dacIndex =
(det->getDetectorType().squash() == defs::CHIPTESTBOARD &&
((det->getDetectorType().squash() == defs::CHIPTESTBOARD ||
det->getDetectorType().squash() ==
defs::XILINX_CHIPTESTBOARD) &&
!is_int(args[0]))
? det->getDacIndex(args[0])
: StringTo<defs::dacIndex>(args[0]);
if (is_int(args[0]) &&
det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
det->getDetectorType().squash() != defs::CHIPTESTBOARD &&
det->getDetectorType().squash() != defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError(
"Dac indices can only be used for chip test board. Use "
"daclist to get list of dac names for current detector.");
@ -2367,12 +2396,15 @@ std::string Caller::dac(int action) {
if (action == slsDetectorDefs::PUT_ACTION) {
if (args.size() == 2) {
defs::dacIndex dacIndex =
(det->getDetectorType().squash() == defs::CHIPTESTBOARD &&
((det->getDetectorType().squash() == defs::CHIPTESTBOARD ||
det->getDetectorType().squash() ==
defs::XILINX_CHIPTESTBOARD) &&
!is_int(args[0]))
? det->getDacIndex(args[0])
: StringTo<defs::dacIndex>(args[0]);
if (is_int(args[0]) &&
det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
det->getDetectorType().squash() != defs::CHIPTESTBOARD &&
det->getDetectorType().squash() != defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError(
"Dac indices can only be used for chip test board. Use "
"daclist to get list of dac names for current detector.");
@ -2385,12 +2417,15 @@ std::string Caller::dac(int action) {
if (args.size() == 3) {
defs::dacIndex dacIndex =
(det->getDetectorType().squash() == defs::CHIPTESTBOARD &&
((det->getDetectorType().squash() == defs::CHIPTESTBOARD ||
det->getDetectorType().squash() ==
defs::XILINX_CHIPTESTBOARD) &&
!is_int(args[0]))
? det->getDacIndex(args[0])
: StringTo<defs::dacIndex>(args[0]);
if (is_int(args[0]) &&
det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
det->getDetectorType().squash() != defs::CHIPTESTBOARD &&
det->getDetectorType().squash() != defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError(
"Dac indices can only be used for chip test board. Use "
"daclist to get list of dac names for current detector.");
@ -2412,7 +2447,7 @@ std::string Caller::dacindex(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: dacindex" << std::endl;
os << R"V0G0N([name]
[ChipTestBoard] Get the dac index for the given name. )V0G0N"
[Ctb][Xilinx_Ctb] Get the dac index for the given name. )V0G0N"
<< std::endl;
return os.str();
}
@ -2439,7 +2474,10 @@ std::string Caller::dacindex(int action) {
if (action == slsDetectorDefs::GET_ACTION) {
if (args.size() == 1) {
defs::dacIndex index = defs::DAC_0;
if (det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
if (det->getDetectorType().squash(defs::GENERIC) !=
defs::CHIPTESTBOARD &&
det->getDetectorType().squash(defs::GENERIC) !=
defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError(cmd + " only allowed for CTB.");
}
if (det_id != -1) {
@ -2460,7 +2498,7 @@ std::string Caller::daclist(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: daclist" << std::endl;
os << R"V0G0N([dacname1 dacname2 .. dacname18]
[ChipTestBoard] Set the list of dac names for this detector.
[Ctb][Xilinx_Ctb] Set the list of dac names for this detector.
[All] Gets the list of dac names for every dac for this detector. )V0G0N"
<< std::endl;
return os.str();
@ -2473,6 +2511,8 @@ std::string Caller::daclist(int action) {
}
if (args.size() == 0) {
auto det_type = det->getDetectorType().squash(defs::GENERIC);
;
}
}
@ -2493,8 +2533,10 @@ std::string Caller::daclist(int action) {
// generate code for each action
if (action == slsDetectorDefs::GET_ACTION) {
if (args.size() == 0) {
if (cmd != "daclist" &&
det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
auto det_type = det->getDetectorType().squash(defs::GENERIC);
;
if (cmd != "daclist" && det_type != defs::CHIPTESTBOARD &&
det_type != defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError(cmd + " only allowed for CTB.");
}
if (det_id != -1) {
@ -2506,12 +2548,14 @@ std::string Caller::daclist(int action) {
}
if (action == slsDetectorDefs::PUT_ACTION) {
if (cmd != "daclist" &&
det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
auto det_type = det->getDetectorType().squash(defs::GENERIC);
;
if (cmd != "daclist" && det_type != defs::CHIPTESTBOARD &&
det_type != defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError(cmd + " only allowed for CTB.");
}
if (cmd == "daclist" &&
det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
if (cmd == "daclist" && det_type != defs::CHIPTESTBOARD &&
det_type != defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError("This detector already has fixed dac names. "
"Cannot change them.");
}
@ -2532,7 +2576,7 @@ std::string Caller::dacname(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: dacname" << std::endl;
os << R"V0G0N([0-17][name]
[ChipTestBoard] Set the dac at the given position to the given name. )V0G0N"
[Ctb][Xilinx_Ctb] Set the dac at the given position to the given name. )V0G0N"
<< std::endl;
return os.str();
}
@ -2570,7 +2614,10 @@ std::string Caller::dacname(int action) {
if (action == slsDetectorDefs::GET_ACTION) {
if (args.size() == 1) {
defs::dacIndex index = defs::DAC_0;
if (det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
if (det->getDetectorType().squash(defs::GENERIC) !=
defs::CHIPTESTBOARD &&
det->getDetectorType().squash(defs::GENERIC) !=
defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError(cmd + " only allowed for CTB.");
}
if (det_id != -1) {
@ -2585,7 +2632,10 @@ std::string Caller::dacname(int action) {
if (action == slsDetectorDefs::PUT_ACTION) {
if (args.size() == 2) {
defs::dacIndex index = defs::DAC_0;
if (det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
if (det->getDetectorType().squash(defs::GENERIC) !=
defs::CHIPTESTBOARD &&
det->getDetectorType().squash(defs::GENERIC) !=
defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError(cmd + " only allowed for CTB.");
}
if (det_id != -1) {
@ -2880,7 +2930,7 @@ std::string Caller::dbitpipeline(int action) {
os << R"V0G0N([n_value]
[Ctb][Gotthard2] Pipeline of the clock for latching digital bits.
[Gotthard2] Options: 0-7
[CTB] Options: 0-255 )V0G0N"
[Ctb] Options: 0-255 )V0G0N"
<< std::endl;
return os.str();
}
@ -3200,7 +3250,7 @@ std::string Caller::delayl(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: delayl" << std::endl;
os << R"V0G0N(
[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][CTB] Delay Left in Acquisition.
[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Delay Left in Acquisition.
[Gotthard2] only in continuous mode. )V0G0N"
<< std::endl;
return os.str();
@ -3572,7 +3622,7 @@ std::string Caller::dsamples(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: dsamples" << std::endl;
os << R"V0G0N([n_value]
[CTB] Number of digital samples expected. )V0G0N"
[Ctb] Number of digital samples expected. )V0G0N"
<< std::endl;
return os.str();
}
@ -5082,7 +5132,7 @@ std::string Caller::framecounter(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: framecounter" << std::endl;
os << R"V0G0N(
[Jungfrau][Moench][Mythen3][Gotthard2][CTB] Number of frames from start run control.
[Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Number of frames from start run control.
[Gotthard2] only in continuous mode. )V0G0N"
<< std::endl;
return os.str();
@ -5192,7 +5242,7 @@ std::string Caller::framesl(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: framesl" << std::endl;
os << R"V0G0N(
[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][CTB] Number of frames left in acquisition.
[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Number of frames left in acquisition.
[Gotthard2] only in continuous auto mode. )V0G0N"
<< std::endl;
return os.str();
@ -5233,7 +5283,7 @@ std::string Caller::frametime(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: frametime" << std::endl;
os << R"V0G0N([(optional unit) ns|us|ms|s]
[Jungfrau][Moench][Mythen3][Gotthard2][CTB] Timestamp at a frame start.
[Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Timestamp at a frame start.
[Gotthard2] not in burst and auto mode. )V0G0N"
<< std::endl;
return os.str();
@ -6902,7 +6952,7 @@ std::string Caller::maxadcphaseshift(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: maxadcphaseshift" << std::endl;
os << R"V0G0N(
[Jungfrau][Moench][CTB] Absolute maximum Phase shift of ADC clock. )V0G0N"
[Jungfrau][Moench][Ctb] Absolute maximum Phase shift of ADC clock. )V0G0N"
<< std::endl;
return os.str();
}
@ -6998,7 +7048,7 @@ std::string Caller::maxdbitphaseshift(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: maxdbitphaseshift" << std::endl;
os << R"V0G0N(
[CTB][Jungfrau] Absolute maximum Phase shift of of the clock to latch digital bits. )V0G0N"
[Ctb][Jungfrau] Absolute maximum Phase shift of of the clock to latch digital bits. )V0G0N"
<< std::endl;
return os.str();
}
@ -7174,7 +7224,7 @@ std::string Caller::nextframenumber(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: nextframenumber" << std::endl;
os << R"V0G0N([n_value]
[Eiger][Jungfrau][Moench][CTB] Next frame number. Stopping acquisition might result in different frame numbers for different modules. )V0G0N"
[Eiger][Jungfrau][Moench][Ctb] Next frame number. Stopping acquisition might result in different frame numbers for different modules. )V0G0N"
<< std::endl;
return os.str();
}
@ -9091,7 +9141,7 @@ std::string Caller::periodl(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: periodl" << std::endl;
os << R"V0G0N(
[Gotthard][Jungfrau][Moench][CTB][Mythen3][Gotthard2] Period left for current frame.
[Gotthard][Jungfrau][Moench][Ctb][Mythen3][Gotthard2] Period left for current frame.
[Gotthard2] only in continuous mode. )V0G0N"
<< std::endl;
return os.str();
@ -9332,7 +9382,7 @@ std::string Caller::powerindex(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: powerindex" << std::endl;
os << R"V0G0N([name]
[ChipTestBoard] Get the power index for the given name. )V0G0N"
[Ctb][Xilinx_Ctb] Get the power index for the given name. )V0G0N"
<< std::endl;
return os.str();
}
@ -9359,7 +9409,10 @@ std::string Caller::powerindex(int action) {
if (action == slsDetectorDefs::GET_ACTION) {
if (args.size() == 1) {
defs::dacIndex index = defs::V_POWER_A;
if (det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
if (det->getDetectorType().squash(defs::GENERIC) !=
defs::CHIPTESTBOARD &&
det->getDetectorType().squash(defs::GENERIC) !=
defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError(cmd + " only allowed for CTB.");
}
if (det_id != -1) {
@ -9380,7 +9433,7 @@ std::string Caller::powerlist(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: powerlist" << std::endl;
os << R"V0G0N([powername1 powername2 .. powername4]
[ChipTestBoard] Set the list of power names for this board. )V0G0N"
[Ctb][Xilinx_Ctb] Set the list of power names for this board. )V0G0N"
<< std::endl;
return os.str();
}
@ -9392,6 +9445,8 @@ std::string Caller::powerlist(int action) {
}
if (args.size() == 0) {
auto det_type = det->getDetectorType().squash(defs::GENERIC);
;
}
}
@ -9412,8 +9467,10 @@ std::string Caller::powerlist(int action) {
// generate code for each action
if (action == slsDetectorDefs::GET_ACTION) {
if (args.size() == 0) {
if (cmd != "daclist" &&
det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
auto det_type = det->getDetectorType().squash(defs::GENERIC);
;
if (cmd != "daclist" && det_type != defs::CHIPTESTBOARD &&
det_type != defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError(cmd + " only allowed for CTB.");
}
if (det_id != -1) {
@ -9425,12 +9482,14 @@ std::string Caller::powerlist(int action) {
}
if (action == slsDetectorDefs::PUT_ACTION) {
if (cmd != "daclist" &&
det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
auto det_type = det->getDetectorType().squash(defs::GENERIC);
;
if (cmd != "daclist" && det_type != defs::CHIPTESTBOARD &&
det_type != defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError(cmd + " only allowed for CTB.");
}
if (cmd == "daclist" &&
det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
if (cmd == "daclist" && det_type != defs::CHIPTESTBOARD &&
det_type != defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError("This detector already has fixed dac names. "
"Cannot change them.");
}
@ -9451,7 +9510,7 @@ std::string Caller::powername(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: powername" << std::endl;
os << R"V0G0N([0-4][name]
[ChipTestBoard] Set the power at the given position to the given name. )V0G0N"
[Ctb][Xilinx_Ctb] Set the power at the given position to the given name. )V0G0N"
<< std::endl;
return os.str();
}
@ -9489,7 +9548,10 @@ std::string Caller::powername(int action) {
if (action == slsDetectorDefs::GET_ACTION) {
if (args.size() == 1) {
defs::dacIndex index = defs::V_POWER_A;
if (det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
if (det->getDetectorType().squash(defs::GENERIC) !=
defs::CHIPTESTBOARD &&
det->getDetectorType().squash(defs::GENERIC) !=
defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError(cmd + " only allowed for CTB.");
}
if (det_id != -1) {
@ -9504,7 +9566,10 @@ std::string Caller::powername(int action) {
if (action == slsDetectorDefs::PUT_ACTION) {
if (args.size() == 2) {
defs::dacIndex index = defs::V_POWER_A;
if (det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
if (det->getDetectorType().squash(defs::GENERIC) !=
defs::CHIPTESTBOARD &&
det->getDetectorType().squash(defs::GENERIC) !=
defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError(cmd + " only allowed for CTB.");
}
if (det_id != -1) {
@ -9527,7 +9592,7 @@ std::string Caller::powervalues(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: powervalues" << std::endl;
os << R"V0G0N([name]
[ChipTestBoard] Get values of all powers. )V0G0N"
[Ctb][Xilinx_Ctb] Get values of all powers. )V0G0N"
<< std::endl;
return os.str();
}
@ -10055,6 +10120,8 @@ std::string Caller::readoutspeed(int action) {
}
if (args.size() == 0) {
auto det_type = det->getDetectorType().squash(defs::GENERIC);
;
}
}
@ -10065,6 +10132,8 @@ std::string Caller::readoutspeed(int action) {
}
if (args.size() == 1) {
auto det_type = det->getDetectorType().squash(defs::GENERIC);
;
try {
StringTo<defs::speedLevel>(args[0]);
} catch (...) {
@ -10084,7 +10153,10 @@ std::string Caller::readoutspeed(int action) {
// generate code for each action
if (action == slsDetectorDefs::GET_ACTION) {
if (args.size() == 0) {
if (det->getDetectorType().squash() == defs::CHIPTESTBOARD) {
auto det_type = det->getDetectorType().squash(defs::GENERIC);
;
if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError(
"ReadoutSpeed not implemented. Did you mean runclk?");
}
@ -10095,7 +10167,10 @@ std::string Caller::readoutspeed(int action) {
if (action == slsDetectorDefs::PUT_ACTION) {
if (args.size() == 1) {
if (det->getDetectorType().squash() == defs::CHIPTESTBOARD) {
auto det_type = det->getDetectorType().squash(defs::GENERIC);
;
if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError(
"ReadoutSpeed not implemented. Did you mean runclk?");
}
@ -10430,7 +10505,7 @@ std::string Caller::romode(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: romode" << std::endl;
os << R"V0G0N([analog|digital|analog_digital|transceiver|digital_transceiver]
[CTB] Readout mode. Default is analog. )V0G0N"
[Ctb] Readout mode. Default is analog. )V0G0N"
<< std::endl;
return os.str();
}
@ -10621,7 +10696,7 @@ std::string Caller::runtime(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: runtime" << std::endl;
os << R"V0G0N([(optional unit) ns|us|ms|s]
[Jungfrau][Moench][Mythen3][Gotthard2][CTB] Time from detector start up.
[Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Time from detector start up.
[Gotthard2] not in burst and auto mode. )V0G0N"
<< std::endl;
return os.str();
@ -12504,7 +12579,7 @@ std::string Caller::serialnumber(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: serialnumber" << std::endl;
os << R"V0G0N(
[Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][CTB]
[Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][Ctb]
Serial number of detector. )V0G0N"
<< std::endl;
return os.str();
@ -12769,7 +12844,7 @@ std::string Caller::signalindex(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: signalindex" << std::endl;
os << R"V0G0N([name]
[ChipTestBoard] Get the signal index for the given name. )V0G0N"
[Ctb][Xilinx_Ctb] Get the signal index for the given name. )V0G0N"
<< std::endl;
return os.str();
}
@ -12794,7 +12869,10 @@ std::string Caller::signalindex(int action) {
// generate code for each action
if (action == slsDetectorDefs::GET_ACTION) {
if (args.size() == 1) {
if (det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
if (det->getDetectorType().squash(defs::GENERIC) !=
defs::CHIPTESTBOARD &&
det->getDetectorType().squash(defs::GENERIC) !=
defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError(cmd + " only allowed for CTB.");
}
if (det_id != -1) {
@ -12816,7 +12894,7 @@ std::string Caller::signallist(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: signallist" << std::endl;
os << R"V0G0N([signalname1 signalname2 .. signalname63]
[ChipTestBoard] Set the list of signal names for this board. )V0G0N"
[Ctb][Xilinx_Ctb] Set the list of signal names for this board. )V0G0N"
<< std::endl;
return os.str();
}
@ -12828,6 +12906,8 @@ std::string Caller::signallist(int action) {
}
if (args.size() == 0) {
auto det_type = det->getDetectorType().squash(defs::GENERIC);
;
}
}
@ -12848,8 +12928,10 @@ std::string Caller::signallist(int action) {
// generate code for each action
if (action == slsDetectorDefs::GET_ACTION) {
if (args.size() == 0) {
if (cmd != "daclist" &&
det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
auto det_type = det->getDetectorType().squash(defs::GENERIC);
;
if (cmd != "daclist" && det_type != defs::CHIPTESTBOARD &&
det_type != defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError(cmd + " only allowed for CTB.");
}
if (det_id != -1) {
@ -12861,12 +12943,14 @@ std::string Caller::signallist(int action) {
}
if (action == slsDetectorDefs::PUT_ACTION) {
if (cmd != "daclist" &&
det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
auto det_type = det->getDetectorType().squash(defs::GENERIC);
;
if (cmd != "daclist" && det_type != defs::CHIPTESTBOARD &&
det_type != defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError(cmd + " only allowed for CTB.");
}
if (cmd == "daclist" &&
det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
if (cmd == "daclist" && det_type != defs::CHIPTESTBOARD &&
det_type != defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError("This detector already has fixed dac names. "
"Cannot change them.");
}
@ -12887,7 +12971,7 @@ std::string Caller::signalname(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: signalname" << std::endl;
os << R"V0G0N([0-63][name]
[ChipTestBoard] Set the signal at the given position to the given name. )V0G0N"
[Ctb][Xilinx_Ctb] Set the signal at the given position to the given name. )V0G0N"
<< std::endl;
return os.str();
}
@ -12932,7 +13016,10 @@ std::string Caller::signalname(int action) {
// generate code for each action
if (action == slsDetectorDefs::GET_ACTION) {
if (args.size() == 1) {
if (det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
if (det->getDetectorType().squash(defs::GENERIC) !=
defs::CHIPTESTBOARD &&
det->getDetectorType().squash(defs::GENERIC) !=
defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError(cmd + " only allowed for CTB.");
}
if (det_id != -1) {
@ -12946,7 +13033,10 @@ std::string Caller::signalname(int action) {
if (action == slsDetectorDefs::PUT_ACTION) {
if (args.size() == 2) {
if (det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
if (det->getDetectorType().squash(defs::GENERIC) !=
defs::CHIPTESTBOARD &&
det->getDetectorType().squash(defs::GENERIC) !=
defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError(cmd + " only allowed for CTB.");
}
if (det_id != -1) {
@ -12968,7 +13058,7 @@ std::string Caller::slowadcindex(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: slowadcindex" << std::endl;
os << R"V0G0N([name]
[ChipTestBoard] Get the slowadc index for the given name. )V0G0N"
[Ctb][Xilinx_Ctb] Get the slowadc index for the given name. )V0G0N"
<< std::endl;
return os.str();
}
@ -12995,7 +13085,10 @@ std::string Caller::slowadcindex(int action) {
if (action == slsDetectorDefs::GET_ACTION) {
if (args.size() == 1) {
defs::dacIndex index = defs::SLOW_ADC0;
if (det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
if (det->getDetectorType().squash(defs::GENERIC) !=
defs::CHIPTESTBOARD &&
det->getDetectorType().squash(defs::GENERIC) !=
defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError(cmd + " only allowed for CTB.");
}
if (det_id != -1) {
@ -13017,7 +13110,7 @@ std::string Caller::slowadclist(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: slowadclist" << std::endl;
os << R"V0G0N([slowadcname1 slowadcname2 .. slowadcname7]
[ChipTestBoard] Set the list of slowadc names for this board. )V0G0N"
[Ctb][Xilinx_Ctb] Set the list of slowadc names for this board. )V0G0N"
<< std::endl;
return os.str();
}
@ -13029,6 +13122,8 @@ std::string Caller::slowadclist(int action) {
}
if (args.size() == 0) {
auto det_type = det->getDetectorType().squash(defs::GENERIC);
;
}
}
@ -13049,8 +13144,10 @@ std::string Caller::slowadclist(int action) {
// generate code for each action
if (action == slsDetectorDefs::GET_ACTION) {
if (args.size() == 0) {
if (cmd != "daclist" &&
det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
auto det_type = det->getDetectorType().squash(defs::GENERIC);
;
if (cmd != "daclist" && det_type != defs::CHIPTESTBOARD &&
det_type != defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError(cmd + " only allowed for CTB.");
}
if (det_id != -1) {
@ -13063,12 +13160,14 @@ std::string Caller::slowadclist(int action) {
}
if (action == slsDetectorDefs::PUT_ACTION) {
if (cmd != "daclist" &&
det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
auto det_type = det->getDetectorType().squash(defs::GENERIC);
;
if (cmd != "daclist" && det_type != defs::CHIPTESTBOARD &&
det_type != defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError(cmd + " only allowed for CTB.");
}
if (cmd == "daclist" &&
det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
if (cmd == "daclist" && det_type != defs::CHIPTESTBOARD &&
det_type != defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError("This detector already has fixed dac names. "
"Cannot change them.");
}
@ -13089,7 +13188,7 @@ std::string Caller::slowadcname(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: slowadcname" << std::endl;
os << R"V0G0N([0-7][name]
[ChipTestBoard] Set the slowadc at the given position to the given name. )V0G0N"
[Ctb][Xilinx_Ctb] Set the slowadc at the given position to the given name. )V0G0N"
<< std::endl;
return os.str();
}
@ -13127,7 +13226,10 @@ std::string Caller::slowadcname(int action) {
if (action == slsDetectorDefs::GET_ACTION) {
if (args.size() == 1) {
defs::dacIndex index = defs::SLOW_ADC0;
if (det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
if (det->getDetectorType().squash(defs::GENERIC) !=
defs::CHIPTESTBOARD &&
det->getDetectorType().squash(defs::GENERIC) !=
defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError(cmd + " only allowed for CTB.");
}
if (det_id != -1) {
@ -13143,7 +13245,10 @@ std::string Caller::slowadcname(int action) {
if (action == slsDetectorDefs::PUT_ACTION) {
if (args.size() == 2) {
defs::dacIndex index = defs::SLOW_ADC0;
if (det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
if (det->getDetectorType().squash(defs::GENERIC) !=
defs::CHIPTESTBOARD &&
det->getDetectorType().squash(defs::GENERIC) !=
defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError(cmd + " only allowed for CTB.");
}
if (det_id != -1) {
@ -13167,7 +13272,7 @@ std::string Caller::slowadcvalues(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: slowadcvalues" << std::endl;
os << R"V0G0N([name]
[ChipTestBoard] Get values of all slow adcs. )V0G0N"
[Ctb][Xilinx_Ctb] Get values of all slow adcs. )V0G0N"
<< std::endl;
return os.str();
}
@ -15029,7 +15134,7 @@ std::string Caller::triggersl(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: triggersl" << std::endl;
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] Number of triggers left in acquisition. Only when external trigger used. )V0G0N"
<< std::endl;
return os.str();
}
@ -15189,7 +15294,7 @@ std::string Caller::tsamples(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: tsamples" << std::endl;
os << R"V0G0N([n_value]
[CTB] Number of transceiver samples expected. )V0G0N"
[Ctb] Number of transceiver samples expected. )V0G0N"
<< std::endl;
return os.str();
}
@ -15519,7 +15624,7 @@ std::string Caller::type(int action) {
if (action == slsDetectorDefs::HELP_ACTION) {
os << "Command: type" << std::endl;
os << R"V0G0N(
Returns detector type. Can be Eiger, Jungfrau, Gotthard, Moench, Mythen3, Gotthard2, ChipTestBoard )V0G0N"
Returns detector type. Can be Eiger, Jungfrau, Gotthard, Moench, Mythen3, Gotthard2, ChipTestBoard, Xilinx_ChipTestBoard )V0G0N"
<< std::endl;
return os.str();
}
@ -16227,7 +16332,7 @@ std::string Caller::update(int action) {
os << "Command: update" << std::endl;
os << R"V0G0N(
Without tftp: [server_name (incl fullpath)] [fname.pof (incl full path)] This does not use tftp.
[Jungfrau][Moench][Gotthard][CTB] Updates the firmware, detector server, deletes old server, creates the symbolic link and then reboots detector controller.
[Jungfrau][Moench][Gotthard][Ctb] Updates the firmware, detector server, deletes old server, creates the symbolic link and then reboots detector controller.
[Mythen3][Gotthard2] will require a script to start up the shorter named server link at start up.
server_name is full path name of detector server binary
fname is full path of programming file )V0G0N"

View File

@ -850,7 +850,8 @@ std::string Caller::counters(int action) {
std::string Caller::samples(int action) {
std::ostringstream os;
if (action == defs::HELP_ACTION) {
os << "[n_samples]\n\t[CTB] Number of samples (analog, digitial and "
os << "[n_samples]\n\t[Ctb][Xilinx_Ctb] Number of samples (analog, "
"digitial and "
"transceiver) expected.\n"
<< '\n';
} else if (action == defs::GET_ACTION) {
@ -859,7 +860,9 @@ std::string Caller::samples(int action) {
}
auto a = det->getNumberOfAnalogSamples(std::vector<int>{det_id});
// get also digital samples for ctb and compare with analog
if (det->getDetectorType().squash() == defs::CHIPTESTBOARD) {
auto det_type = det->getDetectorType().squash(defs::GENERIC);
if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD) {
auto d = det->getNumberOfDigitalSamples(std::vector<int>{det_id});
auto t =
det->getNumberOfTransceiverSamples(std::vector<int>{det_id});
@ -880,7 +883,9 @@ std::string Caller::samples(int action) {
det->setNumberOfAnalogSamples(StringTo<int>(args[0]),
std::vector<int>{det_id});
// set also digital samples for ctb
if (det->getDetectorType().squash() == defs::CHIPTESTBOARD) {
auto det_type = det->getDetectorType().squash(defs::GENERIC);
if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD) {
det->setNumberOfDigitalSamples(StringTo<int>(args[0]),
std::vector<int>{det_id});
det->setNumberOfTransceiverSamples(StringTo<int>(args[0]),

View File

@ -208,6 +208,7 @@ std::vector<defs::detectorSettings> Detector::getSettingsList() const {
defs::G2_LOWCAP_HIGHGAIN, defs::G2_LOWCAP_LOWGAIN,
defs::G4_HIGHGAIN, defs::G4_LOWGAIN};
case defs::CHIPTESTBOARD:
case defs::XILINX_CHIPTESTBOARD:
throw RuntimeError("Settings not implemented for this detector");
default:
throw RuntimeError("Unknown detector type");
@ -652,6 +653,7 @@ std::vector<defs::dacIndex> Detector::getTemperatureList() const {
std::vector<defs::dacIndex> retval;
switch (getDetectorType().squash()) {
case defs::CHIPTESTBOARD:
case defs::XILINX_CHIPTESTBOARD:
return std::vector<defs::dacIndex>{defs::SLOW_ADC_TEMP};
case defs::JUNGFRAU:
case defs::MOENCH:
@ -743,6 +745,7 @@ std::vector<defs::dacIndex> Detector::getDacList() const {
defs::VBP_COLBUF, defs::VIPRE, defs::VIN_CM, defs::VB_SDA,
defs::VCASC_SFP, defs::VOUT_CM, defs::VIPRE_CDS, defs::IBIAS_SFP};
case defs::CHIPTESTBOARD:
case defs::XILINX_CHIPTESTBOARD:
for (int i = 0; i != 18; ++i) {
retval.push_back(static_cast<defs::dacIndex>(i));
}
@ -905,7 +908,8 @@ void Detector::stopDetector(Positions pos) {
case defs::EIGER:
case defs::JUNGFRAU:
case defs::MOENCH:
case defs::CHIPTESTBOARD: {
case defs::CHIPTESTBOARD:
case defs::XILINX_CHIPTESTBOARD: {
auto res = getNextFrameNumber(pos);
if (!res.equal()) {
uint64_t maxVal = 0;
@ -2079,7 +2083,9 @@ Result<int> Detector::getSYNCClock(Positions pos) const {
}
std::vector<defs::dacIndex> Detector::getPowerList() const {
if (getDetectorType().squash() != defs::CHIPTESTBOARD) {
auto dettype = getDetectorType().squash();
if (dettype != defs::CHIPTESTBOARD &&
dettype != defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError("Power list not implemented for this detector");
}
return std::vector<defs::dacIndex>{defs::V_POWER_A, defs::V_POWER_B,
@ -2088,7 +2094,9 @@ std::vector<defs::dacIndex> Detector::getPowerList() const {
}
std::vector<defs::dacIndex> Detector::getSlowADCList() const {
if (getDetectorType().squash() != defs::CHIPTESTBOARD) {
auto dettype = getDetectorType().squash();
if (dettype != defs::CHIPTESTBOARD &&
dettype != defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError("Slow ADC list not implemented for this detector");
}
return std::vector<defs::dacIndex>{
@ -2277,7 +2285,8 @@ void Detector::setLEDEnable(bool enable, Positions pos) {
}
void Detector::setDacNames(const std::vector<std::string> names) {
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
auto dettype = getDetectorType().squash();
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
throw RuntimeError("Named dacs only for CTB");
pimpl->setCtbDacNames(names);
}
@ -2285,7 +2294,7 @@ void Detector::setDacNames(const std::vector<std::string> names) {
std::vector<std::string> Detector::getDacNames() const {
std::vector<std::string> names;
auto type = getDetectorType().squash();
if (type == defs::CHIPTESTBOARD)
if (type == defs::CHIPTESTBOARD || type == defs::XILINX_CHIPTESTBOARD)
return pimpl->getCtbDacNames();
for (const auto &index : getDacList())
@ -2295,7 +2304,7 @@ std::vector<std::string> Detector::getDacNames() const {
defs::dacIndex Detector::getDacIndex(const std::string &name) const {
auto type = getDetectorType().squash();
if (type == defs::CHIPTESTBOARD) {
if (type == defs::CHIPTESTBOARD || type == defs::XILINX_CHIPTESTBOARD) {
auto names = getDacNames();
auto it = std::find(names.begin(), names.end(), name);
if (it == names.end())
@ -2306,32 +2315,36 @@ defs::dacIndex Detector::getDacIndex(const std::string &name) const {
}
void Detector::setDacName(const defs::dacIndex i, const std::string &name) {
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
auto dettype = getDetectorType().squash();
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
throw RuntimeError("Named dacs only for CTB");
pimpl->setCtbDacName(i, name);
}
std::string Detector::getDacName(const defs::dacIndex i) const {
auto type = getDetectorType().squash();
if (type == defs::CHIPTESTBOARD)
auto dettype = getDetectorType().squash();
if (dettype == defs::CHIPTESTBOARD || dettype == defs::XILINX_CHIPTESTBOARD)
return pimpl->getCtbDacName(i);
return ToString(i);
}
void Detector::setAdcNames(const std::vector<std::string> names) {
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
auto dettype = getDetectorType().squash();
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
throw RuntimeError("Named adcs only for CTB");
pimpl->setCtbAdcNames(names);
}
std::vector<std::string> Detector::getAdcNames() const {
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
auto dettype = getDetectorType().squash();
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
throw RuntimeError("Named adcs only for CTB");
return pimpl->getCtbAdcNames();
}
int Detector::getAdcIndex(const std::string &name) const {
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
auto dettype = getDetectorType().squash();
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
throw RuntimeError("Named adcs only for CTB");
auto names = getAdcNames();
auto it = std::find(names.begin(), names.end(), name);
@ -2341,31 +2354,36 @@ int Detector::getAdcIndex(const std::string &name) const {
}
void Detector::setAdcName(const int index, const std::string &name) {
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
auto dettype = getDetectorType().squash();
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
throw RuntimeError("Named adcs only for CTB");
pimpl->setCtbAdcName(index, name);
}
std::string Detector::getAdcName(const int i) const {
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
auto dettype = getDetectorType().squash();
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
throw RuntimeError("Named adcs only for CTB");
return pimpl->getCtbAdcName(i);
}
void Detector::setSignalNames(const std::vector<std::string> names) {
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
auto dettype = getDetectorType().squash();
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
throw RuntimeError("Named signals only for CTB");
pimpl->setCtbSignalNames(names);
}
std::vector<std::string> Detector::getSignalNames() const {
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
auto dettype = getDetectorType().squash();
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
throw RuntimeError("Named signals only for CTB");
return pimpl->getCtbSignalNames();
}
int Detector::getSignalIndex(const std::string &name) const {
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
auto dettype = getDetectorType().squash();
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
throw RuntimeError("Named signals only for CTB");
auto names = getSignalNames();
auto it = std::find(names.begin(), names.end(), name);
@ -2375,31 +2393,37 @@ int Detector::getSignalIndex(const std::string &name) const {
}
void Detector::setSignalName(const int index, const std::string &name) {
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
auto dettype = getDetectorType().squash();
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
throw RuntimeError("Named signals only for CTB");
pimpl->setCtbSignalName(index, name);
}
std::string Detector::getSignalName(const int i) const {
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
auto dettype = getDetectorType().squash();
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
throw RuntimeError("Named signals only for CTB");
return pimpl->getCtbSignalName(i);
}
void Detector::setPowerNames(const std::vector<std::string> names) {
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
auto dettype = getDetectorType().squash();
if (getDetectorType().squash() != defs::CHIPTESTBOARD &&
dettype != defs::XILINX_CHIPTESTBOARD)
throw RuntimeError("Named powers only for CTB");
pimpl->setCtbPowerNames(names);
}
std::vector<std::string> Detector::getPowerNames() const {
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
auto dettype = getDetectorType().squash();
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
throw RuntimeError("Named powers only for CTB");
return pimpl->getCtbPowerNames();
}
defs::dacIndex Detector::getPowerIndex(const std::string &name) const {
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
auto dettype = getDetectorType().squash();
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
throw RuntimeError("Named powers only for CTB");
auto names = getPowerNames();
auto it = std::find(names.begin(), names.end(), name);
@ -2410,31 +2434,36 @@ defs::dacIndex Detector::getPowerIndex(const std::string &name) const {
void Detector::setPowerName(const defs::dacIndex index,
const std::string &name) {
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
auto dettype = getDetectorType().squash();
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
throw RuntimeError("Named powers only for CTB");
pimpl->setCtbPowerName(index, name);
}
std::string Detector::getPowerName(const defs::dacIndex i) const {
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
auto dettype = getDetectorType().squash();
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
throw RuntimeError("Named powers only for CTB");
return pimpl->getCtbPowerName(i);
}
void Detector::setSlowADCNames(const std::vector<std::string> names) {
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
auto dettype = getDetectorType().squash();
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
throw RuntimeError("Named SlowADCs only for CTB");
pimpl->setCtbSlowADCNames(names);
}
std::vector<std::string> Detector::getSlowADCNames() const {
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
auto dettype = getDetectorType().squash();
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
throw RuntimeError("Named SlowADCs only for CTB");
return pimpl->getCtbSlowADCNames();
}
defs::dacIndex Detector::getSlowADCIndex(const std::string &name) const {
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
auto dettype = getDetectorType().squash();
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
throw RuntimeError("Named SlowADCs only for CTB");
auto names = getSlowADCNames();
auto it = std::find(names.begin(), names.end(), name);
@ -2445,13 +2474,15 @@ defs::dacIndex Detector::getSlowADCIndex(const std::string &name) const {
void Detector::setSlowADCName(const defs::dacIndex index,
const std::string &name) {
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
auto dettype = getDetectorType().squash();
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
throw RuntimeError("Named SlowADCs only for CTB");
pimpl->setCtbSlowADCName(index, name);
}
std::string Detector::getSlowADCName(const defs::dacIndex i) const {
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
auto dettype = getDetectorType().squash();
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
throw RuntimeError("Named SlowADCs only for CTB");
return pimpl->getCtbSlowADCName(i);
}

View File

@ -272,7 +272,8 @@ void DetectorImpl::setHostname(const std::vector<std::string> &name) {
// Here we know the detector type and can add ctb shared memory
// if needed, CTB dac names are only on detector level
if (shm()->detType == defs::CHIPTESTBOARD) {
if (shm()->detType == defs::CHIPTESTBOARD ||
shm()->detType == defs::XILINX_CHIPTESTBOARD) {
if (ctb_shm.exists())
ctb_shm.openSharedMemory(true);
else
@ -711,7 +712,8 @@ void DetectorImpl::readFrameFromReceiver() {
uint32_t yoffset = coordY * nPixelsY;
uint32_t singledetrowoffset = nPixelsX * bytesPerPixel;
uint32_t rowoffset = nX * singledetrowoffset;
if (shm()->detType == CHIPTESTBOARD) {
if (shm()->detType == CHIPTESTBOARD ||
shm()->detType == defs::XILINX_CHIPTESTBOARD) {
singledetrowoffset = size;
}
LOG(logDEBUG1)
@ -1735,7 +1737,8 @@ void DetectorImpl::verifyUniqueHost(
}
defs::ROI DetectorImpl::getRxROI() const {
if (shm()->detType == CHIPTESTBOARD) {
if (shm()->detType == CHIPTESTBOARD ||
shm()->detType == defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError("RxRoi not implemented for this Detector");
}
if (modules.size() == 0) {
@ -1810,7 +1813,8 @@ defs::ROI DetectorImpl::getRxROI() const {
}
void DetectorImpl::setRxROI(const defs::ROI arg) {
if (shm()->detType == CHIPTESTBOARD) {
if (shm()->detType == CHIPTESTBOARD ||
shm()->detType == defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError("RxRoi not implemented for this Detector");
}
if (modules.size() == 0) {

View File

@ -184,7 +184,8 @@ slsDetectorDefs::detectorType Module::getDetectorType() const {
}
void Module::updateNumberOfChannels() {
if (shm()->detType == CHIPTESTBOARD) {
if (shm()->detType == CHIPTESTBOARD ||
shm()->detType == XILINX_CHIPTESTBOARD) {
std::array<int, 2> retvals{};
sendToDetector(F_GET_NUM_CHANNELS, nullptr, retvals);
shm()->nChan.x = retvals[0];
@ -2461,7 +2462,8 @@ void Module::setReadoutMode(const slsDetectorDefs::readoutMode mode) {
sendToDetector(F_SET_READOUT_MODE, arg, nullptr);
sendToDetectorStop(F_SET_READOUT_MODE, arg, nullptr);
// update #nchan, as it depends on #samples, adcmask,
if (shm()->detType == CHIPTESTBOARD) {
if (shm()->detType == CHIPTESTBOARD ||
shm()->detType == XILINX_CHIPTESTBOARD) {
updateNumberOfChannels();
}
if (shm()->useReceiverFlag) {
@ -3407,6 +3409,8 @@ const std::string Module::getDetectorAPI() const {
return APIMYTHEN3;
case GOTTHARD2:
return APIGOTTHARD2;
case XILINX_CHIPTESTBOARD:
return APIXILINXCTB;
default:
throw NotImplementedError(
"Detector type not implemented to get Detector API");

View File

@ -96,6 +96,7 @@ class slsDetectorDefs {
MOENCH,
MYTHEN3,
GOTTHARD2,
XILINX_CHIPTESTBOARD
};
/** return values */
@ -683,6 +684,7 @@ struct detParameters {
nChipY = 2;
nDacs = 8;
break;
case slsDetectorDefs::detectorType::XILINX_CHIPTESTBOARD:
case slsDetectorDefs::detectorType::CHIPTESTBOARD:
nChanX = 36;
nChanY = 1;

View File

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

View File

@ -207,6 +207,8 @@ std::string ToString(const defs::detectorType s) {
return std::string("Mythen3");
case defs::GOTTHARD2:
return std::string("Gotthard2");
case defs::XILINX_CHIPTESTBOARD:
return std::string("Xilinx_ChipTestBoard");
default:
return std::string("Unknown");
}
@ -694,6 +696,8 @@ template <> defs::detectorType StringTo(const std::string &s) {
return defs::MYTHEN3;
if (s == "Gotthard2")
return defs::GOTTHARD2;
if (s == "Xilinx_ChipTestBoard")
return defs::XILINX_CHIPTESTBOARD;
throw RuntimeError("Unknown detector type " + s);
}

View File

@ -136,6 +136,7 @@ TEST_CASE("string to detectorType") {
REQUIRE(StringTo<dt>("Moench") == dt::MOENCH);
REQUIRE(StringTo<dt>("Mythen3") == dt::MYTHEN3);
REQUIRE(StringTo<dt>("Gotthard2") == dt::GOTTHARD2);
REQUIRE(StringTo<dt>("Xilinx_ChipTestBoard") == dt::XILINX_CHIPTESTBOARD);
}
TEST_CASE("vec") {