Moench rewrite (#597)

* copied jungfrau server to moench and adapted

* fixed image size and num packets

* read n rows allows 16

* commneted out configure_asic_timer at server startup. To be removed later the ASIC_CTRL_REG and storage cell options

* moench:removing the decrement (which was in jf)  in read n rows to register

* removed lblsamples from gui
This commit is contained in:
Dhanya Thattil 2022-12-15 09:16:51 +01:00 committed by GitHub
parent 7ab3b25f87
commit 39b1f5bbf2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
58 changed files with 4309 additions and 5499 deletions

View File

@ -26,800 +26,7 @@ This document describes the differences between v7.0.0.rc1 and v6.1.2
1. New or Changed Features 1. New or Changed Features
========================== ==========================
- moench being made compatible with jungfrau 2.0 boards (jungfrau structure, away from ctb)
1.1. Compilation
----------------
General:
* Custom location to find ZeroMQ
Option to provide a custom location to look for ZeroMQ, if not found
using FindZeroMQ.cmake
For example, to use the system installed zmq:
Using cmake: -DZeroMQ_HINT=/usr/lib64
Using cmk.sh script: -q /usr/lib64
* Support external build
Assuming already installed version of the slsDetectorPacakge exists,
external build of python bindings, gui, ctbgui and moench has been added.
* Catch updated to latest 2.x version due to build failure in fedora
Gui:
* Qt5 and in-built compressed Qwt 6.1.5
Ported from Qt4 to Qt5. Minimum requirement: Qt 5.9
Compressed Qwt 6.1.5 added into the package in libs. It is unpacked and built
as a static library.This allows us to remove qwt as an external dependency
and reduces the risk of picking up the wrong version.
Python:
* Install python extension
Option to copy the python extension (slsdet folder and _slsdet-..so)
to CMAKE_INSTALL_PREFIX/python using
-DSLS_INSTALL_PYTHONEXT
* Pybind11 (v2.10.0)
Pybind11 is removed as a submodule and instead built into package to
simplify for users. Now, there is no more need to clone with the '--recursive'
argument or to update submodule when switching to this package version
and above.
* Conda packages
Removed conda packages for python 3.6 and 3.7. Added for python 3.11.
1.2. Callback
-------------
* Datatype of Metadata [registerCallBackRawDataReady, registerCallBackRawDataModifyReady]
Datatype changed from char* to sls_receiver_header.
* Datatype of Size [registerCallBackRawDataReady, registerCallBackRawDataModifyReady]
Datatype changed from uint32_t to size_t
* Datatype of file name and file path [registerCallBackStartAcquisition]
Datatype changed from string to const string reference.
* Incorrect image size [registerCallBackStartAcquisition]
Fixed. It used to give +120 bytes.
* [Gotthard2] 25um Image reconstruction for 2 modules
First module (master) interleaves with second modules(slave). First channel
of master is first channel of detector.
Requires firmware update to reverse channels of slaves.
1.3. Python
-----------
* Defines in sls_detector_defs
sls_detetor_defs parsed and #defines extracted into defines.py
For exmaple, one can use slsdet.LOCALHOST_IP
* Python sub-microsecond resolution
Reading back sub-microsecond exposure times from the Python API fixed by
addig Python datetime supports only micro seconds as lowest unit.
This is fixed by introducing a new C++ type (DurationWrapper), which
holds number of nanoseconds as a uint64_t (only in python bindings) and
custom typecaster to convert to and from std::chrono::nanoseconds.
A get using API now returns in DurationWrapper, instead of datetime.
Refer exptime help for examples.
1.4. Client
-----------
Breaking API:
* Versioning
The client, receiver and detector servers now have semantic Versioning
along with the date and are managed with the Version class.
--version argument to the executable gives the complete versioning with date.
Using the client to get versions gives only the semantic version. An older
server will still give date. Hence, the return type is a string, breaking API.
Compatibility checks at hostname or rx_hostname command will only be for
backwards compatibility (ie. it only checks for the major version number).
If its an old server, then its expected to have the exact same date (as
before)
Setting intitialchecks to 0 also bypasses the receiver compatibility check.
* Detector Specific fields
bunchid ->detSpec1
reserved->detSpec2
debug->detSpec3
roundRnumber->detSpec4
Header version number stays the same in the UDP header as there is no
difference in the format from the detector. Only the structure memeber names
have changed in sls_detector_defs.h
Further details about each detector specific field can be found at:
https://slsdetectorgroup.github.io/devdoc/udpdetspec.html
* Namespace sls
All files in slsSupportLib and tests have now been moved to sls namespace
including macros. Using the LOG, for example, will require the sls qualifier.
* [Eiger] Number of UDP interfaces
Command line: numinterfaces, API: getNumberofUDPInterfaces
This command now reflects the actual number of udp interfaces for Eiger,
which is 2.
* [Eiger][Jungfrau] Row column
[Jungfrau] Fixed row column indexing for multi module 2 interfaces
[Eiger] The row indicies were switched across the Y axis for the callback
only for Eiger. This is now changed and kept similar to the other detectors.
The row indices would be in the order of the half modules in the hostname
command. Therefore, to keep the image from callback, invert the hostname
order in the config file.
* Deprecated CopyDetectorServer
Command line: copydetectorserver, API: copydetectorserver
Removed. Use updatedetectorserver
* [Eiger][Jugfrau][Mythen3] Deprecated specific transmission delay commands
txndelay_frame -> txdelay_frame
txndelay_left -> txdelay_left
txndelay_right -> txdelay_right
* [Eiger] Datastream only for 10GbE
Command line: datastream, API: getDataStream/ setDataStream
This command to enable/ disable data stream from left or right port
is now allowed only for 10GbE. Previously, it incorrectly allowed to do so.
* [Eiger][Jungfrau][Moench][Ctb] Stop command effect on next frame number
Stopping acquisition sometimes results in different next frame numbers
for different moduels. Hence, after a stop, if the next frame numbers are
different, they are all set to their maximum value + 1.
* Missing packets
Command line: rx_missingpackets, API: getNumMissingPackets
This now returns a signed 64 bit instead of unsigned. The negative polarity
depicts extra packets instead of missing packets and also takes care of
disabled ports.
* Frames caught and frame index
Command line rx_framescaught, rx_frameindex, API: getFramesCaught/ getRxCurrentFrameIndex
They now return a vector for each port when there are 2 udp interfaces
in the receiver.
* [Gotthard][Gotthard2] Num modules
Only 2 modules allowed maximum in a detector shared memory.
* [Moench][Ctb][Mythen3] Deprecated commands
Patloopx, patnloopx, patwaitx, patwaittimex
Please use instead patloop, patnloop, patwait and patwaittime commands
with the level as an argument.
Old commands work with warning, but the server expects the new ones
such as a default pattern file to be loaded at startup for Moench.
Renamed patternParameters struct member from 'loop' to 'startloop' and
'stoploop'.
* [Mythen3] Clock Divider 4 and 5
Cannot be set anymore. Only read back.
New commands:
* [Eiger][Gotthard][Gotthard2][Mythen3][Jungfrau] Master
Setting up from client:
[Eiger][Gotthard2][Jungfrau]
Command line: master, API: getMaster/ setMaster
All of them can get master mode from the client.
This can also be set up on the detector server. Please refer to notes
on that section.
* [Eiger] Top
Command line: top, API: getTop/ setTop
Sets the half module to top or bottom from the client.
This can also be set up on the detector server. Please refer to notes
on that section.
* [Mythen3][Eiger] Save settings file
Command line: trimbits (sls_detector_get), API: saveTrimbits
Added
* [Gotthard2] Parallel readout added
Command line: parallel, API: getParallelMode/ setParallelMode
Default for Gotthard2 is parallel. Non parallel mode only works in
continuous mode.
* [Jungfrau] Software trigger added
Command line: trigger, API: sendSoftwareTrigger
Send software trigger instead of harware trigger.
* [Eiger][Jungfrau] Blocking trigger
Commandline: blockingtrigger, API: sendSoftwareTrigger with argument true
Sends software trigger signal to detector and blocks until the frames
are sent out for that trigger.
* [Jungfrau] Sync
Command line: sync, API: getSynchronization/ setSynchronization
Enables or disables synchronization between modules
* [Gotthard2][Mythen3] Temperature readout
Command line: temp_fpga, API: getTemperature with TEMPERATURE_FPGA enum
Added
* [Gotthard2][Mythen3] Round robin added
Command line: udp_dstlist, API: getDestinationUDPList/ setDestinationUDPList
Command line: udp_numdst, API: getNumberofUDPDestinations
One can set up to 32 (64 for Mythen3) entries in the destination list.
* [Jungfrau] Module Id
Command line: moduleid, API: getModuleId
16 bit value (ideally unique) that is streamed out in the udp header of
the detector. The on-board detector server picks it up from a file
(if it exists) called detid_jungfrau.txt.
* [Jungfrau][[Gotthard2][Myhten3][Gotthard][Ctb][Moench] Hardware version
Command line: hardwareversion, API: getHardwareVersion
Gets the board or hardware version.
For example, Jungfrau returns 1.0 or 2.0.
It is also printed at on-board detector server start up.
Also printed before starting FPGA programming.
* [Eiger][Jugfrau][Mythen3] Transmission Delay
Command line: tx_delay, API: getTransmissionDelay/ setTransmissionDelay
Sets transmission delay for all modules in the detector using the step
size provided. Sets up for every module:
[Eiger] txdelay_left to (2 * mod_index * n_delay)
[Eiger] txdelay_right to ((2 * mod_index + 1) * n_delay)
[Eiger] txdelay_frame to (2 *num_modules * n_delay)
[Jungfrau][Mythen3] txdelay_frame to (num_modules * n_delay)
* [Mythen3] Bad channels
Command line: badchannels, API: getBadChannels/ setBadChannels
Set bad channels from file with a list of channels, which will be masked
out. Also does trimming. A detector level command will require the channel
numbers accordingly. The file also extended to include commas, colons range)
and removes duplicates.
* [Moench][Ctb] Starting frame number
Command line: nextframenumber, API: getNextFrameNumber/ setNextFrameNumber
Added and default set up on detector server start up.
* [Ctb] DAC names
Command line: daclist, API: getDacNames/ setDacNames
Can set and get dac names in the dac list now.
* [Mythen3] Polarity, interpolation, pump probe, analog pulsing, digital pulsing
Command line: polarity, interpolation, pumpprobe, apulse, dpulse
API: getPolarity/ setPolarity, getInterpolation/ setInterpolation,
getPumpProbe/ setPumpProbe, getAnalogPulsing/ setAnalogPulsing,
getDigitalPulsing/ setDigitalPulsing
Added these commands.
Enabling interpolation will also enable all counters and disable vth3.
Disabling sets to previous counter mask and previous vth values.
In pump probe mode, only vth2 enabled. Disabling sets vth2 to prevevious
value.
Setting counter mask will check interpolation and pump probe mode
requirements, else sets vthx dacs according to counter mask.
Direct overwrite of any dac (including vthx) allowed using dac command
(as before).
New commands for Receiver only:
* Arping for 10GbE
Command line: rx_arping API: getRxArping/ setRxArping
Starts a thread in the receiver to arping the interface it is listening
to in 10GbE mode every 60 s.
Changes NUM_RX_THREAD_IDS (sls_detector_defs.h) from 8 to 9.
* Receiver Region of Interest
Command line: rx_roi, API: getRxROI/ setRxROI
Command line: rx_clearroi, API: clearRxROI
One can set an ROI in the receiver to write to file. 1D detectors can set
xmin and xmax, whereas the 2D can also set ymin and ymax. -1 values signify
no ROI.
This is not at network level and can only be used to reduce size of file.
Virtual HDF5 files not created when this is enabled and also no link in
master file. No file created if module not in ROI.
There can only be one ROI per detector. Therefore, can be set only at
detector level, but can be retrieved at module level as well.
The GUI still shows the entire image, but has a yellow border around the
ROI. Status bar displays a message when Rx ROI enabled.
Additonal Features:
* Non-blocking start
Allowing non-blocking start at modular level again.
* [Jungfrau][Moench][Ctb] Additional programming checks
Also checks if the drive to write to is a special file or a normal
file. If its a normal file, it throws asking to redo the command with a
'--please-delete' argument to delete the normal file and create the device
drive and restart FPGA programming.
More readable error message insetad of "programfpga not implemented for
this detector'. This happens when 'hostname' command fails due to
server-firmware/client compatibility and the detector type becomes
'GENERIC'. Fixed to suggest if 'hostname' executed properly.
* Udp Source IP
Command line: udp_srcip(2), API: getSourceUDPIP(2)/ setSourceUDPIP(2)
One can also set this to 'auto' for 1 GbE data. It will set to IP of
rx_hostname (as in udp_dstip)
* Incrementing default receiver tcp port
Automatically incrementing the default receiver tcp port for every module
when creating shared memory.
Changes or Fixes:
* [Jungfrau][Gotthard2][Mythen3][Gotthard][Moench][Ctb] Can't stop
This bug was introduced in 6.1.1, when stopping an acquisition saying it
cannot stop, even though it was successful. It is fixed now.
* Free and config command fail
Free and config command checked mismatch of size of shared memory before
freeing or loading new config. Fixed.
* sls_detector_help or sls_detector_get -h
Should not create Detector object. Fixed.
* [Jungfrau] Storage cells in running receiver
Allowing the possibility to set this when receiver in running state.
* [Eiger] Vtr
Allow Vtrim to be interpolated for settings.
* [Mythen3] Incorrect gain caps when setting threshold energy
Gain caps overwritten with settings enum. Fixed.
* [Mythen3] Non blocking start acquisition
Non-blocking start acquisition was sent out twice to the master. Fixed.
* [Mythen3] Threshold
When settings trimbits or threshold, counter mask is set and hence,
vthx dacs are set accordingly.
setAllThresholdEnergy takes 3 values for each counter and if one of them
is -1, the trimbits and setings for that counter is picked up from the
detector.
* [Moench][Ctb] Pattern levels
Changed from 3 to 6.
* [Mythen3][Moench][Ctb] Default patwait and patloop addresses
Set default wait and loop addresses to 0x1fff (max value) for all levels
before loading pattern. Please use the pattern command instead of parameters.
This ensures defaults are set up and is faster.
* [Moench] Patsetbit and patsetmask
Command line: patsetbit API: getPatternBitMask/ setPatternBitMask
Command line: patmask API: getPatternMask/ setPatternMask
Exchanging the help and masks for patsetbit and patsetmask in the detector
server, especially in loading settings.
* [Moench][Ctb] ADC Vpp
Command line: adcvpp, API: getADCVpp/ setADCVpp
Moved from SetDAC function into into its own. One can use mV values or
option numbers as before.
* [Ctb] ADC command goes back to control server
Slow ADCs, slow ADC temperature, get measured current and voltage values
are requested via the control server again insetad of the stop server
due to configuration and definitions in the control server.
1.5. Detector Server
--------------------
Config file:
* [Eiger][Gotthard2][Gotthard] Master
Using config file with 'master' with argument (master=1, slave=0)
* [Eiger] Top
Using config file with 'top' with argument (top=1, bottom=0)
Command line arguments:
* They have precedence over config files.
* [Eiger][Gotthard2 Virtual][Mythen3 Virtual][Gotthard Virtual] Master
Using command line '--master = 1' or '-m = 1' with argument
(master = 1, slave = 0)
* [Eiger] Top
Using command line '--top = 1' or '-t = 1' with argument (top=1, bottom=0)
* Ignore config file
The config files can also be ignored by an argument from the command line,
'--ignore-config' or '-i'.
Fixes:
* [Jungfrau][Eiger] Clear UDP destination
Command line: udp_cleardst, API: clearUDPDestinations
Clearing udp destination also clears it in the FPGA now.
* [Eiger] Incorrect next frame number
Command line: nextframenumber, API: getNextFrameNumber/ setNextFrameNumber
Get next frame number for 10g was connected to 1g registers and gave
incorrect values. Fixed.
* [Mythen3][Gotthard2] System clock change effects
When changing the system clock (clkdiv 2), time settings should also be
affected (exptime, period etc.). Fixed.
[Gotthard2] System frequency should be same irrespective of timing source.
Fixed.
* [Mythen3] Kernel version compatibility test
Fix added to parse properly the kernel version with CET for corrected
version compatibility test.
* [Mythen3] Server crash for setting vthrehsold
Fixed.
* [Mythen3] Incorrect gaincaps
Setting threshold energy was overwriting gaincaps with settings enum. Fixed.
* [Ctb][Moench] Hostname fail in update mode.
Fixed
Changes:
* [Jungfrau] Temporary fix for stop in 6.1.1
Temporary fix introduced in 6.1.1 for not being able to start after a
stop command has been issued is removed. Reset core right after also has
been removed. It has been fixed in firmware instead.
* [Gotthard2] Clock Divider defaults
When chancing burst mode, clock dividers (2, 3 and 4) set to their
defaults according to burst mode.
* [Mythen3] DAC check for settings
Verify DAC values for each setting has been temporarily switched off
* [Mythen3] DAC min and max values
Vtrim minimum of 600 has been removed.
The threshold dacs minimum is 200 and maximum is 2400.
The other DACs minimum is 0 and maximum is 2800.
When out of range, will not throw, just a warning.
* [Mythen3] Vicin Dac changed to 800
* [Jungfrau][Moench][Ctb] PLL reset at server start up
PLL reset now at server start up.
* [Moench] ADC9257 Vref
ADC Vref voltage modified from 1.33V to 2V
* [Ctb] Allow all clock dividers for PLL
Fixed. For example, 133 MHz would not really be set previously. Fixed by
changing totaldiv from float to an integer.
Additional Features:
* Stop server startup errors
Stop servers now also check for errors at startup (including version
compatibility) and like the control server, it will translate to the
client when connecting for the first time (hostname command).
* [Jungfrau][Moench][Ctb] Additional server update process
Removes old server binary or target of linked file when updating
detector server for blackfin detectors as there is less space on blackfin.
Clearing up absolute and respawn path (removing double '/')
Raise error if server name to be copied is the same as final soft link name.
* [Moench][Ctb] 1 GbE Non blocking acquisition
Previously non blocking acquisition in 1 GbE would not send data.
This feature added now.
* [Gotthard2] Adapted to new HDI version
HDI module ID written to FPGA register
1.6. Simulator
--------------
* Command line arguments. Please refer to previous section on Detector Server.
* [Eiger] Only one executable
Only one executable for an Eiger virtual server. Master and top mode
can be provided via command line or config file to the detector server,
as well as via the client. See in Other New Features for more details.
One can start a module using:
eigerDetectorServer_virtual # reads default config file (top master)
eigerDetectorServer_virtual -i #ignores the config file (bottom slave)
* [Eiger][Junfrau][Gotthard2][Mythen3] Module Id
Added into udp header
* Minimum Configuration
One can setup with just:
hostname localhost
rx_hostname localhost
udp_dstip auto
* [Mythen3] Packet size
Fixed packet size calculation. Previously, sending only header with no data.
1.7. Receiver
-------------
Breaking API:
* Namespace sls
All the receiver source files have also been added to namespace sls.
* HDF5 and Binary writer version
Changed from 6.3 to 6.4
* Master file format to json
The format has been changed from ASCII to json.
* Geometry metadata
Added geometry (number of modules in each direction) to metadata in file.
* HDF5 Dataset name
Changed to just "data" to simplify for user
* File write
File write is disabled by default.
Fixes:
* Refactored and fixed minor issues
Including memory structure and udp sockets.
Fixed progress also in discard partial packaets mode and deactivated ports.
Fixed 200% progress.
Completely padded images now have detector type or version in metadata.
Fixed getting stuck at stop receiver when using zmq
Fixed clang compiler warnings
* Multiple files
This bug was introduced in v6.0.0, where 1 file was created per frame
after the first file. Fixed by resetting the number of frames in
current file when creating a new one.
* [Eiger] Datastream command order
The order of commands to set datastream from client mattered previously.
Datastream had to be set before 10GbE enable. Order does not matter anymore.
* Udp destination MAC
If it has been set before, changing udp_dstip will not update udp_dstmac.
Fixed to always set it in detector even if it had a value before.
Udp_dstmac can still be used to overwrite again. This is useful when
using a router for example.
* Stuck when using zmq
More often in 6.1.1, gets stuck at stop receiver.
* [Mythen3] Incorrect number of packets calculated or tengiga not set up
Runnig config second time (with tengiga=0, dr !=32, counters !=0x7)
calculated incorrect image size expected due to inconsistent copy of
detector parameters. Fixed
* Storage cells in receiver
Previously not updated in receiver. Fixed.
* Virtual HDF5 Parameter datasets
Corner case bug when frames caught is not a multiple of frames per file.
Not found in virtual image datasets. Fixed.
Changes:
* Master file created at end of acquisition
The file is now written at the end of acquisition. So if any metadata
is changed during an acquisition, it will reflect the last value.
* File name prefix
Slash '/' not allowed.
Additional Features:
* [Gotthard2] 25um image reconstruction in virtual HDF5
Virtual HDF5 reconstructs complete image by interleaving first module
(master) with second module (slave). First channel of master is first
channel of detector.
Requires firmware update to reverse channels of slaves.
* Memory size
Increased an internal fifo header by 8 bytes to align memory allocated for
to receive images for efficiency.
1.8. Gui
--------
* [Jungfrau][Eiger] Gap pixels
Enabled by default in the gui.
* High voltage moved from Developer tab to Settings tab.
* Gain plot zooming
Zooming disabled. Instead, it automatically zooms in when you zoom in
the main plot or if min and max of x and y axis set up in plot tab.
* [Mythen3] Inconsistent timing mode
Timing mode of the slaves should be discarded before squashing. Fixed.
* [Mythen3][Gotthard2] Crashes
Additional locking Added
2. On-board Detector Server Compatibility 2. On-board Detector Server Compatibility

File diff suppressed because it is too large Load Diff

View File

@ -32,7 +32,6 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
void SetNumFrames(int val); void SetNumFrames(int val);
void SetNumTriggers(int val); void SetNumTriggers(int val);
void SetNumBursts(int val); void SetNumBursts(int val);
void SetNumSamples(int val);
void SetNumGates(int val); void SetNumGates(int val);
void SetExposureTime(); void SetExposureTime();
void SetAcquisitionPeriod(); void SetAcquisitionPeriod();
@ -64,7 +63,6 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
void GetNumFrames(); void GetNumFrames();
void GetNumTriggers(); void GetNumTriggers();
void GetNumBursts(); void GetNumBursts();
void GetNumSamples();
void GetNumGates(); void GetNumGates();
void GetExposureTime(); void GetExposureTime();
void GetAcquisitionPeriod(); void GetAcquisitionPeriod();
@ -96,7 +94,6 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
QString errPeriodTip; QString errPeriodTip;
QPalette red; QPalette red;
bool delayImplemented; bool delayImplemented;
bool sampleImplemented;
bool gateImplemented; bool gateImplemented;
bool startingFnumImplemented; bool startingFnumImplemented;
bool isAcquisitionStopped{false}; bool isAcquisitionStopped{false};

View File

@ -52,6 +52,7 @@ void qDrawPlot::SetupWidgetWindow() {
detType = det->getDetectorType().squash(); detType = det->getDetectorType().squash();
switch (detType) { switch (detType) {
case slsDetectorDefs::JUNGFRAU: case slsDetectorDefs::JUNGFRAU:
case slsDetectorDefs::MOENCH:
pixelMask = ((1 << 14) - 1); pixelMask = ((1 << 14) - 1);
gainMask = (3 << 14); gainMask = (3 << 14);
gainOffset = 14; gainOffset = 14;
@ -1142,7 +1143,8 @@ void qDrawPlot::toDoublePixelData(double *dest, char *source, int size,
break; break;
case 16: case 16:
if (detType == slsDetectorDefs::JUNGFRAU || if (detType == slsDetectorDefs::MOENCH ||
detType == slsDetectorDefs::JUNGFRAU ||
detType == slsDetectorDefs::GOTTHARD2) { detType == slsDetectorDefs::GOTTHARD2) {
// show gain plot // show gain plot

View File

@ -40,13 +40,11 @@ void qTabDataOutput::SetupWidgetWindow() {
comboClkDivider->setEnabled(true); comboClkDivider->setEnabled(true);
chkParallel->setEnabled(true); chkParallel->setEnabled(true);
break; break;
case slsDetectorDefs::MOENCH:
chkTenGiga->setEnabled(true);
break;
case slsDetectorDefs::MYTHEN3: case slsDetectorDefs::MYTHEN3:
chkParallel->setEnabled(true); chkParallel->setEnabled(true);
break; break;
case slsDetectorDefs::JUNGFRAU: case slsDetectorDefs::JUNGFRAU:
case slsDetectorDefs::MOENCH:
lblClkDivider->setEnabled(true); lblClkDivider->setEnabled(true);
comboClkDivider->setEnabled(true); comboClkDivider->setEnabled(true);
break; break;

View File

@ -111,6 +111,7 @@ void qTabDeveloper::SetupWidgetWindow() {
break; break;
case slsDetectorDefs::JUNGFRAU: case slsDetectorDefs::JUNGFRAU:
case slsDetectorDefs::MOENCH:
dacWidgets.push_back( dacWidgets.push_back(
new qDacWidget(this, det, true, new qDacWidget(this, det, true,
"v vb comp: ", getSLSIndex(detType, tempid++))); "v vb comp: ", getSLSIndex(detType, tempid++)));
@ -139,72 +140,6 @@ void qTabDeveloper::SetupWidgetWindow() {
"Temperature ADC: ", getSLSIndex(detType, tempid++))); "Temperature ADC: ", getSLSIndex(detType, tempid++)));
break; break;
case slsDetectorDefs::MOENCH:
dacWidgets.push_back(
new qDacWidget(this, det, true,
"vbp_colbuf: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vipre: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vin_cm: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vb_sda: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(
new qDacWidget(this, det, true,
"vcasc_sfp: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vout_cm: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(
new qDacWidget(this, det, true,
"vipre_cds: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(
new qDacWidget(this, det, true,
"ibias_sfp: ", getSLSIndex(detType, tempid++)));
break;
case slsDetectorDefs::MYTHEN3:
dacWidgets.push_back(new qDacWidget(
this, det, true, "vcassh: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vth2: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vrshaper: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(
new qDacWidget(this, det, true,
"vrshaper_n: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(
new qDacWidget(this, det, true,
"vipre_out: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vth3: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vth1: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vicin: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vcas: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vrpreamp: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vcal_p: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vipre: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vishaper: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vcal_n: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vtrim: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vdcsh: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(
new qDacWidget(this, det, true,
"vthreshold: ", getSLSIndex(detType, tempid++)));
adcWidgets.push_back(new qDacWidget(
this, det, false,
"Temperature FPGA: ", getSLSIndex(detType, tempid++)));
break;
case slsDetectorDefs::GOTTHARD2: case slsDetectorDefs::GOTTHARD2:
dacWidgets.push_back( dacWidgets.push_back(
new qDacWidget(this, det, true, new qDacWidget(this, det, true,
@ -386,6 +321,7 @@ qTabDeveloper::getSLSIndex(slsDetectorDefs::detectorType detType, int index) {
break; break;
case slsDetectorDefs::JUNGFRAU: case slsDetectorDefs::JUNGFRAU:
case slsDetectorDefs::MOENCH:
switch (index) { switch (index) {
case 0: case 0:
return slsDetectorDefs::VB_COMP; return slsDetectorDefs::VB_COMP;
@ -411,30 +347,6 @@ qTabDeveloper::getSLSIndex(slsDetectorDefs::detectorType detType, int index) {
} }
break; break;
case slsDetectorDefs::MOENCH:
switch (index) {
case 0:
return slsDetectorDefs::VBP_COLBUF;
case 1:
return slsDetectorDefs::VIPRE;
case 2:
return slsDetectorDefs::VIN_CM;
case 3:
return slsDetectorDefs::VB_SDA;
case 4:
return slsDetectorDefs::VCASC_SFP;
case 5:
return slsDetectorDefs::VOUT_CM;
case 6:
return slsDetectorDefs::VIPRE_CDS;
case 7:
return slsDetectorDefs::IBIAS_SFP;
default:
throw RuntimeError(std::string("Unknown dac/adc index") +
std::to_string(index));
}
break;
case slsDetectorDefs::MYTHEN3: case slsDetectorDefs::MYTHEN3:
switch (index) { switch (index) {
case 0: case 0:

View File

@ -35,7 +35,6 @@ void qTabMeasurement::SetupWidgetWindow() {
// timer to update the progress bar // timer to update the progress bar
progressTimer = new QTimer(this); progressTimer = new QTimer(this);
sampleImplemented = false;
gateImplemented = false; gateImplemented = false;
delayImplemented = true; delayImplemented = true;
startingFnumImplemented = false; startingFnumImplemented = false;
@ -47,18 +46,11 @@ void qTabMeasurement::SetupWidgetWindow() {
// default is triggers and delay (not #bursts and burst period for gotthard2 // default is triggers and delay (not #bursts and burst period for gotthard2
// in auto mode) // in auto mode)
ShowTriggerDelay(); ShowTriggerDelay();
// default is to show samples, mythen3, show gates
ShowGates();
// enabling according to det type // enabling according to det type
lblBurstMode->hide(); lblBurstMode->hide();
comboBurstMode->hide(); comboBurstMode->hide();
switch (det->getDetectorType().squash()) { switch (det->getDetectorType().squash()) {
case slsDetectorDefs::MOENCH:
lblNumSamples->setEnabled(true);
spinNumSamples->setEnabled(true);
sampleImplemented = true;
break;
case slsDetectorDefs::EIGER: case slsDetectorDefs::EIGER:
delayImplemented = false; delayImplemented = false;
lblNextFrameNumber->setEnabled(true); lblNextFrameNumber->setEnabled(true);
@ -66,6 +58,7 @@ void qTabMeasurement::SetupWidgetWindow() {
startingFnumImplemented = true; startingFnumImplemented = true;
break; break;
case slsDetectorDefs::JUNGFRAU: case slsDetectorDefs::JUNGFRAU:
case slsDetectorDefs::MOENCH:
lblNextFrameNumber->setEnabled(true); lblNextFrameNumber->setEnabled(true);
spinNextFrameNumber->setEnabled(true); spinNextFrameNumber->setEnabled(true);
startingFnumImplemented = true; startingFnumImplemented = true;
@ -112,10 +105,6 @@ void qTabMeasurement::Initialization() {
connect(spinNumBursts, SIGNAL(valueChanged(int)), this, connect(spinNumBursts, SIGNAL(valueChanged(int)), this,
SLOT(SetNumBursts(int))); SLOT(SetNumBursts(int)));
} }
if (spinNumSamples->isEnabled()) {
connect(spinNumSamples, SIGNAL(valueChanged(int)), this,
SLOT(SetNumSamples(int)));
}
if (gateImplemented) { if (gateImplemented) {
connect(spinNumGates, SIGNAL(valueChanged(int)), this, connect(spinNumGates, SIGNAL(valueChanged(int)), this,
SLOT(SetNumGates(int))); SLOT(SetNumGates(int)));
@ -198,16 +187,6 @@ void qTabMeasurement::ShowTriggerDelay() {
} }
} }
void qTabMeasurement::ShowGates() {
if (det->getDetectorType().squash() == slsDetectorDefs::MYTHEN3) {
stackedLblSamplesGates->setCurrentWidget(pageLblGates);
stackedSpinSamplesGates->setCurrentWidget(pageSpinGates);
} else {
stackedLblSamplesGates->setCurrentWidget(pageLblSamples);
stackedSpinSamplesGates->setCurrentWidget(pageSpinSamples);
}
}
void qTabMeasurement::SetupTimingMode() { void qTabMeasurement::SetupTimingMode() {
QStandardItemModel *model = QStandardItemModel *model =
qobject_cast<QStandardItemModel *>(comboTimingMode->model()); qobject_cast<QStandardItemModel *>(comboTimingMode->model());
@ -510,31 +489,6 @@ void qTabMeasurement::SetNumBursts(int val) {
&qTabMeasurement::GetNumBursts) &qTabMeasurement::GetNumBursts)
} }
void qTabMeasurement::GetNumSamples() {
LOG(logDEBUG) << "Getting number of samples";
disconnect(spinNumSamples, SIGNAL(valueChanged(int)), this,
SLOT(SetNumSamples(int)));
try {
auto retval = det->getNumberOfAnalogSamples().tsquash(
"Inconsistent number of analog samples for all detectors.");
spinNumSamples->setValue(retval);
}
CATCH_DISPLAY("Could not get number of samples.",
"qTabMeasurement::GetNumSamples")
connect(spinNumSamples, SIGNAL(valueChanged(int)), this,
SLOT(SetNumSamples(int)));
}
void qTabMeasurement::SetNumSamples(int val) {
LOG(logINFO) << "Setting number of samples to " << val;
try {
det->setNumberOfAnalogSamples(val);
}
CATCH_HANDLE("Could not set number of samples.",
"qTabMeasurement::SetNumSamples", this,
&qTabMeasurement::GetNumSamples)
}
void qTabMeasurement::GetNumGates() { void qTabMeasurement::GetNumGates() {
LOG(logDEBUG) << "Getting number of gates"; LOG(logDEBUG) << "Getting number of gates";
disconnect(spinNumGates, SIGNAL(valueChanged(int)), this, disconnect(spinNumGates, SIGNAL(valueChanged(int)), this,
@ -1003,9 +957,6 @@ void qTabMeasurement::Refresh() {
if (spinBurstPeriod->isEnabled()) { if (spinBurstPeriod->isEnabled()) {
GetBurstPeriod(); GetBurstPeriod();
} }
if (sampleImplemented) {
GetNumSamples();
}
if (gateImplemented) { if (gateImplemented) {
GetNumGates(); GetNumGates();
} }

View File

@ -66,6 +66,11 @@ void qTabPlot::SetupWidgetWindow() {
chkGainPlot->setChecked(true); chkGainPlot->setChecked(true);
plot->EnableGainPlot(true); plot->EnableGainPlot(true);
break; break;
case slsDetectorDefs::MOENCH:
chkGainPlot->setEnabled(true);
chkGainPlot->setChecked(true);
plot->EnableGainPlot(true);
break;
default: default:
break; break;
} }
@ -781,6 +786,9 @@ void qTabPlot::Refresh() {
chkGapPixels->setEnabled(true); chkGapPixels->setEnabled(true);
GetGapPixels(); GetGapPixels();
break; break;
case slsDetectorDefs::MOENCH:
chkGainPlot->setEnabled(true);
break;
case slsDetectorDefs::GOTTHARD2: case slsDetectorDefs::GOTTHARD2:
chkGainPlot1D->setEnabled(true); chkGainPlot1D->setEnabled(true);
break; break;

View File

@ -92,7 +92,8 @@ void qTabSettings::SetupWidgetWindow() {
comboDynamicRange->setEnabled(true); comboDynamicRange->setEnabled(true);
lblThreshold->setEnabled(true); lblThreshold->setEnabled(true);
spinThreshold->setEnabled(true); spinThreshold->setEnabled(true);
} else if (detType == slsDetectorDefs::JUNGFRAU) { } else if (detType == slsDetectorDefs::JUNGFRAU ||
detType == slsDetectorDefs::MOENCH) {
lblSpinHV->show(); lblSpinHV->show();
spinHV->show(); spinHV->show();
lblGainMode->setEnabled(true); lblGainMode->setEnabled(true);
@ -100,9 +101,6 @@ void qTabSettings::SetupWidgetWindow() {
} else if (detType == slsDetectorDefs::GOTTHARD) { } else if (detType == slsDetectorDefs::GOTTHARD) {
comboHV->show(); comboHV->show();
lblComboHV->show(); lblComboHV->show();
} else if (detType == slsDetectorDefs::MOENCH) {
lblSpinHV->show();
spinHV->show();
} else if (detType == slsDetectorDefs::GOTTHARD2) { } else if (detType == slsDetectorDefs::GOTTHARD2) {
lblSpinHV->show(); lblSpinHV->show();
spinHV->show(); spinHV->show();

View File

@ -8,35 +8,28 @@ add_executable(moenchDetectorServer_virtual
../slsDetectorServer/src/blackfin.c ../slsDetectorServer/src/blackfin.c
../slsDetectorServer/src/common.c ../slsDetectorServer/src/common.c
../slsDetectorServer/src/commonServerFunctions.c ../slsDetectorServer/src/commonServerFunctions.c
../slsDetectorServer/src/communication_funcs_UDP.c
../slsDetectorServer/src/UDPPacketHeaderGenerator.c
../slsDetectorServer/src/AD9257.c ../slsDetectorServer/src/AD9257.c
../slsDetectorServer/src/ALTERA_PLL.c ../slsDetectorServer/src/ALTERA_PLL.c
../slsDetectorServer/src/LTC2620.c ../slsDetectorServer/src/LTC2620.c
../slsDetectorServer/src/MAX1932.c ../slsDetectorServer/src/MAX1932.c
../slsDetectorServer/src/programViaBlackfin.c ../slsDetectorServer/src/programViaBlackfin.c
../slsDetectorServer/src/loadPattern.c ../slsDetectorServer/src/communication_funcs_UDP.c
../slsDetectorServer/src/sharedMemory.c ../slsDetectorServer/src/sharedMemory.c
../../slsSupportLib/src/md5.c ../../slsSupportLib/src/md5.c
) )
include_directories( target_include_directories(moenchDetectorServer_virtual
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
../slsDetectorServer/include ../slsDetectorServer/include
../../slsSupportLib/include ../../slsSupportLib/include
../../slsDetectorSoftware/include/sls/
)
target_include_directories(moenchDetectorServer_virtual
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
) )
target_compile_definitions(moenchDetectorServer_virtual target_compile_definitions(moenchDetectorServer_virtual
PUBLIC MOENCHD VIRTUAL STOP_SERVER PUBLIC MOENCHD VIRTUAL STOP_SERVER #TEST_MOD_GEOMETRY
) )
target_link_libraries(moenchDetectorServer_virtual target_link_libraries(moenchDetectorServer_virtual
PUBLIC pthread rt slsProjectCSettings PUBLIC pthread rt slsProjectCSettings
m
) )
set_target_properties(moenchDetectorServer_virtual PROPERTIES set_target_properties(moenchDetectorServer_virtual PROPERTIES
@ -44,7 +37,9 @@ set_target_properties(moenchDetectorServer_virtual PROPERTIES
) )
install(TARGETS moenchDetectorServer_virtual install(TARGETS moenchDetectorServer_virtual
EXPORT "${TARGETS_EXPORT_NAME}"
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
) )
configure_file(DefaultPattern_moench.txt ${CMAKE_BINARY_DIR}/bin/DefaultPattern_moench.txt COPYONLY) configure_file(config_moench.txt ${CMAKE_BINARY_DIR}/bin/config_moench.txt COPYONLY)
configure_file(detid_moench.txt ${CMAKE_BINARY_DIR}/bin/detid_moench.txt COPYONLY)

View File

@ -1,301 +0,0 @@
patword 0x0000 0x0008599f0418503a
patword 0x0001 0x0008599f0418503a
patword 0x0002 0x000859960418503a
patword 0x0003 0x000859960418503a
patword 0x0004 0x000859960418503a
patword 0x0005 0x000859960418503a
patword 0x0006 0x000859960418503a
patword 0x0007 0x000859960418503a
patword 0x0008 0x000859960418503a
patword 0x0009 0x000859960418503a
patword 0x000a 0x000859960418503a
patword 0x000b 0x000859960418503a
patword 0x000c 0x000859960418503a
patword 0x000d 0x000859960418503a
patword 0x000e 0x000859960418503a
patword 0x000f 0x000859960418503a
patword 0x0010 0x000859960418503a
patword 0x0011 0x000859960418503a
patword 0x0012 0x000859960418503a
patword 0x0013 0x000859960418503a
patword 0x0014 0x000859960418503a
patword 0x0015 0x000859960418503a
patword 0x0016 0x000819960418501a
patword 0x0017 0x000819960418501a
patword 0x0018 0x000819960418501a
patword 0x0019 0x000819960418501a
patword 0x001a 0x000819960418501a
patword 0x001b 0x000819960418501a
patword 0x001c 0x000819960418501a
patword 0x001d 0x000819960418501a
patword 0x001e 0x000819960418501a
patword 0x001f 0x000819960418501a
patword 0x0020 0x000819960418501a
patword 0x0021 0x000819960418501a
patword 0x0022 0x000819960418501a
patword 0x0023 0x000819960418501a
patword 0x0024 0x000819960418501a
patword 0x0025 0x000819960418501a
patword 0x0026 0x000819960418501a
patword 0x0027 0x000819960418501a
patword 0x0028 0x000819960418501a
patword 0x0029 0x000819960418501a
patword 0x002a 0x000819960418501a
patword 0x002b 0x000819960418501a
patword 0x002c 0x000819960418501a
patword 0x002d 0x000819960418501a
patword 0x002e 0x000819960418501a
patword 0x002f 0x000819960418501a
patword 0x0030 0x000819960008501a
patword 0x0031 0x000819960008501a
patword 0x0032 0x000819960008501a
patword 0x0033 0x000819960008501a
patword 0x0034 0x000819960008501a
patword 0x0035 0x000819960008501a
patword 0x0036 0x000819960008501a
patword 0x0037 0x000819960008501a
patword 0x0038 0x000819960008501a
patword 0x0039 0x000819960008501a
patword 0x003a 0x000819960008501a
patword 0x003b 0x000819960008501a
patword 0x003c 0x000819960008501a
patword 0x003d 0x000819960008501a
patword 0x003e 0x000819960008501a
patword 0x003f 0x000819960008501a
patword 0x0040 0x000819960008501a
patword 0x0041 0x000819960008501a
patword 0x0042 0x000819960008501a
patword 0x0043 0x000819960008501a
patword 0x0044 0x0008199f0008501a
patword 0x0045 0x0008199f0008501a
patword 0x0046 0x0008199f0008501a
patword 0x0047 0x0008199f0008501a
patword 0x0048 0x0008199f0008501a
patword 0x0049 0x0008199f0008501a
patword 0x004a 0x0008199f0008501a
patword 0x004b 0x0008199f0008501a
patword 0x004c 0x0008199f0008501a
patword 0x004d 0x0008199f0008501a
patword 0x004e 0x0008199f0008501a
patword 0x004f 0x0008199f0008501a
patword 0x0050 0x0008199f0008501a
patword 0x0051 0x0008199f0008501a
patword 0x0052 0x0008199f0008501a
patword 0x0053 0x0008199f0008501a
patword 0x0054 0x0008199f0008501a
patword 0x0055 0x0008199f0008501a
patword 0x0056 0x0008199f0008501a
patword 0x0057 0x0008199f0008501a
patword 0x0058 0x0008599f0008503a
patword 0x0059 0x0008599f0008503a
patword 0x005a 0x000c599f000850ba
patword 0x005b 0x000c599f000850ba
patword 0x005c 0x000c599f000850ba
patword 0x005d 0x000c599f000850ba
patword 0x005e 0x000c599f000850ba
patword 0x005f 0x000c599f000850ba
patword 0x0060 0x000c599f000850ba
patword 0x0061 0x000c599f000850ba
patword 0x0062 0x000c599f000850ba
patword 0x0063 0x000c599f000850ba
patword 0x0064 0x000c599f000850ba
patword 0x0065 0x000c599f000850ba
patword 0x0066 0x000c599f000850ba
patword 0x0067 0x000c599f000850ba
patword 0x0068 0x000c599f000850ba
patword 0x0069 0x000c599f000850ba
patword 0x006a 0x000c599f000850ba
patword 0x006b 0x000c599f000850ba
patword 0x006c 0x000c599f000850ba
patword 0x006d 0x000c599f000850ba
patword 0x006e 0x000c799f010858ba
patword 0x006f 0x000c799f010858ba
patword 0x0070 0x000c599f000850ba
patword 0x0071 0x000c599f000850ba
patword 0x0072 0x000c599f000850ba
patword 0x0073 0x000c599f000850ba
patword 0x0074 0x000c599f000850ba
patword 0x0075 0x000c599f000850ba
patword 0x0076 0x000c599f000850ba
patword 0x0077 0x000c599f000850ba
patword 0x0078 0x000c599f000850ba
patword 0x0079 0x000c599f000850ba
patword 0x007a 0x000c599f000850ba
patword 0x007b 0x000c599f000850ba
patword 0x007c 0x000c599f000850ba
patword 0x007d 0x000c599f000850ba
patword 0x007e 0x000c599f000850ba
patword 0x007f 0x000c599f000850ba
patword 0x0080 0x000c599f000850ba
patword 0x0081 0x000c599f000850ba
patword 0x0082 0x000c599f000850ba
patword 0x0083 0x000c599f000850ba
patword 0x0084 0x000c599f000850ba
patword 0x0085 0x000c599f000850ba
patword 0x0086 0x000c599f400850ba
patword 0x0087 0x000c599f400850ba
patword 0x0088 0x000c599f600850ba
patword 0x0089 0x000c599f400850ba
patword 0x008a 0x000c599f400850ba
patword 0x008b 0x000c599f400850ba
patword 0x008c 0x840c599f682e50ba
patword 0x008d 0x840c599f482850ba
patword 0x008e 0x840c599f000e50ba
patword 0x008f 0x840c599f000850ba
patword 0x0090 0x840c599f000e50ba
patword 0x0091 0x840c599f000850ba
patword 0x0092 0x840c599f000e50ba
patword 0x0093 0x840c599f000850ba
patword 0x0094 0x840c599f000e50ba
patword 0x0095 0x840c599f000850ba
patword 0x0096 0x840c599f000e50ba
patword 0x0097 0x840c599f000850ba
patword 0x0098 0x840c599f000e50ba
patword 0x0099 0x840c599f000850ba
patword 0x009a 0x840c599f000e50ba
patword 0x009b 0x840c599f000850ba
patword 0x009c 0x840c599f000e50ba
patword 0x009d 0x840c599f000850ba
patword 0x009e 0x840c599f000e50ba
patword 0x009f 0x840c599f000850ba
patword 0x00a0 0x840c599f000e50ba
patword 0x00a1 0x840c599f000850ba
patword 0x00a2 0x840c599f000e50ba
patword 0x00a3 0x840c599f000850ba
patword 0x00a4 0x840c599f000e50ba
patword 0x00a5 0x840c599f000850ba
patword 0x00a6 0x840c599f200e50ba
patword 0x00a7 0x840c599f000850ba
patword 0x00a8 0x840c599f000e50ba
patword 0x00a9 0x840c599f000850ba
patword 0x00aa 0x840c599f000e50ba
patword 0x00ab 0x840c599f000850ba
patword 0x00ac 0x840c599f000e50ba
patword 0x00ad 0x840c599f000850ba
patword 0x00ae 0x840c599f000e50ba
patword 0x00af 0x840c599f000850ba
patword 0x00b0 0x840c599f000e50ba
patword 0x00b1 0x840c599f000850ba
patword 0x00b2 0x840c599f000e50ba
patword 0x00b3 0x840c599f000850ba
patword 0x00b4 0x840c599f000e50ba
patword 0x00b5 0x840c599f000850ba
patword 0x00b6 0x840c599f000e50ba
patword 0x00b7 0x840c599f000850ba
patword 0x00b8 0x840c599f000e50ba
patword 0x00b9 0x840c599f000850ba
patword 0x00ba 0x840c599f000e50ba
patword 0x00bb 0x840c599f000850ba
patword 0x00bc 0x840c599f000e50ba
patword 0x00bd 0x840c599f000850ba
patword 0x00be 0x840c599f282e50ba
patword 0x00bf 0x840c599f082850ba
patword 0x00c0 0x840c599f000e50ba
patword 0x00c1 0x840c599f000850ba
patword 0x00c2 0x840c599f000e50ba
patword 0x00c3 0x840c599f000850ba
patword 0x00c4 0x840c599f000e50ba
patword 0x00c5 0x840c599f000850ba
patword 0x00c6 0x840c599f000e50ba
patword 0x00c7 0x840c599f000850ba
patword 0x00c8 0x840c599f000e50ba
patword 0x00c9 0x840c599f000850ba
patword 0x00ca 0x840c599f000e50ba
patword 0x00cb 0x840c599f000850ba
patword 0x00cc 0x840c599f000e50ba
patword 0x00cd 0x840c599f000850ba
patword 0x00ce 0x840c599f000e50ba
patword 0x00cf 0x840c599f000850ba
patword 0x00d0 0x840c599f000e50ba
patword 0x00d1 0x840c599f000850ba
patword 0x00d2 0x840c599f000e50ba
patword 0x00d3 0x840c599f000850ba
patword 0x00d4 0x840c599f000e50ba
patword 0x00d5 0x840c599f000850ba
patword 0x00d6 0x840c599f000e50ba
patword 0x00d7 0x840c599f000850ba
patword 0x00d8 0x840c599f200e50ba
patword 0x00d9 0x840c599f000850ba
patword 0x00da 0x840c599f000e50ba
patword 0x00db 0x840c599f000850ba
patword 0x00dc 0x840c599f000e50ba
patword 0x00dd 0x840c599f000850ba
patword 0x00de 0x840c599f000e50ba
patword 0x00df 0x840c599f000850ba
patword 0x00e0 0x840c599f000e50ba
patword 0x00e1 0x840c599f000850ba
patword 0x00e2 0x840c599f000e50ba
patword 0x00e3 0x840c599f000850ba
patword 0x00e4 0x840c599f000e50ba
patword 0x00e5 0x840c599f000850ba
patword 0x00e6 0x840c599f000e50ba
patword 0x00e7 0x840c599f000850ba
patword 0x00e8 0x840c599f000e50ba
patword 0x00e9 0x840c599f000850ba
patword 0x00ea 0x840c599f000e50ba
patword 0x00eb 0x840c599f000850ba
patword 0x00ec 0x840c599f000e50ba
patword 0x00ed 0x840c599f000850ba
patword 0x00ee 0x840c599f000e50ba
patword 0x00ef 0x840c599f000850ba
patword 0x00f0 0x040c599f000850ba
patword 0x00f1 0x040c599f000850ba
patword 0x00f2 0x000c599f000850ba
patword 0x00f3 0x000c599f000850ba
patword 0x00f4 0x0008599f200e503a
patword 0x00f5 0x0008599f0008503a
patword 0x00f6 0x0008599f200e503a
patword 0x00f7 0x0008599f0008503a
patword 0x00f8 0x0008599f0008503a
patword 0x00f9 0x0008599f0008503a
patword 0x00fa 0x0008599f0008503a
patword 0x00fb 0x0008599f0008503a
patword 0x00fc 0x0008599f0008503a
patword 0x00fd 0x0008599f0008503a
patword 0x00fe 0x0008599f0008503a
patword 0x00ff 0x0008599f0008503a
patword 0x0100 0x0008599f0008503a
patword 0x0101 0x0008599f0008503a
patword 0x0102 0x0008599f0008503a
patword 0x0103 0x0008599f0008503a
patword 0x0104 0x0008599f0008503a
patword 0x0105 0x0008599f0008503a
patword 0x0106 0x0008599f0008503a
patword 0x0107 0x0008599f0008503a
patword 0x0108 0x0008599f0008503a
patword 0x0109 0x0008599f0008503a
patword 0x010a 0x0008599f0008503a
patword 0x010b 0x0008599f0008503a
patword 0x010c 0x0008599f0008503a
patword 0x010d 0x0008599f0008503a
patword 0x010e 0x0008599f0008503a
patword 0x010f 0x0008599f0008503a
patword 0x0110 0x0008599f0008503a
patword 0x0111 0x0008599f0008503a
patioctrl 0x8f0effff6dbffdbf
patlimits 0x0000 0x0110
patloop 0 0x00be 0x00ef
patnloop 0 199
patloop 1 0x0400 0x0400
patnloop 1 0
patloop 2 0x0400 0x0400
patnloop 2 0
patwait 0 0x002e
patwaittime 0 800
patwait 1 0x0400
patwaittime 1 0
patwait 2 0x0400
patwaittime 2 0
patloop 3 0x1fff 0x1fff
patnloop 3 0
patloop 4 0x1fff 0x1fff
patnloop 4 0
patloop 5 0x1fff 0x1fff
patnloop 5 0
patwait 3 0x1fff
patwaittime 3 0
patwait 4 0x1fff
patwaittime 4 0
patwait 5 0x1fff
patwaittime 5 0

View File

@ -4,19 +4,18 @@ current_dir = $(shell pwd)
main_inc = ../slsDetectorServer/include/ main_inc = ../slsDetectorServer/include/
main_src = ../slsDetectorServer/src/ main_src = ../slsDetectorServer/src/
support_lib = ../../slsSupportLib/include/ support_lib = ../../slsSupportLib/include/
det_lib = ../../slsDetectorSoftware/include/sls/
md5_dir = ../../slsSupportLib/src/ md5_dir = ../../slsSupportLib/src/
CROSS = bfin-uclinux- CROSS = bfin-uclinux-
CC = $(CROSS)gcc CC = $(CROSS)gcc
CFLAGS += -Wall -std=gnu99 -DMOENCHD -DSTOP_SERVER -I$(main_inc) -I$(support_lib) -I$(det_lib) -I$(current_dir) #-DVERBOSEI #-DVERBOSE CFLAGS += -Wall -std=gnu99 -DMOENCHD -DSTOP_SERVER -I$(main_inc) -I$(support_lib) -I$(current_dir) #-DVERBOSEI #-DVERBOSE
LDLIBS += -lm -lrt -pthread LDLIBS += -lm -lrt -pthread
PROGS = moenchDetectorServer PROGS = moenchDetectorServer
DESTDIR ?= bin DESTDIR ?= bin
INSTMODE = 0777 INSTMODE = 0777
SRCS = slsDetectorFunctionList.c SRCS = slsDetectorFunctionList.c
SRCS += $(main_src)slsDetectorServer.c $(main_src)slsDetectorServer_funcs.c $(main_src)communication_funcs.c $(main_src)blackfin.c $(main_src)common.c $(main_src)commonServerFunctions.c $(main_src)communication_funcs_UDP.c $(main_src)UDPPacketHeaderGenerator.c $(main_src)AD9257.c $(main_src)ALTERA_PLL.c $(main_src)LTC2620.c $(main_src)MAX1932.c $(main_src)programViaBlackfin.c $(main_src)loadPattern.c $(main_src)/sharedMemory.c $(md5_dir)md5.c SRCS += $(main_src)slsDetectorServer.c $(main_src)slsDetectorServer_funcs.c $(main_src)communication_funcs.c $(main_src)blackfin.c $(main_src)common.c $(main_src)commonServerFunctions.c $(main_src)AD9257.c $(main_src)ALTERA_PLL.c $(main_src)LTC2620.c $(main_src)MAX1932.c $(main_src)programViaBlackfin.c $(main_src)/sharedMemory.c $(md5_dir)md5.c
OBJS = $(SRCS:.c=.o) OBJS = $(SRCS:.c=.o)
@ -37,10 +36,10 @@ $(PROGS): $(OBJS)
mkdir -p $(DESTDIR) mkdir -p $(DESTDIR)
$(CC) -o $@ $^ $(CFLAGS) $(LDLIBS) $(CC) -o $@ $^ $(CFLAGS) $(LDLIBS)
mv $(PROGS) $(DESTDIR) mv $(PROGS) $(DESTDIR)
cp DefaultPattern_moench.txt $(DESTDIR) cp config_moench.txt $(DESTDIR)
cp detid_moench.txt $(DESTDIR)
rm *.gdb rm *.gdb
rm $(main_src)*.o rm $(main_src)*.o $(md5_dir)*.o
rm *.o $(md5_dir)*.o
clean: clean:
rm -rf $(DESTDIR)/$(PROGS) *.o *.gdb $(main_src)*.o $(md5_dir)*.o rm -rf $(DESTDIR)/$(PROGS) *.o *.gdb $(main_src)*.o $(md5_dir)*.o

View File

@ -1,209 +1,133 @@
// SPDX-License-Identifier: LGPL-3.0-or-other // SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package // Copyright (C) 2021 Contributors to the SLS Detector Package
#pragma once #pragma once
// clang-format off
/* Definitions for FPGA*/ /* Definitions for FPGA*/
#define MEM_MAP_SHIFT 1 #define MEM_MAP_SHIFT 1
/* FPGA Version RO register */ /* FPGA Version register */
#define FPGA_VERSION_REG (0x00 << MEM_MAP_SHIFT) #define FPGA_VERSION_REG (0x00 << MEM_MAP_SHIFT)
#define FPGA_VERSION_BRD_RVSN_OFST (0) #define FPGA_COMPILATION_DATE_OFST (0)
#define FPGA_VERSION_BRD_RVSN_MSK (0x00FFFFFF << FPGA_VERSION_BRD_RVSN_OFST) #define FPGA_COMPILATION_DATE_MSK (0x00FFFFFF << FPGA_COMPILATION_DATE_OFST)
#define FPGA_VERSION_DTCTR_TYP_OFST (24) #define DETECTOR_TYPE_OFST (24)
#define FPGA_VERSION_DTCTR_TYP_MSK (0x000000FF << FPGA_VERSION_DTCTR_TYP_OFST) #define DETECTOR_TYPE_MSK (0x000000FF << DETECTOR_TYPE_OFST)
#define FPGA_VERSION_DTCTR_TYP_MOENCH_VAL \
((0x5 << FPGA_VERSION_DTCTR_TYP_OFST) & FPGA_VERSION_DTCTR_TYP_MSK)
/* Fix pattern RO register */ /* Fix pattern register */
#define FIX_PATT_REG (0x01 << MEM_MAP_SHIFT) #define FIX_PATT_REG (0x01 << MEM_MAP_SHIFT)
#define FIX_PATT_VAL (0xACDC2016) #define FIX_PATT_VAL (0xACDC2014)
/* Status RO register */ /* Status register */
#define STATUS_REG (0x02 << MEM_MAP_SHIFT) #define STATUS_REG (0x02 << MEM_MAP_SHIFT)
#define STATUS_RN_BSY_OFST (0) #define RUN_BUSY_OFST (0)
#define STATUS_RN_BSY_MSK (0x00000001 << STATUS_RN_BSY_OFST) #define RUN_BUSY_MSK (0x00000001 << RUN_BUSY_OFST)
#define STATUS_RDT_BSY_OFST (1) #define WAITING_FOR_TRIGGER_OFST (3)
#define STATUS_RDT_BSY_MSK (0x00000001 << STATUS_RDT_BSY_OFST) #define WAITING_FOR_TRIGGER_MSK (0x00000001 << WAITING_FOR_TRIGGER_OFST)
#define STATUS_ANY_FF_FLL_OFST (2) #define DELAYBEFORE_OFST (4) // Not used in software
#define STATUS_ANY_FF_FLL_MSK (0x00000001 << STATUS_ANY_FF_FLL_OFST) #define DELAYBEFORE_MSK (0x00000001 << DELAYBEFORE_OFST) // Not used in software
#define STATUS_WTNG_FR_TRGGR_OFST (3) #define DELAYAFTER_OFST (5) // Not used in software
#define STATUS_WTNG_FR_TRGGR_MSK (0x00000001 << STATUS_WTNG_FR_TRGGR_OFST) #define DELAYAFTER_MSK (0x00000001 << DELAYAFTER_OFST) // Not used in software
#define STATUS_DLY_BFR_OFST (4) #define STOPPED_OFST (15)
#define STATUS_DLY_BFR_MSK (0x00000001 << STATUS_DLY_BFR_OFST) #define STOPPED_MSK (0x00000001 << STOPPED_OFST)
#define STATUS_DLY_AFTR_OFST (5) #define RUNMACHINE_BUSY_OFST (17)
#define STATUS_DLY_AFTR_MSK (0x00000001 << STATUS_DLY_AFTR_OFST) #define RUNMACHINE_BUSY_MSK (0x00000001 << RUNMACHINE_BUSY_OFST)
#define STATUS_EXPSNG_OFST (6)
#define STATUS_EXPSNG_MSK (0x00000001 << STATUS_EXPSNG_OFST)
#define STATUS_CNT_ENBL_OFST (7)
#define STATUS_CNT_ENBL_MSK (0x00000001 << STATUS_CNT_ENBL_OFST)
#define STATUS_SM_FF_FLL_OFST (11)
#define STATUS_SM_FF_FLL_MSK (0x00000001 << STATUS_SM_FF_FLL_OFST)
#define STATUS_STPPD_OFST (15)
#define STATUS_STPPD_MSK (0x00000001 << STATUS_STPPD_OFST)
#define STATUS_ALL_FF_EMPTY_OFST (16)
#define STATUS_ALL_FF_EMPTY_MSK (0x00000001 << STATUS_ALL_FF_EMPTY_OFST)
#define STATUS_CYCL_RN_BSY_OFST (17)
#define STATUS_CYCL_RN_BSY_MSK (0x00000001 << STATUS_CYCL_RN_BSY_OFST)
#define STATUS_FRM_RN_BSY_OFST (18)
#define STATUS_FRM_RN_BSY_MSK (0x00000001 << STATUS_FRM_RN_BSY_OFST)
#define STATUS_ADC_DESERON_OFST (19)
#define STATUS_ADC_DESERON_MSK (0x00000001 << STATUS_ADC_DESERON_OFST)
#define STATUS_PLL_RCNFG_BSY_OFST (20)
#define STATUS_PLL_RCNFG_BSY_MSK (0x00000001 << STATUS_PLL_RCNFG_BSY_OFST)
#define STATUS_DT_STRMNG_BSY_OFST (21)
#define STATUS_DT_STRMNG_BSY_MSK (0x00000001 << STATUS_DT_STRMNG_BSY_OFST)
#define STATUS_FRM_PCKR_BSY_OFST (22)
#define STATUS_FRM_PCKR_BSY_MSK (0x00000001 << STATUS_FRM_PCKR_BSY_OFST)
#define STATUS_PLL_PHS_DN_OFST (23)
#define STATUS_PLL_PHS_DN_MSK (0x00000001 << STATUS_PLL_PHS_DN_OFST)
#define STATUS_PT_CNTRL_STTS_OFF_OFST (24)
#define STATUS_PT_CNTRL_STTS_OFF_MSK \
(0x000000FF << STATUS_PT_CNTRL_STTS_OFF_OFST)
#define STATUS_IDLE_MSK (0x677FF)
/* Look at me RO register TODO */ /* Look at me register */
#define LOOK_AT_ME_REG (0x03 << MEM_MAP_SHIFT) #define LOOK_AT_ME_REG (0x03 << MEM_MAP_SHIFT) // Not used in firmware or software
/* System Status RO register */ /* System Status register */
#define SYSTEM_STATUS_REG (0x04 << MEM_MAP_SHIFT) #define SYSTEM_STATUS_REG (0x04 << MEM_MAP_SHIFT) // Not used in software
#define SYSTEM_STATUS_DDR3_CLBRTN_OK_OFST (0) #define DDR3_CAL_DONE_OFST (0) // Not used in software
#define SYSTEM_STATUS_DDR3_CLBRTN_OK_MSK \ #define DDR3_CAL_DONE_MSK (0x00000001 << DDR3_CAL_DONE_OFST) // Not used in software
(0x00000001 << SYSTEM_STATUS_DDR3_CLBRTN_OK_OFST) #define DDR3_CAL_FAIL_OFST (1) // Not used in software
#define SYSTEM_STATUS_DDR3_CLBRTN_FL_OFST (1) #define DDR3_CAL_FAIL_MSK (0x00000001 << DDR3_CAL_FAIL_OFST) // Not used in software
#define SYSTEM_STATUS_DDR3_CLBRTN_FL_MSK \ #define DDR3_INIT_DONE_OFST (2) // Not used in software
(0x00000001 << SYSTEM_STATUS_DDR3_CLBRTN_FL_OFST) #define DDR3_INIT_DONE_MSK (0x00000001 << DDR3_INIT_DONE_OFST) // Not used in software
#define SYSTEM_STATUS_DDR3_INT_DN_OFST (2) #define RECONFIG_PLL_LCK_OFST (3) // Not used in software
#define SYSTEM_STATUS_DDR3_INT_DN_MSK \ #define RECONFIG_PLL_LCK_MSK (0x00000001 << RECONFIG_PLL_LCK_OFST) // Not used in software
(0x00000001 << SYSTEM_STATUS_DDR3_INT_DN_OFST) #define PLL_A_LCK_OFST (4) // Not used in software
#define SYSTEM_STATUS_RCNFG_PLL_LCK_OFST (3) #define PLL_A_LCK_MSK (0x00000001 << PLL_A_LCK_OFST) // Not used in software
#define SYSTEM_STATUS_RCNFG_PLL_LCK_MSK \ #define DD3_PLL_LCK_OFST (5) // Not used in software
(0x00000001 << SYSTEM_STATUS_RCNFG_PLL_LCK_OFST) #define DD3_PLL_LCK_MSK (0x00000001 << DD3_PLL_LCK_OFST) // Not used in software
#define SYSTEM_STATUS_PLL_A_LCK_OFST (4)
#define SYSTEM_STATUS_PLL_A_LCK_MSK (0x00000001 << SYSTEM_STATUS_PLL_A_LCK_OFST)
/* PLL Param (Reconfiguratble PLL Parameter) RO register TODO FIXME: Same as /* Module Control Board Serial Number Register */
* PLL_PARAM_REG 0x50 */ #define MOD_SERIAL_NUM_REG (0x0A << MEM_MAP_SHIFT)
//#define PLL_PARAM_REG (0x05 << MEM_MAP_SHIFT)
/* FIFO Data RO register TODO */ #define HARDWARE_SERIAL_NUM_OFST (0)
#define FIFO_DATA_REG (0x06 << MEM_MAP_SHIFT) #define HARDWARE_SERIAL_NUM_MSK (0x000000FF << HARDWARE_SERIAL_NUM_OFST)
#define HARDWARE_VERSION_NUM_OFST (16)
#define HARDWARE_VERSION_NUM_MSK (0x0000003F << HARDWARE_VERSION_NUM_OFST)
#define FIFO_DATA_HRDWR_SRL_NMBR_OFST (0) /* API Version Register */
#define FIFO_DATA_HRDWR_SRL_NMBR_MSK \
(0x0000FFFF << FIFO_DATA_HRDWR_SRL_NMBR_OFST)
//#define FIFO_DATA_WRD_OFST (16)
//#define FIFO_DATA_WRD_MSK (0x0000FFFF << FIFO_DATA_WRD_OFST)
/* FIFO Status RO register TODO */
#define FIFO_STATUS_REG (0x07 << MEM_MAP_SHIFT)
/* FIFO Empty RO register TODO */
#define FIFO_EMPTY_REG (0x08 << MEM_MAP_SHIFT)
#define FIFO_EMPTY_ALL_EMPTY_MSK (0xFFFFFFFF)
/* FIFO Full RO register TODO */
#define FIFO_FULL_REG (0x09 << MEM_MAP_SHIFT)
/* MCB Serial Number RO register */
#define MOD_SERIAL_NUMBER_REG (0x0A << MEM_MAP_SHIFT)
#define MOD_SERIAL_NUMBER_OFST (0)
#define MOD_SERIAL_NUMBER_MSK (0x000000FF << MOD_SERIAL_NUMBER_OFST)
#define MOD_SERIAL_NUMBER_VRSN_OFST (16)
#define MOD_SERIAL_NUMBER_VRSN_MSK (0x0000003F << MOD_SERIAL_NUMBER_VRSN_OFST)
/* API Version RO register */
#define API_VERSION_REG (0x0F << MEM_MAP_SHIFT) #define API_VERSION_REG (0x0F << MEM_MAP_SHIFT)
#define API_VERSION_OFST (0) #define API_VERSION_OFST (0)
#define API_VERSION_MSK (0x00FFFFFF << API_VERSION_OFST) #define API_VERSION_MSK (0x00FFFFFF << API_VERSION_OFST)
#define API_VERSION_DTCTR_TYP_OFST (24) #define API_VERSION_DETECTOR_TYPE_OFST (24) // Not used in software
#define API_VERSION_DTCTR_TYP_MSK (0x000000FF << API_VERSION_DTCTR_TYP_OFST) #define API_VERSION_DETECTOR_TYPE_MSK (0x000000FF << API_VERSION_DETECTOR_TYPE_OFST) // Not used in software
/* Time from Start 64 bit RO register. t = GCLK x 50 ns. Reset using /* Time from Start 64 bit register */
* CONTROL_CRST. TODO */
#define TIME_FROM_START_LSB_REG (0x10 << MEM_MAP_SHIFT) #define TIME_FROM_START_LSB_REG (0x10 << MEM_MAP_SHIFT)
#define TIME_FROM_START_MSB_REG (0x11 << MEM_MAP_SHIFT) #define TIME_FROM_START_MSB_REG (0x11 << MEM_MAP_SHIFT)
/* Delay Left 64 bit RO register. t = DLY x 50 ns. TODO */ /* Get Delay 64 bit register */
#define DELAY_LEFT_LSB_REG (0x12 << MEM_MAP_SHIFT) #define GET_DELAY_LSB_REG (0x12 << MEM_MAP_SHIFT) // different kind of delay
#define DELAY_LEFT_MSB_REG (0x13 << MEM_MAP_SHIFT) #define GET_DELAY_MSB_REG (0x13 << MEM_MAP_SHIFT) // different kind of delay
/* Triggers Left 64 bit RO register TODO */ /* Get Triggers 64 bit register */
#define CYCLES_LEFT_LSB_REG (0x14 << MEM_MAP_SHIFT) #define GET_CYCLES_LSB_REG (0x14 << MEM_MAP_SHIFT)
#define CYCLES_LEFT_MSB_REG (0x15 << MEM_MAP_SHIFT) #define GET_CYCLES_MSB_REG (0x15 << MEM_MAP_SHIFT)
/* Frames Left 64 bit RO register TODO */ /* Get Frames 64 bit register */
#define FRAMES_LEFT_LSB_REG (0x16 << MEM_MAP_SHIFT) #define GET_FRAMES_LSB_REG (0x16 << MEM_MAP_SHIFT)
#define FRAMES_LEFT_MSB_REG (0x17 << MEM_MAP_SHIFT) #define GET_FRAMES_MSB_REG (0x17 << MEM_MAP_SHIFT)
/* Period Left 64 bit RO register. t = T x 50 ns. TODO */ /* Get Period 64 bit register tT = T x 50 ns */
#define PERIOD_LEFT_LSB_REG (0x18 << MEM_MAP_SHIFT) #define GET_PERIOD_LSB_REG (0x18 << MEM_MAP_SHIFT)
#define PERIOD_LEFT_MSB_REG (0x19 << MEM_MAP_SHIFT) #define GET_PERIOD_MSB_REG (0x19 << MEM_MAP_SHIFT)
/* Exposure Time Left 64 bit RO register */ /** Get Temperature Carlos, incorrectl as get gates */
//#define EXPTIME_LEFT_LSB_REG (0x1A << MEM_MAP_SHIFT) // Not #define GET_TEMPERATURE_TMP112_REG (0x1c << MEM_MAP_SHIFT) // (after multiplying by 625) in 10ths of
// used in FW #define EXPTIME_LEFT_MSB_REG (0x1B << // millidegrees of TMP112
// MEM_MAP_SHIFT)
//// Not used in FW
/* Gates Left 64 bit RO register */ #define TEMPERATURE_VALUE_BIT (0)
//#define GATES_LEFT_LSB_REG (0x1C << MEM_MAP_SHIFT) // Not #define TEMPERATURE_VALUE_MSK (0x000007FF << TEMPERATURE_VALUE_BIT)
// used in FW #define GATES_LEFT_MSB_REG (0x1D << #define TEMPERATURE_POLARITY_BIT (11)
// MEM_MAP_SHIFT) #define TEMPERATURE_POLARITY_MSK (0x00000001 << TEMPERATURE_POLARITY_BIT)
//// Not used in FW
/* Data In 64 bit RO register TODO */ /* Config Status Register for chip 1.1 */
#define DATA_IN_LSB_REG (0x1E << MEM_MAP_SHIFT) #define CONFIG_V11_STATUS_REG (0x1D << MEM_MAP_SHIFT)
#define DATA_IN_MSB_REG (0x1F << MEM_MAP_SHIFT)
/* Pattern Out 64 bit RO register */ #define CONFIG_V11_STATUS_FLTR_CLL_OFST (0)
#define PATTERN_OUT_LSB_REG (0x20 << MEM_MAP_SHIFT) #define CONFIG_V11_STATUS_FLTR_CLL_MSK (0x00000FFF << CONFIG_V11_STATUS_FLTR_CLL_OFST)
#define PATTERN_OUT_MSB_REG (0x21 << MEM_MAP_SHIFT) #define CONFIG_V11_STATUS_STRG_CLL_OFST (12)
#define CONFIG_V11_STATUS_STRG_CLL_MSK (0x0000000F << CONFIG_V11_STATUS_STRG_CLL_OFST)
// CSM mode = high current (100%), low current (16%)
#define CONFIG_V11_STATUS_CRRNT_SRC_LOW_OFST (19)
#define CONFIG_V11_STATUS_CRRNT_SRC_LOW_MSK (0x00000001 << CONFIG_V11_STATUS_CRRNT_SRC_LOW_OFST)
#define CONFIG_V11_STATUS_FLTR_RSSTR_SMLR_OFST (21)
#define CONFIG_V11_STATUS_FLTR_RSSTR_SMLR_MSK (0x00000001 << CONFIG_V11_STATUS_FLTR_RSSTR_SMLR_OFST)
#define CONFIG_V11_STATUS_AUTO_MODE_OVRRD_OFST (23)
#define CONFIG_V11_STATUS_AUTO_MODE_OVRRD_MSK (0x00000001 << CONFIG_V11_STATUS_AUTO_MODE_OVRRD_OFST)
/* Frame number of next acquisition register (64 bit register) */ /* Get Frames from Start 64 bit register (frames from last reset using
#define NEXT_FRAME_NUMB_LOCAL_LSB_REG (0x22 << MEM_MAP_SHIFT) * CONTROL_CRST) */
#define NEXT_FRAME_NUMB_LOCAL_MSB_REG (0x23 << MEM_MAP_SHIFT) #define FRAMES_FROM_START_LSB_REG (0x22 << MEM_MAP_SHIFT)
#define FRAMES_FROM_START_MSB_REG (0x23 << MEM_MAP_SHIFT)
/* Frames From Start PG 64 bit RO register. Reset using CONTROL_CRST. TODO */ /* Get Starting Frame Number */
#define FRAMES_FROM_START_PG_LSB_REG (0x24 << MEM_MAP_SHIFT) #define GET_FRAME_NUMBER_LSB_REG (0x24 << MEM_MAP_SHIFT)
#define FRAMES_FROM_START_PG_MSB_REG (0x25 << MEM_MAP_SHIFT) #define GET_FRAME_NUMBER_MSB_REG (0x25 << MEM_MAP_SHIFT)
/* Start Frame Time (Measurement Time) 64 bit register (timestamp at a frame /* Measurement Time 64 bit register (timestamp at a frame start until reset)*/
* start until reset) TODO */
#define START_FRAME_TIME_LSB_REG (0x26 << MEM_MAP_SHIFT) #define START_FRAME_TIME_LSB_REG (0x26 << MEM_MAP_SHIFT)
#define START_FRAME_TIME_MSB_REG (0x27 << MEM_MAP_SHIFT) #define START_FRAME_TIME_MSB_REG (0x27 << MEM_MAP_SHIFT)
/* Power Status RO register */ /* SPI (Serial Peripheral Interface) Register */
#define POWER_STATUS_REG (0x29 << MEM_MAP_SHIFT)
#define POWER_STATUS_ALRT_OFST (27)
#define POWER_STATUS_ALRT_MSK (0x0000001F << POWER_STATUS_ALRT_OFST)
/* DAC Value Out RO register */
//#define DAC_VAL_OUT_REG (0x2A << MEM_MAP_SHIFT)
/* Slow ADC SPI Value RO register */
#define ADC_SPI_SLOW_VAL_REG (0x2B << MEM_MAP_SHIFT)
/* FIFO Digital In Status RO register */
#define FIFO_DIN_STATUS_REG (0x3B << MEM_MAP_SHIFT)
#define FIFO_DIN_STATUS_FIFO_FULL_OFST (30)
#define FIFO_DIN_STATUS_FIFO_FULL_MSK \
(0x00000001 << FIFO_DIN_STATUS_FIFO_FULL_OFST)
#define FIFO_DIN_STATUS_FIFO_EMPTY_OFST (31)
#define FIFO_DIN_STATUS_FIFO_EMPTY_MSK \
(0x00000001 << FIFO_DIN_STATUS_FIFO_EMPTY_OFST)
/* FIFO Digital In 64 bit RO register */
#define FIFO_DIN_LSB_REG (0x3C << MEM_MAP_SHIFT)
#define FIFO_DIN_MSB_REG (0x3D << MEM_MAP_SHIFT)
/* SPI (Serial Peripheral Interface) DAC, HV RW register */
#define SPI_REG (0x40 << MEM_MAP_SHIFT) #define SPI_REG (0x40 << MEM_MAP_SHIFT)
#define SPI_DAC_SRL_DGTL_OTPT_OFST (0) #define SPI_DAC_SRL_DGTL_OTPT_OFST (0)
@ -219,7 +143,7 @@
#define SPI_HV_SRL_CS_OTPT_OFST (10) #define SPI_HV_SRL_CS_OTPT_OFST (10)
#define SPI_HV_SRL_CS_OTPT_MSK (0x00000001 << SPI_HV_SRL_CS_OTPT_OFST) #define SPI_HV_SRL_CS_OTPT_MSK (0x00000001 << SPI_HV_SRL_CS_OTPT_OFST)
/* ADC SPI (Serial Peripheral Interface) RW register */ /* ADC SPI (Serial Peripheral Interface) Register */
#define ADC_SPI_REG (0x41 << MEM_MAP_SHIFT) #define ADC_SPI_REG (0x41 << MEM_MAP_SHIFT)
#define ADC_SPI_SRL_CLK_OTPT_OFST (0) #define ADC_SPI_SRL_CLK_OTPT_OFST (0)
@ -228,415 +152,341 @@
#define ADC_SPI_SRL_DT_OTPT_MSK (0x00000001 << ADC_SPI_SRL_DT_OTPT_OFST) #define ADC_SPI_SRL_DT_OTPT_MSK (0x00000001 << ADC_SPI_SRL_DT_OTPT_OFST)
#define ADC_SPI_SRL_CS_OTPT_OFST (2) #define ADC_SPI_SRL_CS_OTPT_OFST (2)
#define ADC_SPI_SRL_CS_OTPT_MSK (0x0000000F << ADC_SPI_SRL_CS_OTPT_OFST) #define ADC_SPI_SRL_CS_OTPT_MSK (0x0000000F << ADC_SPI_SRL_CS_OTPT_OFST)
#define ADC_SPI_SLOW_SRL_DT_OFST (8)
#define ADC_SPI_SLOW_SRL_DT_MSK (0x00000001 << ADC_SPI_SLOW_SRL_DT_OFST)
#define ADC_SPI_SLOW_SRL_CLK_OFST (9)
#define ADC_SPI_SLOW_SRL_CLK_MSK (0x00000001 << ADC_SPI_SLOW_SRL_CLK_OFST)
#define ADC_SPI_SLOW_SRL_CNV_OFST (10)
#define ADC_SPI_SLOW_SRL_CNV_MSK (0x00000001 << ADC_SPI_SLOW_SRL_CNV_OFST)
/* ADC Offset RW register */ /* ADC offset Register */
#define ADC_OFFSET_REG (0x42 << MEM_MAP_SHIFT) #define ADC_OFST_REG (0x42 << MEM_MAP_SHIFT)
#define ADC_OFFSET_ADC_PPLN_OFST (0) /* ADC Port Invert Register */
#define ADC_OFFSET_ADC_PPLN_MSK (0x000000FF << ADC_OFFSET_ADC_PPLN_OFST)
#define ADC_OFFSET_DBT_PPLN_OFST (16)
#define ADC_OFFSET_DBT_PPLN_MSK (0x000000FF << ADC_OFFSET_DBT_PPLN_OFST)
/* ADC Port Invert RW register */
#define ADC_PORT_INVERT_REG (0x43 << MEM_MAP_SHIFT) #define ADC_PORT_INVERT_REG (0x43 << MEM_MAP_SHIFT)
#define ADC_PORT_INVERT_0_INPT_OFST (0) #define ADC_PORT_INVERT_ADC_0_OFST (0)
#define ADC_PORT_INVERT_0_INPT_MSK (0x000000FF << ADC_PORT_INVERT_0_INPT_OFST) #define ADC_PORT_INVERT_ADC_0_MSK (0x000000FF << ADC_PORT_INVERT_ADC_0_OFST)
#define ADC_PORT_INVERT_1_INPT_OFST (8) #define ADC_PORT_INVERT_ADC_1_OFST (8)
#define ADC_PORT_INVERT_1_INPT_MSK (0x000000FF << ADC_PORT_INVERT_1_INPT_OFST) #define ADC_PORT_INVERT_ADC_1_MSK (0x000000FF << ADC_PORT_INVERT_ADC_1_OFST)
#define ADC_PORT_INVERT_2_INPT_OFST (16) #define ADC_PORT_INVERT_ADC_2_OFST (16)
#define ADC_PORT_INVERT_2_INPT_MSK (0x000000FF << ADC_PORT_INVERT_2_INPT_OFST) #define ADC_PORT_INVERT_ADC_2_MSK (0x000000FF << ADC_PORT_INVERT_ADC_2_OFST)
#define ADC_PORT_INVERT_3_INPT_OFST (24) #define ADC_PORT_INVERT_ADC_3_OFST (24)
#define ADC_PORT_INVERT_3_INPT_MSK (0x000000FF << ADC_PORT_INVERT_3_INPT_OFST) #define ADC_PORT_INVERT_ADC_3_MSK (0x000000FF << ADC_PORT_INVERT_ADC_3_OFST)
/* Dummy RW register */ /** Read N Rows Register */
#define DUMMY_REG (0x44 << MEM_MAP_SHIFT) #define READ_N_ROWS_REG (0x44 << MEM_MAP_SHIFT)
#define DUMMY_FIFO_CHNNL_SLCT_OFST (0) #define READ_N_ROWS_NUM_ROWS_OFST (0)
#define DUMMY_FIFO_CHNNL_SLCT_MSK (0x0000003F << DUMMY_FIFO_CHNNL_SLCT_OFST) #define READ_N_ROWS_NUM_ROWS_MSK (0x0000003F << READ_N_ROWS_NUM_ROWS_OFST)
#define DUMMY_ANLG_FIFO_RD_STRBE_OFST (8) #define READ_N_ROWS_ENBL_OFST (7)
#define DUMMY_ANLG_FIFO_RD_STRBE_MSK \ #define READ_N_ROWS_ENBL_MSK (0x00000001 << READ_N_ROWS_ENBL_OFST)
(0x00000001 << DUMMY_ANLG_FIFO_RD_STRBE_OFST)
#define DUMMY_DGTL_FIFO_RD_STRBE_OFST (9)
#define DUMMY_DGTL_FIFO_RD_STRBE_MSK \
(0x00000001 << DUMMY_DGTL_FIFO_RD_STRBE_OFST)
/* Receiver IP Address RW register */
#define RX_IP_REG (0x45 << MEM_MAP_SHIFT)
/* UDP Port RW register */ /* Configuration Register */
#define UDP_PORT_REG (0x46 << MEM_MAP_SHIFT)
#define UDP_PORT_RX_OFST (0)
#define UDP_PORT_RX_MSK (0x0000FFFF << UDP_PORT_RX_OFST)
#define UDP_PORT_TX_OFST (16)
#define UDP_PORT_TX_MSK (0x0000FFFF << UDP_PORT_TX_OFST)
/* Receiver Mac Address 64 bit RW register */
#define RX_MAC_LSB_REG (0x47 << MEM_MAP_SHIFT)
#define RX_MAC_MSB_REG (0x48 << MEM_MAP_SHIFT)
#define RX_MAC_LSB_OFST (0)
#define RX_MAC_LSB_MSK (0xFFFFFFFF << RX_MAC_LSB_OFST)
#define RX_MAC_MSB_OFST (0)
#define RX_MAC_MSB_MSK (0x0000FFFF << RX_MAC_MSB_OFST)
/* Detector/ Transmitter Mac Address 64 bit RW register */
#define TX_MAC_LSB_REG (0x49 << MEM_MAP_SHIFT)
#define TX_MAC_MSB_REG (0x4A << MEM_MAP_SHIFT)
#define TX_MAC_LSB_OFST (0)
#define TX_MAC_LSB_MSK (0xFFFFFFFF << TX_MAC_LSB_OFST)
#define TX_MAC_MSB_OFST (0)
#define TX_MAC_MSB_MSK (0x0000FFFF << TX_MAC_MSB_OFST)
/* Detector/ Transmitter IP Address RW register */
#define TX_IP_REG (0x4B << MEM_MAP_SHIFT)
/* Detector/ Transmitter IP Checksum RW register */
#define TX_IP_CHECKSUM_REG (0x4C << MEM_MAP_SHIFT)
#define TX_IP_CHECKSUM_OFST (0)
#define TX_IP_CHECKSUM_MSK (0x0000FFFF << TX_IP_CHECKSUM_OFST)
/* Configuration RW register */
#define CONFIG_REG (0x4D << MEM_MAP_SHIFT) #define CONFIG_REG (0x4D << MEM_MAP_SHIFT)
#define CONFIG_LED_DSBL_OFST (0) // Not used in firmware or software // readout timer (from chip) to stabilize (esp in burst acquisition mode) tRDT =
#define CONFIG_LED_DSBL_MSK (0x00000001 << CONFIG_LED_DSBL_OFST) // (RDT + 1) * 25ns
#define CONFIG_DSBL_ANLG_OTPT_OFST (8) #define CONFIG_RDT_TMR_OFST (0)
#define CONFIG_DSBL_ANLG_OTPT_MSK (0x00000001 << CONFIG_DSBL_ANLG_OTPT_OFST) #define CONFIG_RDT_TMR_MSK (0x0000FFFF << CONFIG_RDT_TMR_OFST)
#define CONFIG_ENBLE_DGTL_OTPT_OFST (9) // if 0, outer is the primary interface
#define CONFIG_ENBLE_DGTL_OTPT_MSK (0x00000001 << CONFIG_ENBLE_DGTL_OTPT_OFST) // bottom via port 0 (outer)
#define CONFIG_GB10_SND_UDP_OFST (12) #define CONFIG_OPRTN_MDE_2_X_10GbE_OFST (16)
#define CONFIG_GB10_SND_UDP_MSK (0x00000001 << CONFIG_GB10_SND_UDP_OFST) #define CONFIG_OPRTN_MDE_2_X_10GbE_MSK (0x00000001 << CONFIG_OPRTN_MDE_2_X_10GbE_OFST)
#define CONFIG_INNR_PRIMRY_INTRFCE_OFST (17)
#define CONFIG_INNR_PRIMRY_INTRFCE_MSK (0x00000001 << CONFIG_INNR_PRIMRY_INTRFCE_OFST)
#define CONFIG_READOUT_SPEED_OFST (20)
#define CONFIG_READOUT_SPEED_MSK (0x00000003 << CONFIG_READOUT_SPEED_OFST)
#define CONFIG_QUARTER_SPEED_10MHZ_VAL ((0x0 << CONFIG_READOUT_SPEED_OFST) & CONFIG_READOUT_SPEED_MSK)
#define CONFIG_HALF_SPEED_20MHZ_VAL ((0x1 << CONFIG_READOUT_SPEED_OFST) & CONFIG_READOUT_SPEED_MSK)
#define CONFIG_FULL_SPEED_40MHZ_VAL ((0x2 << CONFIG_READOUT_SPEED_OFST) & CONFIG_READOUT_SPEED_MSK)
#define CONFIG_TDMA_ENABLE_OFST (24)
#define CONFIG_TDMA_ENABLE_MSK (0x00000001 << CONFIG_TDMA_ENABLE_OFST)
#define CONFIG_TDMA_TIMESLOT_OFST (25) // 1ms
#define CONFIG_TDMA_TIMESLOT_MSK (0x0000001F << CONFIG_TDMA_TIMESLOT_OFST)
#define CONFIG_BOTTOM_INVERT_STREAM_OFST (30)
#define CONFIG_BOTTOM_INVERT_STREAM_MSK (0x00000001 << CONFIG_BOTTOM_INVERT_STREAM_OFST)
#define CONFIG_ETHRNT_FLW_CNTRL_OFST (31)
#define CONFIG_ETHRNT_FLW_CNTRL_MSK (0x00000001 << CONFIG_ETHRNT_FLW_CNTRL_OFST)
/* External Signal RW register */ /* External Signal Register */
#define EXT_SIGNAL_REG (0x4E << MEM_MAP_SHIFT) #define EXT_SIGNAL_REG (0x4E << MEM_MAP_SHIFT)
#define EXT_SIGNAL_OFST (0) #define EXT_SIGNAL_OFST (0)
#define EXT_SIGNAL_MSK (0x00000001 << EXT_SIGNAL_OFST) #define EXT_SIGNAL_MSK (0x00000001 << EXT_SIGNAL_OFST)
#define EXT_SIGNAL_AUTO_VAL ((0x0 << EXT_SIGNAL_OFST) & EXT_SIGNAL_MSK) #define EXT_SYNC_OFST (4)
#define EXT_SIGNAL_TRGGR_VAL ((0x1 << EXT_SIGNAL_OFST) & EXT_SIGNAL_MSK) #define EXT_SYNC_MSK (0x00000001 << EXT_SYNC_OFST)
/* Control RW register */ /* Control Register */
#define CONTROL_REG (0x4F << MEM_MAP_SHIFT) #define CONTROL_REG (0x4F << MEM_MAP_SHIFT)
#define CONTROL_STRT_ACQSTN_OFST (0) #define CONTROL_START_ACQ_OFST (0)
#define CONTROL_STRT_ACQSTN_MSK (0x00000001 << CONTROL_STRT_ACQSTN_OFST) #define CONTROL_START_ACQ_MSK (0x00000001 << CONTROL_START_ACQ_OFST)
#define CONTROL_STP_ACQSTN_OFST (1) #define CONTROL_STOP_ACQ_OFST (1)
#define CONTROL_STP_ACQSTN_MSK (0x00000001 << CONTROL_STP_ACQSTN_OFST) #define CONTROL_STOP_ACQ_MSK (0x00000001 << CONTROL_STOP_ACQ_OFST)
//#define CONTROL_STRT_FF_TST_OFST (2) #define CONTROL_SOFTWARE_TRIGGER_OFST (2)
//#define CONTROL_STRT_FF_TST_MSK (0x00000001 << #define CONTROL_SOFTWARE_TRIGGER_MSK (0x00000001 << CONTROL_SOFTWARE_TRIGGER_OFST)
// CONTROL_STRT_FF_TST_OFST) #define CONTROL_STP_FF_TST_OFST (3) #define CONTROL_CORE_RST_OFST (10)
//#define CONTROL_STP_FF_TST_MSK (0x00000001 << #define CONTROL_CORE_RST_MSK (0x00000001 << CONTROL_CORE_RST_OFST)
// CONTROL_STP_FF_TST_OFST) #define CONTROL_STRT_RDT_OFST (4) #define CONTROL_PERIPHERAL_RST_OFST (11) // DDR3 HMem Ctrlr, GBE, Temp
//#define CONTROL_STRT_RDT_MSK (0x00000001 << #define CONTROL_PERIPHERAL_RST_MSK (0x00000001 << CONTROL_PERIPHERAL_RST_OFST) // DDR3 HMem Ctrlr, GBE, Temp
// CONTROL_STRT_RDT_OFST) #define CONTROL_STP_RDT_OFST (5) #define CONTROL_DDR3_MEM_RST_OFST (12) // only PHY, not DDR3 PLL ,Not used in software
// #define CONTROL_STP_RDT_MSK (0x00000001 << #define CONTROL_DDR3_MEM_RST_MSK (0x00000001 << CONTROL_DDR3_MEM_RST_OFST) // only PHY, not DDR3 PLL ,Not used in software
// CONTROL_STP_RDT_OFST) #define CONTROL_ACQ_FIFO_CLR_OFST (14)
#define CONTROL_STRT_EXPSR_OFST (6) #define CONTROL_ACQ_FIFO_CLR_MSK (0x00000001 << CONTROL_ACQ_FIFO_CLR_OFST)
#define CONTROL_STRT_EXPSR_MSK (0x00000001 << CONTROL_STRT_EXPSR_OFST) #define CONTROL_MASTER_OFST (15)
//#define CONTROL_STP_EXPSR_OFST (7) #define CONTROL_MASTER_MSK (0x00000001 << CONTROL_MASTER_OFST)
//#define CONTROL_STP_EXPSR_MSK (0x00000001 << #define CONTROL_STORAGE_CELL_NUM_OFST (16)
// CONTROL_STP_RDT_OFST) #define CONTROL_STRT_TRN_OFST (8) #define #define CONTROL_STORAGE_CELL_NUM_MSK (0x0000000F << CONTROL_STORAGE_CELL_NUM_OFST)
// CONTROL_STRT_TRN_MSK (0x00000001 << CONTROL_STRT_RDT_OFST) #define CONTROL_RX_ADDTNL_ENDPTS_NUM_OFST (20)
//#define CONTROL_STP_TRN_OFST (9) #define CONTROL_RX_ADDTNL_ENDPTS_NUM_MSK (0x0000003F << CONTROL_RX_ADDTNL_ENDPTS_NUM_OFST)
//#define CONTROL_STP_TRN_MSK (0x00000001 << #define CONTROL_RX_ENDPTS_START_OFST (26)
// CONTROL_STP_RDT_OFST) #define CONTROL_RX_ENDPTS_START_MSK (0x0000003F << CONTROL_RX_ENDPTS_START_OFST)
#define CONTROL_CRE_RST_OFST (10)
#define CONTROL_CRE_RST_MSK (0x00000001 << CONTROL_CRE_RST_OFST)
#define CONTROL_PRPHRL_RST_OFST (11) // Only GBE10?
#define CONTROL_PRPHRL_RST_MSK (0x00000001 << CONTROL_PRPHRL_RST_OFST)
#define CONTROL_MMRY_RST_OFST (12)
#define CONTROL_MMRY_RST_MSK (0x00000001 << CONTROL_MMRY_RST_OFST)
//#define CONTROL_PLL_RCNFG_WR_OFST (13)
//#define CONTROL_PLL_RCNFG_WR_MSK (0x00000001 <<
// CONTROL_PLL_RCNFG_WR_OFST)
#define CONTROL_SND_10GB_PCKT_OFST (14)
#define CONTROL_SND_10GB_PCKT_MSK (0x00000001 << CONTROL_SND_10GB_PCKT_OFST)
#define CONTROL_CLR_ACQSTN_FIFO_OFST (15)
#define CONTROL_CLR_ACQSTN_FIFO_MSK (0x00000001 << CONTROL_CLR_ACQSTN_FIFO_OFST)
/* Reconfiguratble PLL Paramater RW register */ /* Reconfiguratble PLL Paramater Register */
#define PLL_PARAM_REG (0x50 << MEM_MAP_SHIFT) #define PLL_PARAM_REG (0x50 << MEM_MAP_SHIFT)
/* Reconfiguratble PLL Control RW regiser */ /* Reconfiguratble PLL Control Regiser */
#define PLL_CNTRL_REG (0x51 << MEM_MAP_SHIFT) #define PLL_CNTRL_REG (0x51 << MEM_MAP_SHIFT)
#define PLL_CNTRL_RCNFG_PRMTR_RST_OFST (0) #define PLL_CNTRL_RCNFG_PRMTR_RST_OFST (0) // parameter reset
#define PLL_CNTRL_RCNFG_PRMTR_RST_MSK \ #define PLL_CNTRL_RCNFG_PRMTR_RST_MSK (0x00000001 << PLL_CNTRL_RCNFG_PRMTR_RST_OFST) // parameter reset
(0x00000001 << PLL_CNTRL_RCNFG_PRMTR_RST_OFST)
#define PLL_CNTRL_WR_PRMTR_OFST (2) #define PLL_CNTRL_WR_PRMTR_OFST (2)
#define PLL_CNTRL_WR_PRMTR_MSK (0x00000001 << PLL_CNTRL_WR_PRMTR_OFST) #define PLL_CNTRL_WR_PRMTR_MSK (0x00000001 << PLL_CNTRL_WR_PRMTR_OFST)
#define PLL_CNTRL_PLL_RST_OFST (3) #define PLL_CNTRL_PLL_RST_OFST (3)
#define PLL_CNTRL_PLL_RST_MSK (0x00000001 << PLL_CNTRL_PLL_RST_OFST) #define PLL_CNTRL_PLL_RST_MSK (0x00000001 << PLL_CNTRL_PLL_RST_OFST)
#define PLL_CNTRL_DBIT_WR_PRMTR_OFST (5)
#define PLL_CNTRL_DBIT_WR_PRMTR_MSK (0x00000001 << PLL_CNTRL_DBIT_WR_PRMTR_OFST)
#define PLL_CNTRL_ADDR_OFST (16) #define PLL_CNTRL_ADDR_OFST (16)
#define PLL_CNTRL_ADDR_MSK (0x0000003F << PLL_CNTRL_ADDR_OFST) #define PLL_CNTRL_ADDR_MSK (0x0000003F << PLL_CNTRL_ADDR_OFST)
/* Pattern Control RW register */ /* Config Register for chip 1.1 */
#define PATTERN_CNTRL_REG (0x52 << MEM_MAP_SHIFT) #define CONFIG_V11_REG (0x58 << MEM_MAP_SHIFT)
#define PATTERN_CNTRL_WR_OFST (0) #define CONFIG_V11_FLTR_CLL_OFST (0)
#define PATTERN_CNTRL_WR_MSK (0x00000001 << PATTERN_CNTRL_WR_OFST) #define CONFIG_V11_FLTR_CLL_MSK (0x00000FFF << CONFIG_V11_FLTR_CLL_OFST)
#define PATTERN_CNTRL_RD_OFST (1) #define CONFIG_V11_STRG_CLL_OFST (12)
#define PATTERN_CNTRL_RD_MSK (0x00000001 << PATTERN_CNTRL_RD_OFST) #define CONFIG_V11_STRG_CLL_MSK (0x0000000F << CONFIG_V11_STRG_CLL_OFST)
#define PATTERN_CNTRL_ADDR_OFST (16) // CSM mode = high current (100%), low current (16%)
#define PATTERN_CNTRL_ADDR_MSK (0x00001FFF << PATTERN_CNTRL_ADDR_OFST) #define CONFIG_V11_CRRNT_SRC_LOW_OFST (19)
#define CONFIG_V11_CRRNT_SRC_LOW_MSK (0x00000001 << CONFIG_V11_CRRNT_SRC_LOW_OFST)
#define CONFIG_V11_FLTR_RSSTR_SMLR_OFST (21)
#define CONFIG_V11_FLTR_RSSTR_SMLR_MSK (0x00000001 << CONFIG_V11_FLTR_RSSTR_SMLR_OFST)
#define CONFIG_V11_AUTO_MODE_OVRRD_OFST (23)
#define CONFIG_V11_AUTO_MODE_OVRRD_MSK (0x00000001 << CONFIG_V11_AUTO_MODE_OVRRD_OFST)
/* Pattern Limit RW regiser */ /* Sample Register */
#define PATTERN_LIMIT_REG (0x53 << MEM_MAP_SHIFT) #define SAMPLE_REG (0x59 << MEM_MAP_SHIFT)
#define PATTERN_LIMIT_STRT_OFST (0) #define SAMPLE_ADC_SAMPLE_SEL_OFST (0)
#define PATTERN_LIMIT_STRT_MSK (0x00001FFF << PATTERN_LIMIT_STRT_OFST) #define SAMPLE_ADC_SAMPLE_SEL_MSK (0x00000007 << SAMPLE_ADC_SAMPLE_SEL_OFST)
#define PATTERN_LIMIT_STP_OFST (16) #define SAMPLE_ADC_SAMPLE_0_VAL ((0x0 << SAMPLE_ADC_SAMPLE_SEL_OFST) & SAMPLE_ADC_SAMPLE_SEL_MSK)
#define PATTERN_LIMIT_STP_MSK (0x00001FFF << PATTERN_LIMIT_STP_OFST) #define SAMPLE_ADC_SAMPLE_1_VAL ((0x1 << SAMPLE_ADC_SAMPLE_SEL_OFST) & SAMPLE_ADC_SAMPLE_SEL_MSK)
#define SAMPLE_ADC_SAMPLE_2_VAL ((0x2 << SAMPLE_ADC_SAMPLE_SEL_OFST) & SAMPLE_ADC_SAMPLE_SEL_MSK)
#define SAMPLE_ADC_SAMPLE_3_VAL ((0x3 << SAMPLE_ADC_SAMPLE_SEL_OFST) & SAMPLE_ADC_SAMPLE_SEL_MSK)
#define SAMPLE_ADC_SAMPLE_4_VAL ((0x4 << SAMPLE_ADC_SAMPLE_SEL_OFST) & SAMPLE_ADC_SAMPLE_SEL_MSK)
#define SAMPLE_ADC_SAMPLE_5_VAL ((0x5 << SAMPLE_ADC_SAMPLE_SEL_OFST) & SAMPLE_ADC_SAMPLE_SEL_MSK)
#define SAMPLE_ADC_SAMPLE_6_VAL ((0x6 << SAMPLE_ADC_SAMPLE_SEL_OFST) & SAMPLE_ADC_SAMPLE_SEL_MSK)
#define SAMPLE_ADC_SAMPLE_7_VAL ((0x7 << SAMPLE_ADC_SAMPLE_SEL_OFST) & SAMPLE_ADC_SAMPLE_SEL_MSK)
// Decimation = ADF + 1
#define SAMPLE_ADC_DECMT_FACTOR_OFST (4)
#define SAMPLE_ADC_DECMT_FACTOR_MSK (0x00000007 << SAMPLE_ADC_DECMT_FACTOR_OFST)
#define SAMPLE_ADC_DECMT_FACTOR_0_VAL ((0x0 << SAMPLE_ADC_DECMT_FACTOR_OFST) & SAMPLE_ADC_DECMT_FACTOR_MSK)
#define SAMPLE_ADC_DECMT_FACTOR_1_VAL ((0x1 << SAMPLE_ADC_DECMT_FACTOR_OFST) & SAMPLE_ADC_DECMT_FACTOR_MSK)
#define SAMPLE_ADC_DECMT_FACTOR_2_VAL ((0x2 << SAMPLE_ADC_DECMT_FACTOR_OFST) & SAMPLE_ADC_DECMT_FACTOR_MSK)
#define SAMPLE_ADC_DECMT_FACTOR_3_VAL ((0x3 << SAMPLE_ADC_DECMT_FACTOR_OFST) & SAMPLE_ADC_DECMT_FACTOR_MSK)
#define SAMPLE_ADC_DECMT_FACTOR_4_VAL ((0x4 << SAMPLE_ADC_DECMT_FACTOR_OFST) & SAMPLE_ADC_DECMT_FACTOR_MSK)
#define SAMPLE_ADC_DECMT_FACTOR_5_VAL ((0x5 << SAMPLE_ADC_DECMT_FACTOR_OFST) & SAMPLE_ADC_DECMT_FACTOR_MSK)
#define SAMPLE_ADC_DECMT_FACTOR_6_VAL ((0x6 << SAMPLE_ADC_DECMT_FACTOR_OFST) & SAMPLE_ADC_DECMT_FACTOR_MSK)
#define SAMPLE_ADC_DECMT_FACTOR_7_VAL ((0x7 << SAMPLE_ADC_DECMT_FACTOR_OFST) & SAMPLE_ADC_DECMT_FACTOR_MSK)
/* Pattern Loop 0 Address RW regiser */ #define SAMPLE_DGTL_SAMPLE_SEL_OFST (8)
#define PATTERN_LOOP_0_ADDR_REG (0x54 << MEM_MAP_SHIFT) #define SAMPLE_DGTL_SAMPLE_SEL_MSK (0x0000000F << SAMPLE_DGTL_SAMPLE_SEL_OFST)
#define SAMPLE_DGTL_SAMPLE_0_VAL ((0x0 << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
#define SAMPLE_DGTL_SAMPLE_1_VAL ((0x1 << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
#define SAMPLE_DGTL_SAMPLE_2_VAL ((0x2 << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
#define SAMPLE_DGTL_SAMPLE_3_VAL ((0x3 << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
#define SAMPLE_DGTL_SAMPLE_4_VAL ((0x4 << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
#define SAMPLE_DGTL_SAMPLE_5_VAL ((0x5 << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
#define SAMPLE_DGTL_SAMPLE_6_VAL ((0x6 << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
#define SAMPLE_DGTL_SAMPLE_7_VAL ((0x7 << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
#define SAMPLE_DGTL_SAMPLE_8_VAL ((0x8 << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
#define SAMPLE_DGTL_SAMPLE_9_VAL ((0x9 << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
#define SAMPLE_DGTL_SAMPLE_10_VAL ((0xa << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
#define SAMPLE_DGTL_SAMPLE_11_VAL ((0xb << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
#define SAMPLE_DGTL_SAMPLE_12_VAL ((0xc << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
#define SAMPLE_DGTL_SAMPLE_13_VAL ((0xd << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
#define SAMPLE_DGTL_SAMPLE_14_VAL ((0xe << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
#define SAMPLE_DGTL_SAMPLE_15_VAL ((0xf << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
#define PATTERN_LOOP_0_ADDR_STRT_OFST (0) #define SAMPLE_DGTL_DECMT_FACTOR_OFST (12)
#define PATTERN_LOOP_0_ADDR_STRT_MSK \ #define SAMPLE_DGTL_DECMT_FACTOR_MSK (0x00000003 << SAMPLE_DGTL_DECMT_FACTOR_OFST)
(0x00001FFF << PATTERN_LOOP_0_ADDR_STRT_OFST) #define SAMPLE_DECMT_FACTOR_FULL_VAL ((0x0 << SAMPLE_DGTL_DECMT_FACTOR_OFST) & SAMPLE_DGTL_DECMT_FACTOR_MSK)
#define PATTERN_LOOP_0_ADDR_STP_OFST (16) #define SAMPLE_DECMT_FACTOR_HALF_VAL ((0x1 << SAMPLE_DGTL_DECMT_FACTOR_OFST) & SAMPLE_DGTL_DECMT_FACTOR_MSK)
#define PATTERN_LOOP_0_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_0_ADDR_STP_OFST) #define SAMPLE_DECMT_FACTOR_QUARTER_VAL ((0x2 << SAMPLE_DGTL_DECMT_FACTOR_OFST) & SAMPLE_DGTL_DECMT_FACTOR_MSK)
/* Pattern Loop 0 Iteration RW regiser */ /** Current Source Column 0 (0 - 31)) */
#define PATTERN_LOOP_0_ITERATION_REG (0x55 << MEM_MAP_SHIFT) #define CRRNT_SRC_COL_LSB_REG (0x5A << MEM_MAP_SHIFT)
/* Pattern Loop 1 Address RW regiser */ /** Current Source Column 1 (32 - 63) */
#define PATTERN_LOOP_1_ADDR_REG (0x56 << MEM_MAP_SHIFT) #define CRRNT_SRC_COL_MSB_REG (0x5B << MEM_MAP_SHIFT)
#define PATTERN_LOOP_1_ADDR_STRT_OFST (0) /** Vref Comp Mod Register */
#define PATTERN_LOOP_1_ADDR_STRT_MSK \ #define EXT_DAQ_CTRL_REG (0x5C << MEM_MAP_SHIFT)
(0x00001FFF << PATTERN_LOOP_1_ADDR_STRT_OFST)
#define PATTERN_LOOP_1_ADDR_STP_OFST (16)
#define PATTERN_LOOP_1_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_1_ADDR_STP_OFST)
/* Pattern Loop 1 Iteration RW regiser */ #define EXT_DAQ_CTRL_VREF_COMP_OFST (0)
#define PATTERN_LOOP_1_ITERATION_REG (0x57 << MEM_MAP_SHIFT) #define EXT_DAQ_CTRL_VREF_COMP_MSK (0x00000FFF << EXT_DAQ_CTRL_VREF_COMP_OFST)
#define EXT_DAQ_CTRL_CMP_LGC_ENBL_OFST (15)
#define EXT_DAQ_CTRL_CMP_LGC_ENBL_MSK (0x00000001 << EXT_DAQ_CTRL_CMP_LGC_ENBL_OFST)
#define EXT_DAQ_CTRL_INPT_DETECT_OFST (16)
#define EXT_DAQ_CTRL_INPT_DETECT_MSK (0x00000007 << EXT_DAQ_CTRL_INPT_DETECT_OFST)
#define EXT_DAQ_CTRL_INPT_DETECT_ENBL_OFST (19)
#define EXT_DAQ_CTRL_INPT_DETECT_ENBL_MSK (0x00000001 << EXT_DAQ_CTRL_INPT_DETECT_ENBL_OFST)
/* Pattern Loop 2 Address RW regiser */ /** DAQ Register */
#define PATTERN_LOOP_2_ADDR_REG (0x58 << MEM_MAP_SHIFT) #define DAQ_REG (0x5D << MEM_MAP_SHIFT)
#define PATTERN_LOOP_2_ADDR_STRT_OFST (0) // dynamic gain (default)
#define PATTERN_LOOP_2_ADDR_STRT_MSK \ #define DAQ_HIGH_GAIN_OFST (0)
(0x00001FFF << PATTERN_LOOP_2_ADDR_STRT_OFST) #define DAQ_HIGH_GAIN_MSK (0x00000001 << DAQ_HIGH_GAIN_OFST)
#define PATTERN_LOOP_2_ADDR_STP_OFST (16) #define DAQ_FIX_GAIN_OFST (1)
#define PATTERN_LOOP_2_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_2_ADDR_STP_OFST) #define DAQ_FIX_GAIN_MSK (0x00000003 << DAQ_FIX_GAIN_OFST)
#define DAQ_FIX_GAIN_STG_1_VAL ((0x1 << DAQ_FIX_GAIN_OFST) & DAQ_FIX_GAIN_MSK)
#define DAQ_FIX_GAIN_STG_2_VAL ((0x3 << DAQ_FIX_GAIN_OFST) & DAQ_FIX_GAIN_MSK)
#define DAQ_CMP_RST_OFST (4)
#define DAQ_CMP_RST_MSK (0x00000001 << DAQ_CMP_RST_OFST)
#define DAQ_CHIP11_VRSN_OFST (7)
#define DAQ_CHIP11_VRSN_MSK (0x00000001 << DAQ_CHIP11_VRSN_OFST)
#define DAQ_STRG_CELL_SLCT_OFST (8)
#define DAQ_STRG_CELL_SLCT_MSK (0x0000000F << DAQ_STRG_CELL_SLCT_OFST)
#define DAQ_FRCE_SWTCH_GAIN_OFST (12)
#define DAQ_FRCE_SWTCH_GAIN_MSK (0x00000003 << DAQ_FRCE_SWTCH_GAIN_OFST)
#define DAQ_FRCE_GAIN_STG_0_VAL ((0x0 << DAQ_FRCE_SWTCH_GAIN_OFST) & DAQ_FRCE_SWTCH_GAIN_MSK)
#define DAQ_FRCE_GAIN_STG_1_VAL ((0x1 << DAQ_FRCE_SWTCH_GAIN_OFST) & DAQ_FRCE_SWTCH_GAIN_MSK)
#define DAQ_FRCE_GAIN_STG_2_VAL ((0x3 << DAQ_FRCE_SWTCH_GAIN_OFST) & DAQ_FRCE_SWTCH_GAIN_MSK)
#define DAQ_ELCTRN_CLLCTN_MDE_OFST (14)
#define DAQ_ELCTRN_CLLCTN_MDE_MSK (0x00000001 << DAQ_ELCTRN_CLLCTN_MDE_OFST)
#define DAQ_G2_CNNT_OFST (15)
#define DAQ_G2_CNNT_MSK (0x00000001 << DAQ_G2_CNNT_OFST)
#define DAQ_CRRNT_SRC_ENBL_OFST (16)
#define DAQ_CRRNT_SRC_ENBL_MSK (0x00000001 << DAQ_CRRNT_SRC_ENBL_OFST)
#define DAQ_CRRNT_SRC_CLMN_FIX_OFST (17)
#define DAQ_CRRNT_SRC_CLMN_FIX_MSK (0x00000001 << DAQ_CRRNT_SRC_CLMN_FIX_OFST)
#define DAQ_CRRNT_SRC_CLMN_SLCT_OFST (20)
#define DAQ_CRRNT_SRC_CLMN_SLCT_MSK (0x0000003F << DAQ_CRRNT_SRC_CLMN_SLCT_OFST)
#define DAQ_GAIN_MODE_MASK (DAQ_FRCE_SWTCH_GAIN_MSK | DAQ_FIX_GAIN_MSK | DAQ_CMP_RST_MSK)
/* Pattern Loop 2 Iteration RW regiser */ /** Chip Power Register */
#define PATTERN_LOOP_2_ITERATION_REG (0x59 << MEM_MAP_SHIFT) #define CHIP_POWER_REG (0x5E << MEM_MAP_SHIFT)
/* Pattern Wait 0 RW regiser */ #define CHIP_POWER_ENABLE_OFST (0)
#define PATTERN_WAIT_0_ADDR_REG (0x5A << MEM_MAP_SHIFT) #define CHIP_POWER_ENABLE_MSK (0x00000001 << CHIP_POWER_ENABLE_OFST)
#define CHIP_POWER_STATUS_OFST (1)
#define CHIP_POWER_STATUS_MSK (0x00000001 << CHIP_POWER_STATUS_OFST)
#define PATTERN_WAIT_0_ADDR_OFST (0) /** Temperature Control Register */
#define PATTERN_WAIT_0_ADDR_MSK (0x00001FFF << PATTERN_WAIT_0_ADDR_OFST) #define TEMP_CTRL_REG (0x5F << MEM_MAP_SHIFT)
// FIXME: is mask 3FF
/* Pattern Wait 1 RW regiser */ #define TEMP_CTRL_PROTCT_THRSHLD_OFST (0)
#define PATTERN_WAIT_1_ADDR_REG (0x5B << MEM_MAP_SHIFT) #define TEMP_CTRL_PROTCT_THRSHLD_MSK (0x000007FF << TEMP_CTRL_PROTCT_THRSHLD_OFST)
#define TEMP_CTRL_PROTCT_ENABLE_OFST (16)
#define TEMP_CTRL_PROTCT_ENABLE_MSK (0x00000001 << TEMP_CTRL_PROTCT_ENABLE_OFST)
// set when temp higher than over threshold, write 1 to clear it
#define TEMP_CTRL_OVR_TMP_EVNT_OFST (31)
#define TEMP_CTRL_OVR_TMP_EVNT_MSK (0x00000001 << TEMP_CTRL_OVR_TMP_EVNT_OFST)
#define PATTERN_WAIT_1_ADDR_OFST (0) /* Set Delay 64 bit register */
#define PATTERN_WAIT_1_ADDR_MSK (0x00001FFF << PATTERN_WAIT_1_ADDR_OFST) #define SET_DELAY_LSB_REG (0x60 << MEM_MAP_SHIFT) // different kind of delay
#define SET_DELAY_MSB_REG (0x61 << MEM_MAP_SHIFT) // different kind of delay
/* Pattern Wait 2 RW regiser */ /* Set Triggers 64 bit register */
#define PATTERN_WAIT_2_ADDR_REG (0x5C << MEM_MAP_SHIFT) #define SET_CYCLES_LSB_REG (0x62 << MEM_MAP_SHIFT)
#define SET_CYCLES_MSB_REG (0x63 << MEM_MAP_SHIFT)
#define PATTERN_WAIT_2_ADDR_OFST (0) /* Set Frames 64 bit register */
#define PATTERN_WAIT_2_ADDR_MSK (0x00001FFF << PATTERN_WAIT_2_ADDR_OFST) #define SET_FRAMES_LSB_REG (0x64 << MEM_MAP_SHIFT)
#define SET_FRAMES_MSB_REG (0x65 << MEM_MAP_SHIFT)
/* Samples RW register */ /* Set Period 64 bit register tT = T x 50 ns */
#define SAMPLES_REG (0x5D << MEM_MAP_SHIFT) #define SET_PERIOD_LSB_REG (0x66 << MEM_MAP_SHIFT)
#define SET_PERIOD_MSB_REG (0x67 << MEM_MAP_SHIFT)
#define SAMPLES_DIGITAL_OFST (0) /* Set Exptime 64 bit register eEXP = Exp x 25 ns */
#define SAMPLES_DIGITAL_MSK (0x0000FFFF << SAMPLES_DIGITAL_OFST) #define SET_EXPTIME_LSB_REG (0x68 << MEM_MAP_SHIFT)
#define SAMPLES_ANALOG_OFST (16) #define SET_EXPTIME_MSB_REG (0x69 << MEM_MAP_SHIFT)
#define SAMPLES_ANALOG_MSK (0x0000FFFF << SAMPLES_ANALOG_OFST)
/** Power RW register */ /* Starting Frame number 64 bit register */
#define POWER_REG (0x5E << MEM_MAP_SHIFT) #define FRAME_NUMBER_LSB_REG (0x6A << MEM_MAP_SHIFT)
#define FRAME_NUMBER_MSB_REG (0x6B << MEM_MAP_SHIFT)
#define POWER_CHIP_OFST (16) /* Comparator disable time (chipv1.1) 32 bit register tT = T x 25 ns
#define POWER_CHIP_MSK (0x00000001 << POWER_CHIP_OFST) Time before end of exposure when comparator is disabled */
#define POWER_HV_INTERNAL_SLCT_OFST (31) #define COMP_DSBLE_TIME_REG (0x6C << MEM_MAP_SHIFT)
#define POWER_HV_INTERNAL_SLCT_MSK (0x00000001 << POWER_HV_INTERNAL_SLCT_OFST)
/* Number of Words RW register TODO */
#define NUMBER_OF_WORDS_REG (0x5F << MEM_MAP_SHIFT)
/* Delay 64 bit RW register. t = DLY x 50 ns. */ /* Trigger Delay 32 bit register */
#define DELAY_LSB_REG (0x60 << MEM_MAP_SHIFT) #define SET_TRIGGER_DELAY_LSB_REG (0x70 << MEM_MAP_SHIFT)
#define DELAY_MSB_REG (0x61 << MEM_MAP_SHIFT) #define SET_TRIGGER_DELAY_MSB_REG (0x71 << MEM_MAP_SHIFT)
/* Triggers 64 bit RW register */ /** Module row coordinates */
#define CYCLES_LSB_REG (0x62 << MEM_MAP_SHIFT) #define COORD_ROW_REG (0x7C << MEM_MAP_SHIFT)
#define CYCLES_MSB_REG (0x63 << MEM_MAP_SHIFT)
/* Frames 64 bit RW register */ #define COORD_ROW_OUTER_OFST (0)
#define FRAMES_LSB_REG (0x64 << MEM_MAP_SHIFT) #define COORD_ROW_OUTER_MSK (0x0000FFFF << COORD_ROW_OUTER_OFST)
#define FRAMES_MSB_REG (0x65 << MEM_MAP_SHIFT) #define COORD_ROW_INNER_OFST (16)
#define COORD_ROW_INNER_MSK (0x0000FFFF << COORD_ROW_INNER_OFST)
/* Period 64 bit RW register */ /** Module column coordinates */
#define PERIOD_LSB_REG (0x66 << MEM_MAP_SHIFT) #define COORD_COL_REG (0x7D << MEM_MAP_SHIFT)
#define PERIOD_MSB_REG (0x67 << MEM_MAP_SHIFT)
/* Period 64 bit RW register */ #define COORD_COL_OUTER_OFST (0)
//#define EXPTIME_LSB_REG (0x68 << MEM_MAP_SHIFT) // #define COORD_COL_OUTER_MSK (0x0000FFFF << COORD_COL_OUTER_OFST)
// Not used in FW #define EXPTIME_MSB_REG (0x69 << #define COORD_COL_INNER_OFST (16)
// MEM_MAP_SHIFT) // Not used in FW #define COORD_COL_INNER_MSK (0x0000FFFF << COORD_COL_INNER_OFST)
/* Gates 64 bit RW register */ /** Module ID coordinates */
//#define GATES_LSB_REG (0x6A << MEM_MAP_SHIFT) // Not used #define MOD_ID_REG (0x7E << MEM_MAP_SHIFT)
// in FW #define GATES_MSB_REG (0x6B << MEM_MAP_SHIFT) //
// Not used in FW
/* Pattern IO Control 64 bit RW regiser #define MOD_ID_OFST (0)
* Each bit configured as output(1)/ input(0) */ #define MOD_ID_MSK (0x0000FFFF << MOD_ID_OFST)
#define PATTERN_IO_CNTRL_LSB_REG (0x6C << MEM_MAP_SHIFT)
#define PATTERN_IO_CNTRL_MSB_REG (0x6D << MEM_MAP_SHIFT)
/* Pattern IO Clock Control 64 bit RW regiser /* ASIC Control Register */
* When bit n enabled (1), clocked output for DIO[n] (T run clock) #define ASIC_CTRL_REG (0x7F << MEM_MAP_SHIFT)
* When bit n disabled (0), Dio[n] driven by its pattern output */ // tPC = (PCT + 1) * 25ns
#define PATTERN_IO_CLK_CNTRL_LSB_REG (0x6E << MEM_MAP_SHIFT) #define ASIC_CTRL_PRCHRG_TMR_OFST (0)
#define PATTERN_IO_CLK_CNTRL_MSB_REG (0x6F << MEM_MAP_SHIFT) #define ASIC_CTRL_PRCHRG_TMR_MSK (0x000000FF << ASIC_CTRL_PRCHRG_TMR_OFST)
#define ASIC_CTRL_PRCHRG_TMR_VAL ((0x1F << ASIC_CTRL_PRCHRG_TMR_OFST) & ASIC_CTRL_PRCHRG_TMR_MSK)
// tDS = (DST + 1) * 25ns
#define ASIC_CTRL_DS_TMR_OFST (8)
#define ASIC_CTRL_DS_TMR_MSK (0x000000FF << ASIC_CTRL_DS_TMR_OFST)
#define ASIC_CTRL_DS_TMR_VAL ((0x1F << ASIC_CTRL_DS_TMR_OFST) & ASIC_CTRL_DS_TMR_MSK)
#define ASIC_CTRL_DS_TMR_CHIP1_1_VAL ((0xFF << ASIC_CTRL_DS_TMR_OFST) & ASIC_CTRL_DS_TMR_MSK)
// tET = (ET + 1) * 25ns (increase timeout range between 2 consecutive storage
// cells)
#define ASIC_CTRL_EXPSRE_TMR_OFST (16)
#define ASIC_CTRL_EXPSRE_TMR_MSK (0x0000FFFF << ASIC_CTRL_EXPSRE_TMR_OFST)
#define ASIC_CTRL_EXPSRE_TMR_MAX_VAL (0x0000FFFF / (CLK_RUN * 1E-3))
/* Pattern In 64 bit RW register */ /* ADC 0 Deserializer Control */
#define PATTERN_IN_LSB_REG (0x70 << MEM_MAP_SHIFT) #define ADC_DSRLZR_0_REG (0xF0 << MEM_MAP_SHIFT)
#define PATTERN_IN_MSB_REG (0x71 << MEM_MAP_SHIFT) #define ADC_DSRLZR_0_RFRSH_ALGNMNT_OFST (31) /* Refresh alignment */
#define ADC_DSRLZR_0_RFRSH_ALGNMNT_MSK (0x00000001 << ADC_DSRLZR_0_RFRSH_ALGNMNT_OFST)
/* Pattern Wait Timer 0 64 bit RW register. t = PWT1 x T run clock */ /* ADC 0 Deserializer Control */
#define PATTERN_WAIT_TIMER_0_LSB_REG (0x72 << MEM_MAP_SHIFT) #define ADC_DSRLZR_1_REG (0xF1 << MEM_MAP_SHIFT)
#define PATTERN_WAIT_TIMER_0_MSB_REG (0x73 << MEM_MAP_SHIFT) #define ADC_DSRLZR_1_RFRSH_ALGNMNT_OFST (31)
#define ADC_DSRLZR_1_RFRSH_ALGNMNT_MSK (0x00000001 << ADC_DSRLZR_1_RFRSH_ALGNMNT_OFST)
/* Pattern Wait Timer 1 64 bit RW register. t = PWT2 x T run clock */ /* ADC 0 Deserializer Control */
#define PATTERN_WAIT_TIMER_1_LSB_REG (0x74 << MEM_MAP_SHIFT) #define ADC_DSRLZR_2_REG (0xF2 << MEM_MAP_SHIFT)
#define PATTERN_WAIT_TIMER_1_MSB_REG (0x75 << MEM_MAP_SHIFT) #define ADC_DSRLZR_2_RFRSH_ALGNMNT_OFST (31)
#define ADC_DSRLZR_2_RFRSH_ALGNMNT_MSK (0x00000001 << ADC_DSRLZR_2_RFRSH_ALGNMNT_OFST)
/* Pattern Wait Timer 2 64 bit RW register. t = PWT3 x T run clock */ /* ADC 0 Deserializer Control */
#define PATTERN_WAIT_TIMER_2_LSB_REG (0x76 << MEM_MAP_SHIFT) #define ADC_DSRLZR_3_REG (0xF3 << MEM_MAP_SHIFT)
#define PATTERN_WAIT_TIMER_2_MSB_REG (0x77 << MEM_MAP_SHIFT) #define ADC_DSRLZR_3_RFRSH_ALGNMNT_OFST (31)
#define ADC_DSRLZR_3_RFRSH_ALGNMNT_MSK (0x00000001 << ADC_DSRLZR_3_RFRSH_ALGNMNT_OFST)
/* Readout enable RW register */
#define READOUT_10G_ENABLE_REG (0x79 << MEM_MAP_SHIFT)
#define READOUT_10G_ENABLE_ANLG_OFST (0)
#define READOUT_10G_ENABLE_ANLG_MSK (0x000000FF << READOUT_10G_ENABLE_ANLG_OFST)
#define READOUT_10G_ENABLE_DGTL_OFST (8)
#define READOUT_10G_ENABLE_DGTL_MSK (0x00000001 << READOUT_10G_ENABLE_DGTL_OFST)
/* Digital Bit External Trigger RW register */
#define DBIT_EXT_TRG_REG \
(0x7B << MEM_MAP_SHIFT) // Not used in firmware or software
#define DBIT_EXT_TRG_SRC_OFST (0)
#define DBIT_EXT_TRG_SRC_MSK (0x0000003F << DBIT_EXT_TRG_SRC_OFST)
#define DBIT_EXT_TRG_OPRTN_MD_OFST (16)
#define DBIT_EXT_TRG_OPRTN_MD_MSK (0x00000001 << DBIT_EXT_TRG_OPRTN_MD_OFST)
/* Pin Delay 0 RW register */
#define OUTPUT_DELAY_0_REG \
(0x7C << MEM_MAP_SHIFT) // Not used in firmware or software
#define OUTPUT_DELAY_0_OTPT_STTNG_STEPS (25)
#define OUTPUT_DELAY_0_OTPT_STTNG_OFST \
(0) // t = OTPT_STTNG * 25 ps, max for Cyclone V = 775 ps
#define OUTPUT_DELAY_0_OTPT_STTNG_MSK \
(0x0000001F << OUTPUT_DELAY_0_OTPT_STTNG_OFST)
// 1: load dynamic output settings, 0: trigger start of dynamic output delay
// configuration pn falling edge of ODT (output delay trigger) bit
#define OUTPUT_DELAY_0_OTPT_TRGGR_OFST (31)
#define OUTPUT_DELAY_0_OTPT_TRGGR_MSK \
(0x00000001 << OUTPUT_DELAY_0_OTPT_TRGGR_OFST)
#define OUTPUT_DELAY_0_OTPT_TRGGR_LD_VAL (1)
#define OUTPUT_DELAY_0_OTPT_TRGGR_STRT_VAL (0)
/* Pin Delay 1 RW register
* Each bit configured as enable for dynamic output delay configuration */
#define PIN_DELAY_1_REG \
(0x7D << MEM_MAP_SHIFT) // Not used in firmware or software
/** Pattern Mask 64 bit RW regiser */
#define PATTERN_MASK_LSB_REG (0x80 << MEM_MAP_SHIFT)
#define PATTERN_MASK_MSB_REG (0x81 << MEM_MAP_SHIFT)
/** Pattern Set 64 bit RW regiser */
#define PATTERN_SET_LSB_REG (0x82 << MEM_MAP_SHIFT)
#define PATTERN_SET_MSB_REG (0x83 << MEM_MAP_SHIFT)
/* Pattern Loop 3 Address RW regiser */
#define PATTERN_LOOP_3_ADDR_REG (0x84 << MEM_MAP_SHIFT)
#define PATTERN_LOOP_3_ADDR_STRT_OFST (0)
#define PATTERN_LOOP_3_ADDR_STRT_MSK \
(0x00001FFF << PATTERN_LOOP_3_ADDR_STRT_OFST)
#define PATTERN_LOOP_3_ADDR_STP_OFST (16)
#define PATTERN_LOOP_3_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_3_ADDR_STP_OFST)
/* Pattern Loop 3 Iteration RW regiser */
#define PATTERN_LOOP_3_ITERATION_REG (0x85 << MEM_MAP_SHIFT)
/* Pattern Loop 4 Address RW regiser */
#define PATTERN_LOOP_4_ADDR_REG (0x86 << MEM_MAP_SHIFT)
#define PATTERN_LOOP_4_ADDR_STRT_OFST (0)
#define PATTERN_LOOP_4_ADDR_STRT_MSK \
(0x00001FFF << PATTERN_LOOP_4_ADDR_STRT_OFST)
#define PATTERN_LOOP_4_ADDR_STP_OFST (16)
#define PATTERN_LOOP_4_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_4_ADDR_STP_OFST)
/* Pattern Loop 4 Iteration RW regiser */
#define PATTERN_LOOP_4_ITERATION_REG (0x87 << MEM_MAP_SHIFT)
/* Pattern Loop 5 Address RW regiser */
#define PATTERN_LOOP_5_ADDR_REG (0x88 << MEM_MAP_SHIFT)
#define PATTERN_LOOP_5_ADDR_STRT_OFST (0)
#define PATTERN_LOOP_5_ADDR_STRT_MSK \
(0x00001FFF << PATTERN_LOOP_5_ADDR_STRT_OFST)
#define PATTERN_LOOP_5_ADDR_STP_OFST (16)
#define PATTERN_LOOP_5_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_5_ADDR_STP_OFST)
/* Pattern Loop 5 Iteration RW regiser */
#define PATTERN_LOOP_5_ITERATION_REG (0x89 << MEM_MAP_SHIFT)
/* Pattern Wait 3 RW regiser */
#define PATTERN_WAIT_3_ADDR_REG (0x8A << MEM_MAP_SHIFT)
#define PATTERN_WAIT_3_ADDR_OFST (0)
#define PATTERN_WAIT_3_ADDR_MSK (0x00001FFF << PATTERN_WAIT_3_ADDR_OFST)
/* Pattern Wait 4 RW regiser */
#define PATTERN_WAIT_4_ADDR_REG (0x8B << MEM_MAP_SHIFT)
#define PATTERN_WAIT_4_ADDR_OFST (0)
#define PATTERN_WAIT_4_ADDR_MSK (0x00001FFF << PATTERN_WAIT_4_ADDR_OFST)
/* Pattern Wait 5 RW regiser */
#define PATTERN_WAIT_5_ADDR_REG (0x8C << MEM_MAP_SHIFT)
#define PATTERN_WAIT_5_ADDR_OFST (0)
#define PATTERN_WAIT_5_ADDR_MSK (0x00001FFF << PATTERN_WAIT_5_ADDR_OFST)
/* Pattern Wait Timer 3 64 bit RW register. t = PWT1 x T run clock */
#define PATTERN_WAIT_TIMER_3_LSB_REG (0x8D << MEM_MAP_SHIFT)
#define PATTERN_WAIT_TIMER_3_MSB_REG (0x8E << MEM_MAP_SHIFT)
/* Pattern Wait Timer 4 64 bit RW register. t = PWT1 x T run clock */
#define PATTERN_WAIT_TIMER_4_LSB_REG (0x8F << MEM_MAP_SHIFT)
#define PATTERN_WAIT_TIMER_4_MSB_REG (0x90 << MEM_MAP_SHIFT)
/* Pattern Wait Timer 5 64 bit RW register. t = PWT1 x T run clock */
#define PATTERN_WAIT_TIMER_5_LSB_REG (0x91 << MEM_MAP_SHIFT)
#define PATTERN_WAIT_TIMER_5_MSB_REG (0x92 << MEM_MAP_SHIFT)
/* Round Robin */ /* Round Robin */
#define RXR_ENDPOINT_START_REG (0x1000 << MEM_MAP_SHIFT) #define RXR_ENDPOINTS_MAX (64)
#define RXR_ENDPOINT_OUTER_START_REG (0x1000 << MEM_MAP_SHIFT)
#define RXR_ENDPOINT_INNER_START_REG (0x2000 << MEM_MAP_SHIFT)
#define RXR_ENDPOINT_OFST (0x10 << MEM_MAP_SHIFT)
// clang-format on

View File

@ -1,301 +0,0 @@
patword 0x0000 0x0008599f0418503a
patword 0x0001 0x0008599f0418503a
patword 0x0002 0x000859960418503a
patword 0x0003 0x000859960418503a
patword 0x0004 0x000859960418503a
patword 0x0005 0x000859960418503a
patword 0x0006 0x000859960418503a
patword 0x0007 0x000859960418503a
patword 0x0008 0x000859960418503a
patword 0x0009 0x000859960418503a
patword 0x000a 0x000859960418503a
patword 0x000b 0x000859960418503a
patword 0x000c 0x000859960418503a
patword 0x000d 0x000859960418503a
patword 0x000e 0x000859960418503a
patword 0x000f 0x000859960418503a
patword 0x0010 0x000859960418503a
patword 0x0011 0x000859960418503a
patword 0x0012 0x000859960418503a
patword 0x0013 0x000859960418503a
patword 0x0014 0x000859960418503a
patword 0x0015 0x000859960418503a
patword 0x0016 0x000819960418501a
patword 0x0017 0x000819960418501a
patword 0x0018 0x000819960418501a
patword 0x0019 0x000819960418501a
patword 0x001a 0x000819960418501a
patword 0x001b 0x000819960418501a
patword 0x001c 0x000819960418501a
patword 0x001d 0x000819960418501a
patword 0x001e 0x000819960418501a
patword 0x001f 0x000819960418501a
patword 0x0020 0x000819960418501a
patword 0x0021 0x000819960418501a
patword 0x0022 0x000819960418501a
patword 0x0023 0x000819960418501a
patword 0x0024 0x000819960418501a
patword 0x0025 0x000819960418501a
patword 0x0026 0x000819960418501a
patword 0x0027 0x000819960418501a
patword 0x0028 0x000819960418501a
patword 0x0029 0x000819960418501a
patword 0x002a 0x000819960418501a
patword 0x002b 0x000819960418501a
patword 0x002c 0x000819960418501a
patword 0x002d 0x000819960418501a
patword 0x002e 0x000819960418501a
patword 0x002f 0x000819960418501a
patword 0x0030 0x000819960008501a
patword 0x0031 0x000819960008501a
patword 0x0032 0x000819960008501a
patword 0x0033 0x000819960008501a
patword 0x0034 0x000819960008501a
patword 0x0035 0x000819960008501a
patword 0x0036 0x000819960008501a
patword 0x0037 0x000819960008501a
patword 0x0038 0x000819960008501a
patword 0x0039 0x000819960008501a
patword 0x003a 0x000819960008501a
patword 0x003b 0x000819960008501a
patword 0x003c 0x000819960008501a
patword 0x003d 0x000819960008501a
patword 0x003e 0x000819960008501a
patword 0x003f 0x000819960008501a
patword 0x0040 0x000819960008501a
patword 0x0041 0x000819960008501a
patword 0x0042 0x000819960008501a
patword 0x0043 0x000819960008501a
patword 0x0044 0x0008199f0008501a
patword 0x0045 0x0008199f0008501a
patword 0x0046 0x0008199f0008501a
patword 0x0047 0x0008199f0008501a
patword 0x0048 0x0008199f0008501a
patword 0x0049 0x0008199f0008501a
patword 0x004a 0x0008199f0008501a
patword 0x004b 0x0008199f0008501a
patword 0x004c 0x0008199f0008501a
patword 0x004d 0x0008199f0008501a
patword 0x004e 0x0008199f0008501a
patword 0x004f 0x0008199f0008501a
patword 0x0050 0x0008199f0008501a
patword 0x0051 0x0008199f0008501a
patword 0x0052 0x0008199f0008501a
patword 0x0053 0x0008199f0008501a
patword 0x0054 0x0008199f0008501a
patword 0x0055 0x0008199f0008501a
patword 0x0056 0x0008199f0008501a
patword 0x0057 0x0008199f0008501a
patword 0x0058 0x0008599f0008503a
patword 0x0059 0x0008599f0008503a
patword 0x005a 0x000c599f000850ba
patword 0x005b 0x000c599f000850ba
patword 0x005c 0x000c599f000850ba
patword 0x005d 0x000c599f000850ba
patword 0x005e 0x000c599f000850ba
patword 0x005f 0x000c599f000850ba
patword 0x0060 0x000c599f000850ba
patword 0x0061 0x000c599f000850ba
patword 0x0062 0x000c599f000850ba
patword 0x0063 0x000c599f000850ba
patword 0x0064 0x000c599f000850ba
patword 0x0065 0x000c599f000850ba
patword 0x0066 0x000c599f000850ba
patword 0x0067 0x000c599f000850ba
patword 0x0068 0x000c599f000850ba
patword 0x0069 0x000c599f000850ba
patword 0x006a 0x000c599f000850ba
patword 0x006b 0x000c599f000850ba
patword 0x006c 0x000c599f000850ba
patword 0x006d 0x000c599f000850ba
patword 0x006e 0x000c799f010858ba
patword 0x006f 0x000c799f010858ba
patword 0x0070 0x000c599f000850ba
patword 0x0071 0x000c599f000850ba
patword 0x0072 0x000c599f000850ba
patword 0x0073 0x000c599f000850ba
patword 0x0074 0x000c599f000850ba
patword 0x0075 0x000c599f000850ba
patword 0x0076 0x000c599f000850ba
patword 0x0077 0x000c599f000850ba
patword 0x0078 0x000c599f000850ba
patword 0x0079 0x000c599f000850ba
patword 0x007a 0x000c599f000850ba
patword 0x007b 0x000c599f000850ba
patword 0x007c 0x000c599f000850ba
patword 0x007d 0x000c599f000850ba
patword 0x007e 0x000c599f000850ba
patword 0x007f 0x000c599f000850ba
patword 0x0080 0x000c599f000850ba
patword 0x0081 0x000c599f000850ba
patword 0x0082 0x000c599f000850ba
patword 0x0083 0x000c599f000850ba
patword 0x0084 0x000c599f000850ba
patword 0x0085 0x000c599f000850ba
patword 0x0086 0x000c599f400850ba
patword 0x0087 0x000c599f400850ba
patword 0x0088 0x000c599f600850ba
patword 0x0089 0x000c599f400850ba
patword 0x008a 0x000c599f400850ba
patword 0x008b 0x000c599f400850ba
patword 0x008c 0x840c599f682e50ba
patword 0x008d 0x840c599f482850ba
patword 0x008e 0x840c599f000e50ba
patword 0x008f 0x840c599f000850ba
patword 0x0090 0x840c599f000e50ba
patword 0x0091 0x840c599f000850ba
patword 0x0092 0x840c599f000e50ba
patword 0x0093 0x840c599f000850ba
patword 0x0094 0x840c599f000e50ba
patword 0x0095 0x840c599f000850ba
patword 0x0096 0x840c599f000e50ba
patword 0x0097 0x840c599f000850ba
patword 0x0098 0x840c599f000e50ba
patword 0x0099 0x840c599f000850ba
patword 0x009a 0x840c599f000e50ba
patword 0x009b 0x840c599f000850ba
patword 0x009c 0x840c599f000e50ba
patword 0x009d 0x840c599f000850ba
patword 0x009e 0x840c599f000e50ba
patword 0x009f 0x840c599f000850ba
patword 0x00a0 0x840c599f000e50ba
patword 0x00a1 0x840c599f000850ba
patword 0x00a2 0x840c599f000e50ba
patword 0x00a3 0x840c599f000850ba
patword 0x00a4 0x840c599f000e50ba
patword 0x00a5 0x840c599f000850ba
patword 0x00a6 0x840c599f200e50ba
patword 0x00a7 0x840c599f000850ba
patword 0x00a8 0x840c599f000e50ba
patword 0x00a9 0x840c599f000850ba
patword 0x00aa 0x840c599f000e50ba
patword 0x00ab 0x840c599f000850ba
patword 0x00ac 0x840c599f000e50ba
patword 0x00ad 0x840c599f000850ba
patword 0x00ae 0x840c599f000e50ba
patword 0x00af 0x840c599f000850ba
patword 0x00b0 0x840c599f000e50ba
patword 0x00b1 0x840c599f000850ba
patword 0x00b2 0x840c599f000e50ba
patword 0x00b3 0x840c599f000850ba
patword 0x00b4 0x840c599f000e50ba
patword 0x00b5 0x840c599f000850ba
patword 0x00b6 0x840c599f000e50ba
patword 0x00b7 0x840c599f000850ba
patword 0x00b8 0x840c599f000e50ba
patword 0x00b9 0x840c599f000850ba
patword 0x00ba 0x840c599f000e50ba
patword 0x00bb 0x840c599f000850ba
patword 0x00bc 0x840c599f000e50ba
patword 0x00bd 0x840c599f000850ba
patword 0x00be 0x840c599f282e50ba
patword 0x00bf 0x840c599f082850ba
patword 0x00c0 0x840c599f000e50ba
patword 0x00c1 0x840c599f000850ba
patword 0x00c2 0x840c599f000e50ba
patword 0x00c3 0x840c599f000850ba
patword 0x00c4 0x840c599f000e50ba
patword 0x00c5 0x840c599f000850ba
patword 0x00c6 0x840c599f000e50ba
patword 0x00c7 0x840c599f000850ba
patword 0x00c8 0x840c599f000e50ba
patword 0x00c9 0x840c599f000850ba
patword 0x00ca 0x840c599f000e50ba
patword 0x00cb 0x840c599f000850ba
patword 0x00cc 0x840c599f000e50ba
patword 0x00cd 0x840c599f000850ba
patword 0x00ce 0x840c599f000e50ba
patword 0x00cf 0x840c599f000850ba
patword 0x00d0 0x840c599f000e50ba
patword 0x00d1 0x840c599f000850ba
patword 0x00d2 0x840c599f000e50ba
patword 0x00d3 0x840c599f000850ba
patword 0x00d4 0x840c599f000e50ba
patword 0x00d5 0x840c599f000850ba
patword 0x00d6 0x840c599f000e50ba
patword 0x00d7 0x840c599f000850ba
patword 0x00d8 0x840c599f200e50ba
patword 0x00d9 0x840c599f000850ba
patword 0x00da 0x840c599f000e50ba
patword 0x00db 0x840c599f000850ba
patword 0x00dc 0x840c599f000e50ba
patword 0x00dd 0x840c599f000850ba
patword 0x00de 0x840c599f000e50ba
patword 0x00df 0x840c599f000850ba
patword 0x00e0 0x840c599f000e50ba
patword 0x00e1 0x840c599f000850ba
patword 0x00e2 0x840c599f000e50ba
patword 0x00e3 0x840c599f000850ba
patword 0x00e4 0x840c599f000e50ba
patword 0x00e5 0x840c599f000850ba
patword 0x00e6 0x840c599f000e50ba
patword 0x00e7 0x840c599f000850ba
patword 0x00e8 0x840c599f000e50ba
patword 0x00e9 0x840c599f000850ba
patword 0x00ea 0x840c599f000e50ba
patword 0x00eb 0x840c599f000850ba
patword 0x00ec 0x840c599f000e50ba
patword 0x00ed 0x840c599f000850ba
patword 0x00ee 0x840c599f000e50ba
patword 0x00ef 0x840c599f000850ba
patword 0x00f0 0x040c599f000850ba
patword 0x00f1 0x040c599f000850ba
patword 0x00f2 0x000c599f000850ba
patword 0x00f3 0x000c599f000850ba
patword 0x00f4 0x0008599f200e503a
patword 0x00f5 0x0008599f0008503a
patword 0x00f6 0x0008599f200e503a
patword 0x00f7 0x0008599f0008503a
patword 0x00f8 0x0008599f0008503a
patword 0x00f9 0x0008599f0008503a
patword 0x00fa 0x0008599f0008503a
patword 0x00fb 0x0008599f0008503a
patword 0x00fc 0x0008599f0008503a
patword 0x00fd 0x0008599f0008503a
patword 0x00fe 0x0008599f0008503a
patword 0x00ff 0x0008599f0008503a
patword 0x0100 0x0008599f0008503a
patword 0x0101 0x0008599f0008503a
patword 0x0102 0x0008599f0008503a
patword 0x0103 0x0008599f0008503a
patword 0x0104 0x0008599f0008503a
patword 0x0105 0x0008599f0008503a
patword 0x0106 0x0008599f0008503a
patword 0x0107 0x0008599f0008503a
patword 0x0108 0x0008599f0008503a
patword 0x0109 0x0008599f0008503a
patword 0x010a 0x0008599f0008503a
patword 0x010b 0x0008599f0008503a
patword 0x010c 0x0008599f0008503a
patword 0x010d 0x0008599f0008503a
patword 0x010e 0x0008599f0008503a
patword 0x010f 0x0008599f0008503a
patword 0x0110 0x0008599f0008503a
patword 0x0111 0x0008599f0008503a
patioctrl 0x8f0effff6dbffdbf
patlimits 0x0000 0x0110
patloop 0 0x00be 0x00ef
patnloop 0 199
patloop 1 0x0400 0x0400
patnloop 1 0
patloop 2 0x0400 0x0400
patnloop 2 0
patwait 0 0x002e
patwaittime 0 800
patwait 1 0x0400
patwaittime 1 0
patwait 2 0x0400
patwaittime 2 0
patloop 3 0x1fff 0x1fff
patnloop 3 0
patloop 4 0x1fff 0x1fff
patnloop 4 0
patloop 5 0x1fff 0x1fff
patnloop 5 0
patwait 3 0x1fff
patwaittime 3 0
patwait 4 0x1fff
patwaittime 4 0
patwait 5 0x1fff
patwaittime 5 0

View File

@ -0,0 +1,4 @@
#chip version version (multiplied by 10)
chipversion 11

View File

@ -0,0 +1 @@
1234

View File

@ -4,18 +4,147 @@
#include "RegisterDefs.h" #include "RegisterDefs.h"
#include "sls/sls_detector_defs.h" #include "sls/sls_detector_defs.h"
#define MIN_REQRD_VRSN_T_RD_API 0x180314 #define REQRD_FRMWRE_VRSN_BOARD2 0x221130 // 1.0 pcb (version = 010)
#define REQRD_FRMWR_VRSN 0x221205 #define REQRD_FRMWRE_VRSN 0x221130 // 2.0 pcb (version = 011)
#define NUM_HARDWARE_VERSIONS (1) #define NUM_HARDWARE_VERSIONS (2)
#define HARDWARE_VERSION_NUMBERS \ #define HARDWARE_VERSION_NUMBERS \
{ 0x1 } { 0x2, 0x3 }
#define HARDWARE_VERSION_NAMES \ #define HARDWARE_VERSION_NAMES \
{ "1.0" } { "1.0", "2.0" }
#define ID_FILE ("detid_moench.txt")
#define CONFIG_FILE ("config_moench.txt")
#define LINKED_SERVER_NAME "moenchDetectorServer" #define LINKED_SERVER_NAME "moenchDetectorServer"
#define CTRL_SRVR_INIT_TIME_US (2 * 1000 * 1000) #define CTRL_SRVR_INIT_TIME_US (300 * 1000)
/* Hardware Definitions */
#define NCHAN (400 * 400)
#define NCHIP (1)
#define NDAC (8)
#define DYNAMIC_RANGE (16)
#define NUM_BYTES_PER_PIXEL (DYNAMIC_RANGE / 8)
#define DATA_BYTES (NCHIP * NCHAN * NUM_BYTES_PER_PIXEL)
#define CLK_RUN (40) // MHz
#define CLK_SYNC (20) // MHz
#define ADC_CLK_INDEX (1)
#define DBIT_CLK_INDEX (0)
/** Default Parameters */
#define DEFAULT_NUM_FRAMES (1)
#define DEFAULT_STARTING_FRAME_NUMBER (1)
#define DEFAULT_NUM_CYCLES (1)
#define DEFAULT_EXPTIME (10 * 1000) // ns
#define DEFAULT_PERIOD (2 * 1000 * 1000) // ns
#define DEFAULT_DELAY (0)
#define DEFAULT_HIGH_VOLTAGE (0)
#define DEFAULT_TIMING_MODE (AUTO_TIMING)
#define DEFAULT_SETTINGS (GAIN0)
#define DEFAULT_GAINMODE (DYNAMIC)
#define DEFAULT_TX_UDP_PORT (0x7e9a)
#define DEFAULT_TMP_THRSHLD (65 * 1000) // milli degree Celsius
#define DEFAULT_NUM_STRG_CLLS (0)
#define DEFAULT_STRG_CLL_STRT (0xf)
#define DEFAULT_STRG_CLL_STRT_CHIP11 (0x3)
#define DEFAULT_STRG_CLL_DLY (0)
#define DEFAULT_FLIP_ROWS (0)
#define DEFAULT_FILTER_RESISTOR (1) // higher resistor
#define DEFAULT_FILTER_CELL (0)
#define HIGHVOLTAGE_MIN (60)
#define HIGHVOLTAGE_MAX (200)
#define DAC_MIN_MV (0)
#define DAC_MAX_MV (2500)
#define MAX_FILTER_CELL_VAL (12)
#define READ_N_ROWS_MULTIPLE (16) // 400 rows/50packets * 2 interfaces
#define MIN_ROWS_PER_READOUT (16)
#define MAX_ROWS_PER_READOUT (400)
#define ROWS_PER_PACKET (8)
/* Defines in the Firmware */
#define MAX_TIMESLOT_VAL (0x1F)
#define MAX_THRESHOLD_TEMP_VAL (127999) // millidegrees
#define MAX_STORAGE_CELL_VAL (15) // 0xF
#define MAX_STORAGE_CELL_CHIP11_VAL (3)
#define MAX_STORAGE_CELL_DLY_NS_VAL (ASIC_CTRL_EXPSRE_TMR_MAX_VAL)
#define ACQ_TIME_MIN_CLOCK (2)
#define ASIC_FILTER_MAX_RES_VALUE (1)
#define MAX_SELECT_CHIP10_VAL (63)
#define MAX_PHASE_SHIFTS (240)
#define BIT16_MASK (0xFFFF)
#define GAIN_VAL_OFST (14)
#define GAIN_VAL_MSK (0x3 << GAIN_VAL_OFST)
// pipeline
#define ADC_PORT_INVERT_VAL (0x5A5A5A5A)
#define ADC_PORT_INVERT_BOARD2_VAL (0x453b2a9c)
// 2.0 pcb (chipv1.1)
#define SAMPLE_ADC_FULL_SPEED_CHIP11 \
(SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_0_VAL + \
SAMPLE_DGTL_SAMPLE_0_VAL + SAMPLE_DECMT_FACTOR_FULL_VAL) // 0x0000
#define SAMPLE_ADC_HALF_SPEED_CHIP11 \
(SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_1_VAL + \
SAMPLE_DGTL_SAMPLE_1_VAL + SAMPLE_DECMT_FACTOR_HALF_VAL) // 0x1110
#define SAMPLE_ADC_QUARTER_SPEED_CHIP11 \
(SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_3_VAL + \
SAMPLE_DGTL_SAMPLE_2_VAL + SAMPLE_DECMT_FACTOR_QUARTER_VAL) // 0x2230
#define ADC_PHASE_FULL_SPEED_CHIP11 (160)
#define ADC_PHASE_HALF_SPEED_CHIP11 (160)
#define ADC_PHASE_QUARTER_SPEED_CHIP11 (160)
#define DBIT_PHASE_FULL_SPEED_CHIP11 (80)
#define DBIT_PHASE_HALF_SPEED_CHIP11 (135)
#define DBIT_PHASE_QUARTER_SPEED_CHIP11 (135)
#define ADC_OFST_FULL_SPEED_VAL_CHIP11 (0x10)
#define ADC_OFST_HALF_SPEED_VAL_CHIP11 (0x08)
#define ADC_OFST_QUARTER_SPEED_VAL_CHIP11 (0x04)
// 2.0 pcb (chipv1.0)
#define SAMPLE_ADC_FULL_SPEED_CHIP10 \
(SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_0_VAL + \
SAMPLE_DGTL_SAMPLE_1_VAL + SAMPLE_DECMT_FACTOR_FULL_VAL) // 0x0100
#define SAMPLE_ADC_HALF_SPEED_CHIP10 \
(SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_1_VAL + \
SAMPLE_DGTL_SAMPLE_3_VAL + SAMPLE_DECMT_FACTOR_HALF_VAL) // 0x1310
#define SAMPLE_ADC_QUARTER_SPEED_CHIP10 \
(SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_3_VAL + \
SAMPLE_DGTL_SAMPLE_6_VAL + SAMPLE_DECMT_FACTOR_QUARTER_VAL) // 0x2630
#define ADC_PHASE_FULL_SPEED_CHIP10 (160)
#define ADC_PHASE_HALF_SPEED_CHIP10 (160)
#define ADC_PHASE_QUARTER_SPEED_CHIP10 (160)
#define DBIT_PHASE_FULL_SPEED_CHIP10 (125)
#define DBIT_PHASE_HALF_SPEED_CHIP10 (175)
#define DBIT_PHASE_QUARTER_SPEED_CHIP10 (175)
#define ADC_OFST_FULL_SPEED_VAL_CHIP10 (0x10)
#define ADC_OFST_HALF_SPEED_VAL_CHIP10 (0x08)
#define ADC_OFST_QUARTER_SPEED_VAL_CHIP10 (0x04)
// 1.0 pcb (2 resistor network)
#define SAMPLE_ADC_HALF_SPEED_BOARD2 \
(SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_0_VAL + \
SAMPLE_DGTL_SAMPLE_3_VAL + SAMPLE_DECMT_FACTOR_HALF_VAL) // 0x1300
#define SAMPLE_ADC_QUARTER_SPEED_BOARD2 \
(SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_1_VAL + \
SAMPLE_DGTL_SAMPLE_6_VAL + SAMPLE_DECMT_FACTOR_QUARTER_VAL) // 0x2610
#define ADC_PHASE_HALF_SPEED_BOARD2 (110)
#define ADC_PHASE_QUARTER_SPEED_BOARD2 (220)
#define DBIT_PHASE_HALF_SPEED_BOARD2 (150)
#define DBIT_PHASE_QUARTER_SPEED_BOARD2 (150)
#define ADC_OFST_HALF_SPEED_BOARD2_VAL (0x10)
#define ADC_OFST_QUARTER_SPEED_BOARD2_VAL (0x08)
/* Struct Definitions */ /* Struct Definitions */
typedef struct udp_header_struct { typedef struct udp_header_struct {
@ -45,111 +174,44 @@ typedef struct udp_header_struct {
#define UDP_IP_HEADER_LENGTH_BYTES (28) #define UDP_IP_HEADER_LENGTH_BYTES (28)
/* Enums */ /* Enums */
enum ADCINDEX { TEMP_FPGA, TEMP_ADC };
enum DACINDEX { enum DACINDEX {
MO_VBP_COLBUF, J_VB_COMP,
MO_VIPRE, J_VDD_PROT,
MO_VIN_CM, J_VIN_COM,
MO_VB_SDA, J_VREF_PRECH,
MO_VCASC_SFP, J_VB_PIXBUF,
MO_VOUT_CM, J_VB_DS,
MO_VIPRE_CDS, J_VREF_DS,
MO_IBIAS_SFP J_VREF_COMP
}; };
#define DAC_NAMES \ #define DAC_NAMES \
"vbp_colbuf", "vipre", "vin_cm", "vb_sda", "vcasc_sfp", "vout_cm", \ "vb_comp", "vdd_prot", "vin_com", "vref_prech", "vb_pixbuf", "vb_ds", \
"vipre_cds", "ibias_sfp" "vref_ds", "vref_comp"
#define DEFAULT_DAC_VALS \ #define DEFAULT_DAC_VALS \
{ \ { \
1300, /* MO_VBP_COLBUF */ \ 1220, /* J_VB_COMP */ \
1000, /* MO_VIPRE */ \ 3000, /* J_VDD_PROT */ \
1400, /* MO_VIN_CM */ \ 1053, /* J_VIN_COM */ \
680, /* MO_VB_SDA */ \ 1450, /* J_VREF_PRECH */ \
1428, /* MO_VCASC_SFP */ \ 750, /* J_VB_PIXBUF */ \
1200, /* MO_VOUT_CM */ \ 1000, /* J_VB_DS */ \
800, /* MO_VIPRE_CDS */ \ 480, /* J_VREF_DS */ \
900 /* MO_IBIAS_SFP */ \ 420 /* J_VREF_COMP */ \
}; };
enum CLKINDEX { RUN_CLK, ADC_CLK, SYNC_CLK, DBIT_CLK, NUM_CLOCKS }; enum MASTERINDEX { MASTER_HARDWARE, OW_MASTER, OW_SLAVE };
#define CLK_NAMES "run", "adc", "sync", "dbit" #define MASTER_NAMES "hardware", "master", "slave"
/* Hardware Definitions */ #define NUMSETTINGS (2)
#define NCHAN (32) #define NSPECIALDACS (3)
#define NCHIP (1) #define SPECIALDACINDEX {J_VREF_PRECH, J_VREF_DS, J_VREF_COMP};
#define NDAC (8) #define SPECIAL_DEFAULT_DYNAMIC_GAIN_VALS \
#define DYNAMIC_RANGE (16) { 1450, 480, 420 }
#define NUM_BYTES_PER_PIXEL (DYNAMIC_RANGE / 8) #define SPECIAL_DEFAULT_DYNAMICHG0_GAIN_VALS \
#define CLK_FREQ (156.25) /* MHz */ { 1550, 450, 620 }
#define NSAMPLES_PER_ROW (25)
#define NCHANS_PER_ADC (25)
/** Default Parameters */ enum NETWORKINDEX { TXN_FRAME, FLOWCTRL_10G };
#define DEFAULT_PATTERN_FILE ("DefaultPattern_moench.txt") enum CLKINDEX { RUN_CLK, ADC_CLK, DBIT_CLK, NUM_CLOCKS };
#define DEFAULT_STARTING_FRAME_NUMBER (1) #define CLK_NAMES "run", "adc", "dbit"
#define DEFAULT_DATA_BYTES (NCHIP * NCHAN * NUM_BITS_PER_PIXEL)
#define DEFAULT_NUM_SAMPLES (5000)
#define DEFAULT_EXPTIME (0)
#define DEFAULT_NUM_FRAMES (1)
#define DEFAULT_NUM_CYCLES (1)
#define DEFAULT_PERIOD (1 * 1000 * 1000) // ns
#define DEFAULT_DELAY (0)
#define DEFAULT_HIGH_VOLTAGE (0)
#define DEFAULT_VLIMIT (-100)
#define DEFAULT_TIMING_MODE (AUTO_TIMING)
#define DEFAULT_TX_UDP_PORT (0x7e9a)
#define DEFAULT_RUN_CLK_AT_STARTUP (200) // 40
#define DEFAULT_ADC_CLK_AT_STARTUP (40) // 20
#define DEFAULT_SYNC_CLK_AT_STARTUP (40) // 20
#define DEFAULT_DBIT_CLK_AT_STARTUP (200)
#define DEFAULT_RUN_CLK (40)
#define DEFAULT_ADC_CLK (20)
#define DEFAULT_DBIT_CLK (40)
#define DEFAULT_ADC_PHASE_DEG (30)
#define DEFAULT_PIPELINE (15)
#define DEFAULT_SETTINGS (G4_HIGHGAIN)
#define UDP_HEADER_MAX_FRAME_VALUE (0xFFFFFFFFFFFF)
// settings
#define DEFAULT_PATMASK (0x00000C800000800AULL)
#define G1_HIGHGAIN_PATSETBIT (0x00000C0000008008ULL)
#define G1_LOWGAIN_PATSETBIT (0x0000040000008000ULL)
#define G2_HIGHCAP_HIGHGAIN_PATSETBIT (0x0000080000000008ULL)
#define G2_HIGHCAP_LOWGAIN_PATSETBIT (0x0000000000000000ULL)
#define G2_LOWCAP_HIGHGAIN_PATSETBIT (0x00000C800000800AULL)
#define G2_LOWCAP_LOWGAIN_PATSETBIT (0x0000048000008002ULL)
#define G4_HIGHGAIN_PATSETBIT (0x000008800000000AULL)
#define G4_LOWGAIN_PATSETBIT (0x0000008000000002ULL)
#define HIGHVOLTAGE_MIN (60)
#define HIGHVOLTAGE_MAX (200) // min dac val
#define DAC_MIN_MV (0)
#define DAC_MAX_MV (2500)
/* Defines in the Firmware */
#define DIGITAL_IO_DELAY_MAXIMUM_PS \
((OUTPUT_DELAY_0_OTPT_STTNG_MSK >> OUTPUT_DELAY_0_OTPT_STTNG_OFST) * \
OUTPUT_DELAY_0_OTPT_STTNG_STEPS)
#define MAX_PHASE_SHIFTS_STEPS (8)
#define WAIT_TME_US_FR_ACQDONE_REG \
(100) // wait time in us after acquisition done to ensure there is no data
// in fifo
#define WAIT_TIME_US_PLL (10 * 1000)
#define WAIT_TIME_US_STP_ACQ (100)
#define WAIT_TIME_CONFIGURE_MAC (2 * 1000 * 1000)
#define WAIT_TIME_PATTERN_READ (10)
#define WAIT_TIME_1US_FOR_LOOP_CNT (50) // around 30 is 1 us in blackfin
/* MSB & LSB DEFINES */
#define MSB_OF_64_BIT_REG_OFST (32)
#define LSB_OF_64_BIT_REG_OFST (0)
#define BIT32_MSK (0xFFFFFFFF)
#define BIT16_MASK (0xFFFF)
#define ADC_PORT_INVERT_VAL (0x4a342593)
#define MAXIMUM_ADC_CLK (20)
#define PLL_VCO_FREQ_MHZ (800)

View File

@ -4,7 +4,7 @@
#include <inttypes.h> #include <inttypes.h>
#ifdef JUNGFRAUD #if defined(JUNGFRAUD) || defined(MOENCHD)
/** /**
* Set Defines * Set Defines
* @param creg control register * @param creg control register
@ -14,8 +14,9 @@
* @param prmsk pll reset mask * @param prmsk pll reset mask
* @param amsk address mask * @param amsk address mask
* @param aofst address offset * @param aofst address offset
* @param wd2msk write parameter mask for pll for dbit clock (Jungfrau only) * @param wd2msk write parameter mask for pll for dbit clock (Jungfrau/moench
* @param clk2Index clkIndex of second pll (Jungfrau only) * only)
* @param clk2Index clkIndex of second pll (Jungfrau/moench only)
*/ */
void ALTERA_PLL_SetDefines(uint32_t creg, uint32_t preg, uint32_t rprmsk, void ALTERA_PLL_SetDefines(uint32_t creg, uint32_t preg, uint32_t rprmsk,
uint32_t wpmsk, uint32_t prmsk, uint32_t amsk, uint32_t wpmsk, uint32_t prmsk, uint32_t amsk,
@ -50,8 +51,8 @@ void ALTERA_PLL_ResetPLLAndReconfiguration();
* Set PLL Reconfig register * Set PLL Reconfig register
* @param reg register * @param reg register
* @param val value * @param val value
* @param useDefaultWRMask only jungfrau for dbit clk (clkindex1, use second WR * @param useDefaultWRMask only jungfrau/moench for dbit clk (clkindex1, use
* mask) * second WR mask)
*/ */
void ALTERA_PLL_SetPllReconfigReg(uint32_t reg, uint32_t val, void ALTERA_PLL_SetPllReconfigReg(uint32_t reg, uint32_t val,
int useSecondWRMask); int useSecondWRMask);

View File

@ -6,7 +6,7 @@
#include "clogger.h" #include "clogger.h"
void initializePatternAddresses(); void initializePatternAddresses();
#if defined(CHIPTESTBOARDD) || defined(MOENCHD) #ifdef CHIPTESTBOARDD
#ifdef VIRTUAL #ifdef VIRTUAL
void initializePatternWord(); void initializePatternWord();
#endif #endif

View File

@ -6,8 +6,8 @@
#include "AD9252.h" // old board compatibility #include "AD9252.h" // old board compatibility
#include "clogger.h" // runState(enum TLogLevel) #include "clogger.h" // runState(enum TLogLevel)
#endif #endif
#if defined(GOTTHARDD) || defined(JUNGFRAUD) || defined(CHIPTESTBOARDD) || \ #if defined(GOTTHARDD) || defined(JUNGFRAUD) || defined(MOENCHD) || \
defined(MOENCHD) defined(CHIPTESTBOARDD)
#include "AD9257.h" // commonServerFunctions.h, blackfin.h, ansi.h #include "AD9257.h" // commonServerFunctions.h, blackfin.h, ansi.h
#endif #endif
@ -20,8 +20,8 @@
#if defined(MYTHEN3D) || defined(GOTTHARD2D) #if defined(MYTHEN3D) || defined(GOTTHARD2D)
#include "nios.h" #include "nios.h"
#elif defined(GOTTHARDD) || defined(JUNGFRAUD) || defined(CHIPTESTBOARDD) || \ #elif defined(GOTTHARDD) || defined(JUNGFRAUD) || defined(MOENCHD) || \
defined(MOENCHD) defined(CHIPTESTBOARDD)
#include "blackfin.h" #include "blackfin.h"
#endif #endif
@ -61,15 +61,16 @@ typedef struct udpStruct_s {
int isInitCheckDone(); int isInitCheckDone();
int getInitResult(char **mess); int getInitResult(char **mess);
void basictests(); void basictests();
#if defined(GOTTHARDD) || defined(JUNGFRAUD) || defined(CHIPTESTBOARDD) || \ #if defined(GOTTHARDD) || defined(JUNGFRAUD) || defined(MOENCHD) || \
defined(MOENCHD) || defined(MYTHEN3D) || defined(GOTTHARD2D) defined(CHIPTESTBOARDD) || defined(MYTHEN3D) || defined(GOTTHARD2D)
int checkType(); int checkType();
int testFpga(); int testFpga();
int testBus(); int testBus();
#endif #endif
#if defined(GOTTHARDD) || \ #if defined(GOTTHARDD) || \
((defined(EIGERD) || defined(JUNGFRAUD)) && defined(VIRTUAL)) ((defined(EIGERD) || defined(JUNGFRAUD) || defined(MOENCHD)) && \
defined(VIRTUAL))
void setTestImageMode(int ival); void setTestImageMode(int ival);
int getTestImageMode(); int getTestImageMode();
#endif #endif
@ -82,14 +83,14 @@ u_int64_t getFirmwareAPIVersion();
void getHardwareVersion(char *version); void getHardwareVersion(char *version);
u_int16_t getHardwareVersionNumber(); u_int16_t getHardwareVersionNumber();
#endif #endif
#if defined(JUNGFRAUD) || defined(CHIPTESTBOARDD) || defined(MOENCHD) #if defined(JUNGFRAUD) || defined(MOENCHD) || defined(CHIPTESTBOARDD)
u_int16_t getHardwareSerialNumber(); u_int16_t getHardwareSerialNumber();
#endif #endif
#if defined(JUNGFRAUD) || defined(GOTTHARD2D) || defined(MYTHEN3D) || \ #if defined(JUNGFRAUD) || defined(MOENCHD) || defined(GOTTHARD2D) || \
defined(GOTTHARDD) defined(MYTHEN3D) || defined(GOTTHARDD)
int isHardwareVersion_1_0(); int isHardwareVersion_1_0();
#endif #endif
#ifdef JUNGFRAUD #if defined(JUNGFRAUD) || defined(MOENCHD)
int getChipVersion(); int getChipVersion();
void setChipVersion(int version); void setChipVersion(int version);
#endif #endif
@ -98,7 +99,7 @@ u_int32_t getDetectorNumber();
#endif #endif
#if defined(GOTTHARD2D) || defined(EIGERD) || defined(MYTHEN3D) || \ #if defined(GOTTHARD2D) || defined(EIGERD) || defined(MYTHEN3D) || \
defined(JUNGFRAUD) defined(JUNGFRAUD) || defined(MOENCHD)
int getModuleId(int *ret, char *mess); int getModuleId(int *ret, char *mess);
int updateModuleId(); int updateModuleId();
#ifndef EIGERD #ifndef EIGERD
@ -125,7 +126,7 @@ void checkVirtual9MFlag();
void allocateDetectorStructureMemory(); void allocateDetectorStructureMemory();
#endif #endif
void setupDetector(); void setupDetector();
#if defined(CHIPTESTBOARDD) || defined(MOENCHD) #if defined(CHIPTESTBOARDD)
int updateDatabytesandAllocateRAM(); int updateDatabytesandAllocateRAM();
void updateDataBytes(); void updateDataBytes();
#endif #endif
@ -141,7 +142,8 @@ void setASICDefaults();
#ifdef MYTHEN3D #ifdef MYTHEN3D
void setADIFDefaults(); void setADIFDefaults();
#endif #endif
#if defined(GOTTHARD2D) || defined(EIGERD) || defined(JUNGFRAUD) #if defined(GOTTHARD2D) || defined(EIGERD) || defined(JUNGFRAUD) || \
defined(MOENCHD)
int readConfigFile(); int readConfigFile();
#endif #endif
#if defined(GOTTHARDD) || defined(GOTTHARD2D) || defined(EIGERD) || \ #if defined(GOTTHARDD) || defined(GOTTHARD2D) || defined(EIGERD) || \
@ -157,14 +159,13 @@ void resetToHardwareSettings();
int writeRegister(uint32_t offset, uint32_t data); int writeRegister(uint32_t offset, uint32_t data);
int readRegister(uint32_t offset, uint32_t *retval); int readRegister(uint32_t offset, uint32_t *retval);
#elif GOTTHARDD #elif GOTTHARDD
uint32_t uint32_t writeRegister16And32(uint32_t offset,
writeRegister16And32(uint32_t offset, uint32_t data); // FIXME its not there in ctb
uint32_t data); // FIXME its not there in ctb or moench?
uint32_t readRegister16And32(uint32_t offset); uint32_t readRegister16And32(uint32_t offset);
#endif #endif
// firmware functions (resets) // firmware functions (resets)
#if defined(JUNGFRAUD) || defined(CHIPTESTBOARDD) || defined(MOENCHD) || \ #if defined(JUNGFRAUD) || defined(MOENCHD) || defined(CHIPTESTBOARDD) || \
defined(MYTHEN3D) || defined(GOTTHARD2D) defined(MYTHEN3D) || defined(GOTTHARD2D)
void cleanFifos(); void cleanFifos();
void resetCore(); void resetCore();
@ -189,11 +190,11 @@ int getDynamicRange(int *retval);
int setROI(ROI arg); int setROI(ROI arg);
ROI getROI(); ROI getROI();
#endif #endif
#ifdef JUNGFRAUD #if defined(JUNGFRAUD) || defined(MOENCHD)
void setADCInvertRegister(uint32_t val); void setADCInvertRegister(uint32_t val);
uint32_t getADCInvertRegister(); uint32_t getADCInvertRegister();
#endif #endif
#if defined(CHIPTESTBOARDD) || defined(MOENCHD) #if defined(CHIPTESTBOARDD)
int setADCEnableMask(uint32_t mask); int setADCEnableMask(uint32_t mask);
uint32_t getADCEnableMask(); uint32_t getADCEnableMask();
void setADCEnableMask_10G(uint32_t mask); void setADCEnableMask_10G(uint32_t mask);
@ -221,11 +222,11 @@ int getReadoutMode();
#endif #endif
// parameters - timer // parameters - timer
#ifdef JUNGFRAUD #if defined(JUNGFRAUD) || defined(MOENCHD)
int selectStoragecellStart(int pos); int selectStoragecellStart(int pos);
int getMaxStoragecellStart(); int getMaxStoragecellStart();
#endif #endif
#if defined(JUNGFRAUD) || defined(EIGERD) || defined(MOENCHD) || \ #if defined(JUNGFRAUD) || defined(MOENCHD) || defined(EIGERD) || \
defined(CHIPTESTBOARDD) defined(CHIPTESTBOARDD)
int setNextFrameNumber(uint64_t value); int setNextFrameNumber(uint64_t value);
int getNextFrameNumber(uint64_t *value); int getNextFrameNumber(uint64_t *value);
@ -265,13 +266,13 @@ int64_t getSubDeadTime();
int64_t getMeasuredPeriod(); int64_t getMeasuredPeriod();
int64_t getMeasuredSubPeriod(); int64_t getMeasuredSubPeriod();
#endif #endif
#ifdef JUNGFRAUD #if defined(JUNGFRAUD) || defined(MOENCHD)
void setNumAdditionalStorageCells(int val); void setNumAdditionalStorageCells(int val);
int getNumAdditionalStorageCells(); int getNumAdditionalStorageCells();
int setStorageCellDelay(int64_t val); int setStorageCellDelay(int64_t val);
int64_t getStorageCellDelay(); int64_t getStorageCellDelay();
#endif #endif
#if defined(CHIPTESTBOARDD) || defined(MOENCHD) #if defined(CHIPTESTBOARDD)
int setNumAnalogSamples(int val); int setNumAnalogSamples(int val);
int getNumAnalogSamples(); int getNumAnalogSamples();
#endif #endif
@ -286,8 +287,8 @@ uint32_t getCounterMask();
void updatePacketizing(); void updatePacketizing();
#endif #endif
#if defined(JUNGFRAUD) || defined(GOTTHARDD) || defined(CHIPTESTBOARDD) || \ #if defined(JUNGFRAUD) || defined(MOENCHD) || defined(GOTTHARDD) || \
defined(MOENCHD) || defined(MYTHEN3D) || defined(GOTTHARD2D) defined(CHIPTESTBOARDD) || defined(MYTHEN3D) || defined(GOTTHARD2D)
int setDelayAfterTrigger(int64_t val); int setDelayAfterTrigger(int64_t val);
int64_t getDelayAfterTrigger(); int64_t getDelayAfterTrigger();
int64_t getNumFramesLeft(); int64_t getNumFramesLeft();
@ -301,7 +302,7 @@ int64_t getNumBurstsLeft();
#ifdef GOTTHARDD #ifdef GOTTHARDD
int64_t getExpTimeLeft(); int64_t getExpTimeLeft();
#endif #endif
#if defined(JUNGFRAUD) || defined(CHIPTESTBOARDD) || defined(MOENCHD) || \ #if defined(JUNGFRAUD) || defined(MOENCHD) || defined(CHIPTESTBOARDD) || \
defined(MYTHEN3D) || defined(GOTTHARD2D) defined(MYTHEN3D) || defined(GOTTHARD2D)
int64_t getFramesFromStart(); int64_t getFramesFromStart();
int64_t getActualTime(); int64_t getActualTime();
@ -312,7 +313,7 @@ int64_t getMeasurementTime();
#if defined(MYTHEN3D) || defined(EIGERD) #if defined(MYTHEN3D) || defined(EIGERD)
void getModule(sls_detector_module *myMod); void getModule(sls_detector_module *myMod);
#endif #endif
#if (!defined(CHIPTESTBOARDD)) && (!defined(MOENCHD)) && (!defined(GOTTHARD2D)) #if (!defined(CHIPTESTBOARDD)) && (!defined(GOTTHARD2D))
int setModule(sls_detector_module myMod, char *mess); int setModule(sls_detector_module myMod, char *mess);
#endif #endif
@ -328,7 +329,7 @@ int getAllTrimbits();
enum detectorSettings setSettings(enum detectorSettings sett); enum detectorSettings setSettings(enum detectorSettings sett);
#endif #endif
enum detectorSettings getSettings(); enum detectorSettings getSettings();
#ifdef JUNGFRAUD #if defined(JUNGFRAUD) || defined(MOENCHD)
enum gainMode getGainMode(); enum gainMode getGainMode();
void setGainMode(enum gainMode mode); void setGainMode(enum gainMode mode);
#endif #endif
@ -357,7 +358,7 @@ void setDAC(enum DACINDEX ind, int val, int mV);
#endif #endif
int getDAC(enum DACINDEX ind, int mV); int getDAC(enum DACINDEX ind, int mV);
int getMaxDacSteps(); int getMaxDacSteps();
#if defined(CHIPTESTBOARDD) || defined(MOENCHD) #if defined(CHIPTESTBOARDD)
int dacToVoltage(int dac); int dacToVoltage(int dac);
int checkVLimitCompliant(int mV); int checkVLimitCompliant(int mV);
int checkVLimitDacCompliant(int dac); int checkVLimitDacCompliant(int dac);
@ -380,14 +381,15 @@ void powerOff();
#if defined(MYTHEN3D) || defined(GOTTHARD2D) #if defined(MYTHEN3D) || defined(GOTTHARD2D)
int getADC(enum ADCINDEX ind, int *value); int getADC(enum ADCINDEX ind, int *value);
#elif !defined(MOENCHD) #else
int getADC(enum ADCINDEX ind); int getADC(enum ADCINDEX ind);
#endif #endif
int setHighVoltage(int val); int setHighVoltage(int val);
// parameters - timing, extsig // parameters - timing, extsig
#if defined(EIGERD) || defined(GOTTHARD2D) || defined(JUNGFRAUD) #if defined(EIGERD) || defined(GOTTHARD2D) || defined(JUNGFRAUD) || \
defined(MOENCHD)
int setMaster(enum MASTERINDEX m); int setMaster(enum MASTERINDEX m);
#endif #endif
#ifdef EIGERD #ifdef EIGERD
@ -395,11 +397,11 @@ int setTop(enum TOPINDEX t);
int isTop(int *retval); int isTop(int *retval);
#endif #endif
#if defined(MYTHEN3D) || defined(EIGERD) || defined(GOTTHARDD) || \ #if defined(MYTHEN3D) || defined(EIGERD) || defined(GOTTHARDD) || \
defined(GOTTHARD2D) || defined(JUNGFRAUD) defined(GOTTHARD2D) || defined(JUNGFRAUD) || defined(MOENCHD)
int isMaster(int *retval); int isMaster(int *retval);
#endif #endif
#ifdef JUNGFRAUD #if defined(JUNGFRAUD) || defined(MOENCHD)
int getSynchronization(); int getSynchronization();
void setSynchronization(int enable); void setSynchronization(int enable);
#endif #endif
@ -430,29 +432,30 @@ int getExtSignal(int signalIndex);
#ifdef GOTTHARDD #ifdef GOTTHARDD
void calcChecksum(mac_conf *mac, int sourceip, int destip); void calcChecksum(mac_conf *mac, int sourceip, int destip);
#endif #endif
#if defined(JUNGFRAUD) || defined(GOTTHARD2D) #if defined(JUNGFRAUD) || defined(MOENCHD) || defined(GOTTHARD2D)
void setNumberofUDPInterfaces(int val); void setNumberofUDPInterfaces(int val);
#endif #endif
int getNumberofUDPInterfaces(); int getNumberofUDPInterfaces();
#if defined(JUNGFRAUD) || defined(EIGERD) || defined(MYTHEN3D) || \ #if defined(JUNGFRAUD) || defined(MOENCHD) || defined(EIGERD) || \
defined(GOTTHARD2D) defined(MYTHEN3D) || defined(GOTTHARD2D)
int getNumberofDestinations(int *retval); int getNumberofDestinations(int *retval);
int setNumberofDestinations(int value); int setNumberofDestinations(int value);
#endif #endif
#if defined(JUNGFRAUD) || defined(MYTHEN3D) || defined(GOTTHARD2D) #if defined(JUNGFRAUD) || defined(MOENCHD) || defined(MYTHEN3D) || \
defined(GOTTHARD2D)
int getFirstUDPDestination(); int getFirstUDPDestination();
void setFirstUDPDestination(int value); void setFirstUDPDestination(int value);
#endif #endif
#ifdef JUNGFRAUD #if defined(JUNGFRAUD) || defined(MOENCHD)
void selectPrimaryInterface(int val); void selectPrimaryInterface(int val);
int getPrimaryInterface(); int getPrimaryInterface();
void setupHeader(int iRxEntry, enum interfaceType type, uint32_t destip, void setupHeader(int iRxEntry, enum interfaceType type, uint32_t destip,
uint64_t destmac, uint32_t destport, uint64_t sourcemac, uint64_t destmac, uint32_t destport, uint64_t sourcemac,
uint32_t sourceip, uint32_t sourceport); uint32_t sourceip, uint32_t sourceport);
#endif #endif
#if defined(JUNGFRAUD) || defined(GOTTHARD2D) || defined(MYTHEN3D) || \ #if defined(JUNGFRAUD) || defined(MOENCHD) || defined(GOTTHARD2D) || \
defined(CHIPTESTBOARDD) || defined(MOENCHD) defined(MYTHEN3D) || defined(CHIPTESTBOARDD)
void calcChecksum(udp_header *udp); void calcChecksum(udp_header *udp);
#endif #endif
#ifdef GOTTHARDD #ifdef GOTTHARDD
@ -471,22 +474,15 @@ int getInterruptSubframe();
int setReadNRows(int value); int setReadNRows(int value);
int getReadNRows(); int getReadNRows();
#endif #endif
#if defined(CHIPTESTBOARDD) || defined(MOENCHD) || defined(EIGERD) || \ #if defined(CHIPTESTBOARDD) || defined(EIGERD) || defined(MYTHEN3D)
defined(MYTHEN3D)
int enableTenGigabitEthernet(int val); int enableTenGigabitEthernet(int val);
#endif #endif
// very detector specific // very detector specific
// moench specific - powerchip // chip test board specific - configure frequency, phase, pll,
#ifdef MOENCHD
int powerChip(int on);
int setAnalogOnlyReadout();
#endif
// chip test board or moench specific - configure frequency, phase, pll,
// flashing firmware // flashing firmware
#if defined(CHIPTESTBOARDD) || defined(MOENCHD) #if defined(CHIPTESTBOARDD)
int setPhase(enum CLKINDEX ind, int val, int degrees); int setPhase(enum CLKINDEX ind, int val, int degrees);
int getPhase(enum CLKINDEX ind, int degrees); int getPhase(enum CLKINDEX ind, int degrees);
int getMaxPhase(enum CLKINDEX ind); int getMaxPhase(enum CLKINDEX ind);
@ -505,9 +501,9 @@ int setLEDEnable(int enable);
void setDigitalIODelay(uint64_t pinMask, int delay); void setDigitalIODelay(uint64_t pinMask, int delay);
#endif #endif
// jungfrau specific - powerchip, autocompdisable, clockdiv, asictimer, clock, // jungfrau/moench specific - powerchip, autocompdisable, clockdiv, asictimer,
// pll, flashing firmware // clock, pll, flashing firmware
#ifdef JUNGFRAUD #if defined(JUNGFRAUD) || defined(MOENCHD)
int setReadNRows(int value); int setReadNRows(int value);
int getReadNRows(); int getReadNRows();
void initReadoutConfiguration(); void initReadoutConfiguration();
@ -637,11 +633,12 @@ int setBadChannels(int numChannels, int *channelList);
int *getBadChannels(int *numChannels); int *getBadChannels(int *numChannels);
#endif #endif
#if defined(JUNGFRAUD) || defined(EIGERD) #if defined(JUNGFRAUD) || defined(MOENCHD) || defined(EIGERD)
int getTenGigaFlowControl(); int getTenGigaFlowControl();
int setTenGigaFlowControl(int value); int setTenGigaFlowControl(int value);
#endif #endif
#if defined(JUNGFRAUD) || defined(EIGERD) || defined(MYTHEN3D) #if defined(JUNGFRAUD) || defined(MOENCHD) || defined(EIGERD) || \
defined(MYTHEN3D)
int getTransmissionDelayFrame(); int getTransmissionDelayFrame();
int setTransmissionDelayFrame(int value); int setTransmissionDelayFrame(int value);
#endif #endif
@ -661,14 +658,14 @@ int stopStateMachine();
#ifdef MYTHEN3D #ifdef MYTHEN3D
int softwareTrigger(); int softwareTrigger();
#endif #endif
#if defined(EIGERD) || defined(JUNGFRAUD) #if defined(EIGERD) || defined(JUNGFRAUD) || defined(MOENCHD)
int softwareTrigger(int block); int softwareTrigger(int block);
#endif #endif
#if defined(EIGERD) || defined(MYTHEN3D) #if defined(EIGERD) || defined(MYTHEN3D)
int startReadOut(); int startReadOut();
#endif #endif
enum runStatus getRunStatus(); enum runStatus getRunStatus();
#if defined(CHIPTESTBOARDD) || defined(MOENCHD) #if defined(CHIPTESTBOARDD)
void readFrames(int *ret, char *mess); void readFrames(int *ret, char *mess);
#endif #endif
#ifdef EIGERD #ifdef EIGERD
@ -676,7 +673,7 @@ void waitForAcquisitionEnd(int *ret, char *mess);
#else #else
void waitForAcquisitionEnd(); void waitForAcquisitionEnd();
#endif #endif
#if defined(CHIPTESTBOARDD) || defined(MOENCHD) #if defined(CHIPTESTBOARDD)
void readandSendUDPFrames(int *ret, char *mess); void readandSendUDPFrames(int *ret, char *mess);
void unsetFifoReadStrobes(); void unsetFifoReadStrobes();
void readSample(int ns); void readSample(int ns);
@ -685,8 +682,8 @@ int checkFifoForEndOfAcquisition();
int readFrameFromFifo(); int readFrameFromFifo();
#endif #endif
#if defined(GOTTHARDD) || defined(JUNGFRAUD) || defined(CHIPTESTBOARDD) || \ #if defined(GOTTHARDD) || defined(JUNGFRAUD) || defined(MOENCHD) || \
defined(MOENCHD) || defined(MYTHEN3D) || defined(GOTTHARD2D) defined(CHIPTESTBOARDD) || defined(MYTHEN3D) || defined(GOTTHARD2D)
u_int32_t runBusy(); u_int32_t runBusy();
#endif #endif
@ -697,7 +694,7 @@ u_int32_t runState(enum TLogLevel lev);
// common // common
int calculateDataBytes(); int calculateDataBytes();
int getTotalNumberOfChannels(); int getTotalNumberOfChannels();
#if defined(MOENCHD) || defined(CHIPTESTBOARDD) #if defined(CHIPTESTBOARDD)
void getNumberOfChannels(int *nchanx, int *nchany); void getNumberOfChannels(int *nchanx, int *nchany);
#endif #endif
int getNumberOfChips(); int getNumberOfChips();

View File

@ -300,7 +300,7 @@ void AD9257_Configure() {
AD9257_CLK_CH_IFCO_MSK); AD9257_CLK_CH_IFCO_MSK);
// vref // vref
#if defined(GOTTHARDD) || defined(MOENCHD) #ifdef GOTTHARDD
LOG(logINFO, ("\tVref default at 2.0\n")); LOG(logINFO, ("\tVref default at 2.0\n"));
AD9257_SetVrefVoltage(AD9257_VREF_DEFAULT_VAL, 0); AD9257_SetVrefVoltage(AD9257_VREF_DEFAULT_VAL, 0);
#else #else

View File

@ -127,7 +127,7 @@ uint32_t ALTERA_PLL_Cntrl_Reg = 0x0;
uint32_t ALTERA_PLL_Param_Reg = 0x0; uint32_t ALTERA_PLL_Param_Reg = 0x0;
uint32_t ALTERA_PLL_Cntrl_RcnfgPrmtrRstMask = 0x0; uint32_t ALTERA_PLL_Cntrl_RcnfgPrmtrRstMask = 0x0;
uint32_t ALTERA_PLL_Cntrl_WrPrmtrMask = 0x0; uint32_t ALTERA_PLL_Cntrl_WrPrmtrMask = 0x0;
#ifdef JUNGFRAUD #if defined(JUNGFRAUD) || defined(MOENCHD)
uint32_t ALTERA_PLL_Cntrl_DBIT_PLL_WrPrmtrMask = 0x0; uint32_t ALTERA_PLL_Cntrl_DBIT_PLL_WrPrmtrMask = 0x0;
int ALTERA_PLL_Cntrl_DBIT_ClkIndex = 0; int ALTERA_PLL_Cntrl_DBIT_ClkIndex = 0;
@ -136,7 +136,7 @@ uint32_t ALTERA_PLL_Cntrl_PLLRstMask = 0x0;
uint32_t ALTERA_PLL_Cntrl_AddrMask = 0x0; uint32_t ALTERA_PLL_Cntrl_AddrMask = 0x0;
int ALTERA_PLL_Cntrl_AddrOfst = 0; int ALTERA_PLL_Cntrl_AddrOfst = 0;
#ifdef JUNGFRAUD #if defined(JUNGFRAUD) || defined(MOENCHD)
void ALTERA_PLL_SetDefines(uint32_t creg, uint32_t preg, uint32_t rprmsk, void ALTERA_PLL_SetDefines(uint32_t creg, uint32_t preg, uint32_t rprmsk,
uint32_t wpmsk, uint32_t prmsk, uint32_t amsk, uint32_t wpmsk, uint32_t prmsk, uint32_t amsk,
int aofst, uint32_t wd2msk, int clk2Index) { int aofst, uint32_t wd2msk, int clk2Index) {
@ -201,7 +201,7 @@ void ALTERA_PLL_SetPllReconfigReg(uint32_t reg, uint32_t val,
reg, val, useSecondWRMask)); reg, val, useSecondWRMask));
uint32_t wrmask = ALTERA_PLL_Cntrl_WrPrmtrMask; uint32_t wrmask = ALTERA_PLL_Cntrl_WrPrmtrMask;
#ifdef JUNGFRAUD #if defined(JUNGFRAUD) || defined(MOENCHD)
if (useSecondWRMask) { if (useSecondWRMask) {
wrmask = ALTERA_PLL_Cntrl_DBIT_PLL_WrPrmtrMask; wrmask = ALTERA_PLL_Cntrl_DBIT_PLL_WrPrmtrMask;
} }
@ -252,7 +252,7 @@ void ALTERA_PLL_SetPhaseShift(int32_t phase, int clkIndex, int pos) {
LOG(logDEBUG1, ("C%d phase word:0x%08x\n", clkIndex, value)); LOG(logDEBUG1, ("C%d phase word:0x%08x\n", clkIndex, value));
int useSecondWR = 0; int useSecondWR = 0;
#ifdef JUNGFRAUD #if defined(JUNGFRAUD) || defined(MOENCHD)
if (clkIndex == ALTERA_PLL_Cntrl_DBIT_ClkIndex) { if (clkIndex == ALTERA_PLL_Cntrl_DBIT_ClkIndex) {
useSecondWR = 1; useSecondWR = 1;
} }

View File

@ -224,10 +224,10 @@ int getModuleIdInFile(int *ret, char *mess, char *fileName) {
// open id file // open id file
FILE *fd = fopen(fname, "r"); FILE *fd = fopen(fname, "r");
if (fd == NULL) { if (fd == NULL) {
#ifdef JUNGFRAUD #if defined(JUNGFRAUD) || defined(MOENCHD)
*ret = OK; *ret = OK;
LOG(logWARNING, LOG(logWARNING, ("Could not find detid file to set module id. "
("Could not find detid_jungfrau.txt to set module id\n")); "Continuing without.\n"));
return 0; return 0;
#else #else
*ret = FAIL; *ret = FAIL;
@ -485,7 +485,7 @@ int setupDetectorServer(char *mess, char *sname) {
// blackfin boards (respawn) (only kept for backwards compatibility) // blackfin boards (respawn) (only kept for backwards compatibility)
#ifndef VIRTUAL #ifndef VIRTUAL
#if defined(JUNGFRAUD) || defined(CHIPTESTBOARDD) || defined(MOENCHD) || \ #if defined(JUNGFRAUD) || defined(MOENCHD) || defined(CHIPTESTBOARDD) || \
defined(GOTTHARDD) defined(GOTTHARDD)
// delete every line with DetectorServer in /etc/inittab // delete every line with DetectorServer in /etc/inittab
strcpy(cmd, "sed -i '/DetectorServer/d' /etc/inittab"); strcpy(cmd, "sed -i '/DetectorServer/d' /etc/inittab");

View File

@ -13,7 +13,7 @@
extern enum TLogLevel trimmingPrint; extern enum TLogLevel trimmingPrint;
#endif #endif
#if defined(CHIPTESTBOARDD) || defined(MOENCHD) #ifdef CHIPTESTBOARDD
#ifdef VIRTUAL #ifdef VIRTUAL
uint64_t virtual_pattern[MAX_PATTERN_LENGTH]; uint64_t virtual_pattern[MAX_PATTERN_LENGTH];
#endif #endif
@ -40,7 +40,7 @@ void initializePatternAddresses() {
} }
} }
#if defined(CHIPTESTBOARDD) || defined(MOENCHD) #ifdef CHIPTESTBOARDD
#ifdef VIRTUAL #ifdef VIRTUAL
void initializePatternWord() { void initializePatternWord() {
memset(virtual_pattern, 0, sizeof(virtual_pattern)); memset(virtual_pattern, 0, sizeof(virtual_pattern));
@ -128,7 +128,7 @@ int validate_writePatternWord(char *message, int addr, uint64_t word) {
// validate result // validate result
int ret = OK; int ret = OK;
// cannot validate for moench, ctb ( same as executing pattern word) // cannot validate for ctb ( same as executing pattern word)
#ifdef MYTHEN3D #ifdef MYTHEN3D
uint64_t retval = readPatternWord(addr); uint64_t retval = readPatternWord(addr);
LOG(logDEBUG1, ("Pattern word (addr:0x%x) retval: 0x%llx\n", addr, LOG(logDEBUG1, ("Pattern word (addr:0x%x) retval: 0x%llx\n", addr,

View File

@ -88,7 +88,7 @@ int main(int argc, char *argv[]) {
"and " "and "
"initial detector setup. \n" "initial detector setup. \n"
"\t-i, --ignore-config : " "\t-i, --ignore-config : "
"[Eiger][Jungfrau][Gotthard][Gotthard2] \n" "[Eiger][Jungfrau][Gotthard][Gotthard2][Moench] \n"
"\t Ignore config file. \n" "\t Ignore config file. \n"
"\t-m, --master <master> : " "\t-m, --master <master> : "
"[Eiger][Mythen3][Gotthard][Gotthard2] \n" "[Eiger][Mythen3][Gotthard][Gotthard2] \n"
@ -205,7 +205,7 @@ int main(int argc, char *argv[]) {
case 'i': case 'i':
#if defined(EIGERD) || defined(GOTTHARDD) || defined(GOTTHARD2D) || \ #if defined(EIGERD) || defined(GOTTHARDD) || defined(GOTTHARD2D) || \
defined(JUNGFRAUD) defined(JUNGFRAUD) || defined(MOENCHD)
LOG(logINFO, ("Ignoring config file\n")); LOG(logINFO, ("Ignoring config file\n"));
ignoreConfigFileFlag = 1; ignoreConfigFileFlag = 1;
#else #else

View File

@ -80,16 +80,16 @@ class Detector {
Result<std::string> getDetectorServerVersion(Positions pos = {}) const; Result<std::string> getDetectorServerVersion(Positions pos = {}) const;
/** [Jungfrau][Gotthard2][Myhten3][Gotthard][Ctb][Moench] */ /** [Jungfrau][Moench][Gotthard2][Myhten3][Gotthard][Ctb] */
Result<std::string> getHardwareVersion(Positions pos = {}) const; Result<std::string> getHardwareVersion(Positions pos = {}) const;
Result<std::string> getKernelVersion(Positions pos = {}) const; Result<std::string> getKernelVersion(Positions pos = {}) const;
/* [Jungfrau][Gotthard][Mythen3][Gotthard2][CTB][Moench] */ /* [Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][CTB] */
Result<int64_t> getSerialNumber(Positions pos = {}) const; Result<int64_t> getSerialNumber(Positions pos = {}) const;
/** [Eiger][Gotthard2][Mythen3][Jungfrau] 6 bit value (ideally unique) that /** [Eiger][Gotthard2][Mythen3][Jungfrau][Moench] 6 bit value (ideally
* is streamed out in the UDP header of the detector.*/ * unique) that is streamed out in the UDP header of the detector.*/
Result<int> getModuleId(Positions pos = {}) const; Result<int> getModuleId(Positions pos = {}) const;
Result<std::string> getReceiverVersion(Positions pos = {}) const; Result<std::string> getReceiverVersion(Positions pos = {}) const;
@ -122,14 +122,12 @@ class Detector {
/** list of possible settings for this detector */ /** list of possible settings for this detector */
std::vector<defs::detectorSettings> getSettingsList() const; std::vector<defs::detectorSettings> getSettingsList() const;
/** [Jungfrau][Gotthard][Gotthard2][Mythen3] */ /** [Jungfrau][Moench][Gotthard][Gotthard2][Mythen3] */
Result<defs::detectorSettings> getSettings(Positions pos = {}) const; Result<defs::detectorSettings> getSettings(Positions pos = {}) const;
/** [Jungfrau] GAIN0, HIGHGAIN0 \n [Gotthard] DYNAMICGAIN, HIGHGAIN, /** [Jungfrau][Moench] GAIN0, HIGHGAIN0 \n [Gotthard] DYNAMICGAIN, HIGHGAIN,
* LOWGAIN, MEDIUMGAIN, VERYHIGHGAIN \n [Gotthard2] DYNAMICGAIN, * LOWGAIN, MEDIUMGAIN, VERYHIGHGAIN \n [Gotthard2] DYNAMICGAIN,
* FIXGAIN1, FIXGAIN2 \n [Moench] G1_HIGHGAIN, G1_LOWGAIN, * FIXGAIN1, FIXGAIN2 \n [Mythen3] STANDARD, FAST,
* G2_HIGHCAP_HIGHGAIN, G2_HIGHCAP_LOWGAIN, G2_LOWCAP_HIGHGAIN,
* G2_LOWCAP_LOWGAIN, G4_HIGHGAIN, G4_LOWGAIN \n [Mythen3] STANDARD, FAST,
* HIGHGAIN. Also changes vrshaper and vrpreamp \n [Eiger] Use threshold * HIGHGAIN. Also changes vrshaper and vrpreamp \n [Eiger] Use threshold
* command. Settings loaded from file found in settingspath * command. Settings loaded from file found in settingspath
*/ */
@ -179,38 +177,39 @@ class Detector {
* files exist in corresponding trim folders */ * files exist in corresponding trim folders */
void setTrimEnergies(std::vector<int> energies, Positions pos = {}); void setTrimEnergies(std::vector<int> energies, Positions pos = {});
/**[Eiger][Jungfrau] */ /**[Eiger][Jungfrau][Moench] */
bool getGapPixelsinCallback() const; bool getGapPixelsinCallback() const;
/** /**
* [Eiger][Jungfrau] * [Eiger][Jungfrau][Moench]
* Include gap pixels in client data call back. Will not be in detector * Include gap pixels in client data call back. Will not be in detector
* streaming, receiver file or streaming. Default is disabled. * streaming, receiver file or streaming. Default is disabled.
*/ */
void setGapPixelsinCallback(const bool enable); void setGapPixelsinCallback(const bool enable);
/** [Eiger][Jungfrau] */ /** [Eiger][Jungfrau][Moench] */
Result<bool> getFlipRows(Positions pos = {}) const; Result<bool> getFlipRows(Positions pos = {}) const;
/** [Eiger] flips rows paramater sent to slsreceiver to stream as json /** [Eiger] flips rows paramater sent to slsreceiver to stream as json
* parameter to flip rows in gui \n[Jungfrau] flips rows in the detector * parameter to flip rows in gui \n[Jungfrau][Moench] flips rows in the
* itself. For bottom module and number of interfaces must be set to 2. * detector itself. For bottom module and number of interfaces must be set
* slsReceiver and slsDetectorGui does not handle.slsReceiver and * to 2. slsReceiver and slsDetectorGui does not handle.slsReceiver and
* slsDetectorGui does not handle * slsDetectorGui does not handle
*/ */
void setFlipRows(bool value, Positions pos = {}); void setFlipRows(bool value, Positions pos = {});
/** [Eiger][Mythen3][Gotthard1][Gotthard2][Jungfrau] via stop server **/ /** [Eiger][Mythen3][Gotthard1][Gotthard2][Jungfrau][Moench] via stop server
* **/
Result<bool> getMaster(Positions pos = {}) const; Result<bool> getMaster(Positions pos = {}) const;
/** [Eiger][Gotthard2][Jungfrau] Set (half) module to master and the /** [Eiger][Gotthard2][Jungfrau][Moench] Set (half) module to master and the
* other(s) to slaves */ * other(s) to slaves */
void setMaster(bool value, int pos); void setMaster(bool value, int pos);
/** [Jungfrau] **/ /** [Jungfrau][Moench] **/
Result<bool> getSynchronization(Positions pos = {}) const; Result<bool> getSynchronization(Positions pos = {}) const;
/** [Jungfrau] */ /** [Jungfrau][Moench] */
void setSynchronization(bool value); void setSynchronization(bool value);
/** [Gotthard2][Mythen3] */ /** [Gotthard2][Mythen3] */
@ -274,11 +273,11 @@ class Detector {
void setNumberOfTriggers(int64_t value); void setNumberOfTriggers(int64_t value);
/** [Gotthard][Jungfrau][Eiger][CTB][Moench][Gotthard2] \n /** [Gotthard][Jungfrau][Moench][Eiger][CTB][Gotthard2] \n
* [Mythen3] use function with gate index **/ * [Mythen3] use function with gate index **/
Result<ns> getExptime(Positions pos = {}) const; Result<ns> getExptime(Positions pos = {}) const;
/** [Gotthard][Jungfrau][Eiger][CTB][Moench][Gotthard2] \n /** [Gotthard][Jungfrau][Moench][Eiger][CTB][Gotthard2] \n
* [Mythen3] sets exptime for all gate signals. To specify gate index, use * [Mythen3] sets exptime for all gate signals. To specify gate index, use
* function with gate index **/ * function with gate index **/
void setExptime(ns t, Positions pos = {}); void setExptime(ns t, Positions pos = {});
@ -287,25 +286,25 @@ class Detector {
void setPeriod(ns t, Positions pos = {}); void setPeriod(ns t, Positions pos = {});
/** [Gotthard][Jungfrau][CTB][Moench][Mythen3][Gotthard2] */ /** [Gotthard][Jungfrau][Moench][CTB][Mythen3][Gotthard2] */
Result<ns> getDelayAfterTrigger(Positions pos = {}) const; Result<ns> getDelayAfterTrigger(Positions pos = {}) const;
/** [Gotthard][Jungfrau][CTB][Moench][Mythen3][Gotthard2] */ /** [Gotthard][Jungfrau][Moench][CTB][Mythen3][Gotthard2] */
void setDelayAfterTrigger(ns value, Positions pos = {}); void setDelayAfterTrigger(ns value, Positions pos = {});
/** [Gotthard][Jungfrau][CTB][Moench][Mythen3] /** [Gotthard][Jungfrau][Moench][CTB][Mythen3]
* [Gotthard2] only in continuous auto mode */ * [Gotthard2] only in continuous auto mode */
Result<int64_t> getNumberOfFramesLeft(Positions pos = {}) const; Result<int64_t> getNumberOfFramesLeft(Positions pos = {}) const;
/** [Gotthard][Jungfrau][CTB][Moench][Mythen3] /** [Gotthard][Jungfrau][Moench][CTB][Mythen3]
* Only when external trigger used */ * Only when external trigger used */
Result<int64_t> getNumberOfTriggersLeft(Positions pos = {}) const; Result<int64_t> getNumberOfTriggersLeft(Positions pos = {}) const;
/** [Gotthard][Jungfrau][CTB][Moench][Mythen3][Gotthard2] /** [Gotthard][Jungfrau][Moench][CTB][Mythen3][Gotthard2]
* [Gotthard2] only in continuous mode */ * [Gotthard2] only in continuous mode */
Result<ns> getPeriodLeft(Positions pos = {}) const; Result<ns> getPeriodLeft(Positions pos = {}) const;
/** [Gotthard][Jungfrau][CTB][Moench][Mythen3] /** [Gotthard][Jungfrau][Moench][CTB][Mythen3]
* [Gotthard2] only in continuous mode */ * [Gotthard2] only in continuous mode */
Result<ns> getDelayAfterTriggerLeft(Positions pos = {}) const; Result<ns> getDelayAfterTriggerLeft(Positions pos = {}) const;
@ -314,7 +313,7 @@ class Detector {
/** /**
* [Eiger] Options: 4, 8, 12, 16, 32. If i is 32, also sets clkdivider to 2, * [Eiger] Options: 4, 8, 12, 16, 32. If i is 32, also sets clkdivider to 2,
* else sets clkdivider to 1 \n [Mythen3] Options: 8, 16, 32 \n * else sets clkdivider to 1 \n [Mythen3] Options: 8, 16, 32 \n
* [Jungfrau][Gotthard][Ctb][Moench][Mythen3][Gotthard2] 16 * [Jungfrau][Moench][Gotthard][Ctb][Mythen3][Gotthard2] 16
*/ */
void setDynamicRange(int value); void setDynamicRange(int value);
@ -324,7 +323,7 @@ class Detector {
Result<defs::timingMode> getTimingMode(Positions pos = {}) const; Result<defs::timingMode> getTimingMode(Positions pos = {}) const;
/** /**
* [Gotthard][Jungfrau][Gotthard][CTB][Moench][Gotthard2] Options: * [Gotthard][Jungfrau][Moench][Gotthard][CTB][Gotthard2] Options:
* AUTO_TIMING, TRIGGER_EXPOSURE \n * AUTO_TIMING, TRIGGER_EXPOSURE \n
* [Mythen3] Options: AUTO_TIMING, TRIGGER_EXPOSURE, GATED, TRIGGER_GATED \n * [Mythen3] Options: AUTO_TIMING, TRIGGER_EXPOSURE, GATED, TRIGGER_GATED \n
* [Eiger] Options: AUTO_TIMING, TRIGGER_EXPOSURE, GATED, BURST_TRIGGER * [Eiger] Options: AUTO_TIMING, TRIGGER_EXPOSURE, GATED, BURST_TRIGGER
@ -334,64 +333,62 @@ class Detector {
/** list of possible timing modes for this detector */ /** list of possible timing modes for this detector */
std::vector<defs::timingMode> getTimingModeList() const; std::vector<defs::timingMode> getTimingModeList() const;
/** [Eiger][Jungfrau][Gotthard2] */ /** [Eiger][Jungfrau][Moench][Gotthard2] */
Result<defs::speedLevel> getReadoutSpeed(Positions pos = {}) const; Result<defs::speedLevel> getReadoutSpeed(Positions pos = {}) const;
/** [Eiger][Jungfrau][Gotthard2] /** [Eiger][Jungfrau][Moench][Gotthard2]
* [Jungfrau] Options: FULL_SPEED, HALF_SPEED (Default), QUARTER_SPEED \n * [Jungfrau][Moench] Options: FULL_SPEED, HALF_SPEED (Default),
* [Eiger] Options: FULL_SPEED (Default), HALF_SPEED, QUARTER_SPEED \n * QUARTER_SPEED \n [Eiger] Options: FULL_SPEED (Default), HALF_SPEED,
* [Gotthard2] Options: G2_108MHZ (Default), G2_144MHZ \n * QUARTER_SPEED \n [Gotthard2] Options: G2_108MHZ (Default), G2_144MHZ \n
* [Jungfrau] FULL_SPEED option only available from v2.0 boards and is * [Jungfrau][Moench] FULL_SPEED option only available from v2.0 boards and
* recommended to set number of interfaces to 2. \n Also overwrites adcphase * is recommended to set number of interfaces to 2. \n Also overwrites
* to recommended default. * adcphase to recommended default.
*/ */
void setReadoutSpeed(defs::speedLevel value, Positions pos = {}); void setReadoutSpeed(defs::speedLevel value, Positions pos = {});
/** list of possible readoutspeed modes for this detector */ /** list of possible readoutspeed modes for this detector */
std::vector<defs::speedLevel> getReadoutSpeedList() const; std::vector<defs::speedLevel> getReadoutSpeedList() const;
/** [Jungfrau][CTB][Moench] */ /** [Jungfrau][Moench][CTB] */
Result<int> getADCPhase(Positions pos = {}) const; Result<int> getADCPhase(Positions pos = {}) const;
/** [Gotthard][Jungfrau][CTB][Moench] /** [Gotthard][Jungfrau][Moench][CTB]
* [Jungfrau] Absolute phase shift. Changing Speed also resets adcphase to * [Jungfrau][Moench] Absolute phase shift. Changing Speed also resets
* recommended defaults. \n * adcphase to recommended defaults. \n [Ctb] Absolute phase shift. Changing
* [Ctb][Moench] Absolute phase shift. Changing adcclk also resets adcphase * adcclk also resets adcphase and sets it to previous values. \n [Gotthard]
* and sets it to previous values. \n * Relative phase shift
* [Gotthard] Relative phase shift
*/ */
void setADCPhase(int value, Positions pos = {}); void setADCPhase(int value, Positions pos = {});
/** [Jungfrau][CTB][Moench] */ /** [Jungfrau][Moench][CTB] */
Result<int> getMaxADCPhaseShift(Positions pos = {}) const; Result<int> getMaxADCPhaseShift(Positions pos = {}) const;
/** [Gotthard][Jungfrau][CTB][Moench] */ /** [Gotthard][Jungfrau][Moench][CTB] */
Result<int> getADCPhaseInDegrees(Positions pos = {}) const; Result<int> getADCPhaseInDegrees(Positions pos = {}) const;
/** [Gotthard][Jungfrau][CTB][Moench] /** [Gotthard][Jungfrau][Moench][CTB]
* [Jungfrau] Absolute phase shift. Changing Speed also resets adcphase to * [Jungfrau][Moench] Absolute phase shift. Changing Speed also resets
* recommended defaults. \n * adcphase to recommended defaults. \n [Ctb] Absolute phase shift. Changing
* [Ctb][Moench] Absolute phase shift. Changing adcclk also resets adcphase * adcclk also resets adcphase and sets it to previous values. \n [Gotthard]
* and sets it to previous values. \n * Relative phase shift
* [Gotthard] Relative phase shift
*/ */
void setADCPhaseInDegrees(int value, Positions pos = {}); void setADCPhaseInDegrees(int value, Positions pos = {});
/** [CTB][Jungfrau] */ /** [CTB][Jungfrau][Moench] */
Result<int> getDBITPhase(Positions pos = {}) const; Result<int> getDBITPhase(Positions pos = {}) const;
/** [CTB][Jungfrau] Absolute phase shift \n /** [CTB][Jungfrau][Moench] Absolute phase shift \n
* [CTB] changing dbitclk also resets dbitphase and sets to previous values. * [CTB] changing dbitclk also resets dbitphase and sets to previous values.
*/ */
void setDBITPhase(int value, Positions pos = {}); void setDBITPhase(int value, Positions pos = {});
/** [CTB][Jungfrau] */ /** [CTB][Jungfrau][Moench] */
Result<int> getMaxDBITPhaseShift(Positions pos = {}) const; Result<int> getMaxDBITPhaseShift(Positions pos = {}) const;
/** [CTB][Jungfrau] */ /** [CTB][Jungfrau][Moench] */
Result<int> getDBITPhaseInDegrees(Positions pos = {}) const; Result<int> getDBITPhaseInDegrees(Positions pos = {}) const;
/** [CTB][Jungfrau] Absolute phase shift \n /** [CTB][Jungfrau][Moench] Absolute phase shift \n
* [CTB] changing dbitclk also resets dbitphase and sets to previous values. * [CTB] changing dbitclk also resets dbitphase and sets to previous values.
*/ */
void setDBITPhaseInDegrees(int value, Positions pos = {}); void setDBITPhaseInDegrees(int value, Positions pos = {});
@ -424,18 +421,18 @@ class Detector {
/** /**
* [Gotthard] Options: 0, 90, 110, 120, 150, 180, 200 * [Gotthard] Options: 0, 90, 110, 120, 150, 180, 200
* [Jungfrau][CTB][Moench] Options: 0, 60 - 200 * [Jungfrau][Moench][CTB] Options: 0, 60 - 200
* [Eiger][Mythen3][Gotthard2] Options: 0 - 200 * [Eiger][Mythen3][Gotthard2] Options: 0 - 200
*/ */
void setHighVoltage(int value, Positions pos = {}); void setHighVoltage(int value, Positions pos = {});
/** [Jungfrau][Mythen3][Gotthard2][Moench] */ /** [Jungfrau][Moench][Mythen3][Gotthard2] */
Result<bool> getPowerChip(Positions pos = {}) const; Result<bool> getPowerChip(Positions pos = {}) const;
/** [Jungfrau][Mythen3][Gotthard2][Moench] Power the chip. \n /** [Jungfrau][Moench][Mythen3][Gotthard2] Power the chip. \n
* [Moench] Default is disabled. \n * Default is disabled. \n
* [Jungfrau] Default is disabled. Get will return power status. Can be off * [Jungfrau][Moench] Default is disabled. Get will return power status. Can
* if temperature event occured (temperature over temp_threshold with * be off if temperature event occured (temperature over temp_threshold with
* temp_control enabled. Will configure chip (only chip v1.1)\n * temp_control enabled. Will configure chip (only chip v1.1)\n
* [Mythen3][Gotthard2] Default is 1. If module not connected or wrong * [Mythen3][Gotthard2] Default is 1. If module not connected or wrong
* module, powerchip will fail. * module, powerchip will fail.
@ -447,8 +444,8 @@ class Detector {
/** [Gotthard] If 1, adds channel intensity with precalculated values. /** [Gotthard] If 1, adds channel intensity with precalculated values.
* Default is 0 \n * Default is 0 \n
* [Eiger][Jungfrau] Only for virtual servers, if 1, pixels are saturated. * [Eiger][Jungfrau][Moench] Only for virtual servers, if 1, pixels are
* If 0, increasing intensity */ * saturated. If 0, increasing intensity */
void setImageTestMode(const int value, Positions pos = {}); void setImageTestMode(const int value, Positions pos = {});
/** gets list of temperature indices for this detector */ /** gets list of temperature indices for this detector */
@ -458,7 +455,7 @@ class Detector {
* (Degrees) * (Degrees)
* [Mythen3][Gotthard2] Options: TEMPERATURE_FPGA * [Mythen3][Gotthard2] Options: TEMPERATURE_FPGA
* [Gotthard] Options: TEMPERATURE_ADC, TEMPERATURE_FPGA \n * [Gotthard] Options: TEMPERATURE_ADC, TEMPERATURE_FPGA \n
* [Jungfrau] Options: TEMPERATURE_ADC, TEMPERATURE_FPGA \n * [Jungfrau][Moench] Options: TEMPERATURE_ADC, TEMPERATURE_FPGA \n
* [Eiger] Options: TEMPERATURE_FPGA, TEMPERATURE_FPGAEXT, TEMPERATURE_10GE, * [Eiger] Options: TEMPERATURE_FPGA, TEMPERATURE_FPGAEXT, TEMPERATURE_10GE,
* TEMPERATURE_DCDC, TEMPERATURE_SODL, TEMPERATURE_SODR, TEMPERATURE_FPGA2, * TEMPERATURE_DCDC, TEMPERATURE_SODL, TEMPERATURE_SODR, TEMPERATURE_FPGA2,
* TEMPERATURE_FPGA3 \n [CTB] Options: SLOW_ADC_TEMP * TEMPERATURE_FPGA3 \n [CTB] Options: SLOW_ADC_TEMP
@ -475,11 +472,11 @@ class Detector {
void setDefaultDac(defs::dacIndex index, int defaultValue, void setDefaultDac(defs::dacIndex index, int defaultValue,
Positions pos = {}); Positions pos = {});
/** [Jungfrau][Mythen3] */ /** [Jungfrau][Moench][Mythen3] */
Result<int> getDefaultDac(defs::dacIndex index, defs::detectorSettings sett, Result<int> getDefaultDac(defs::dacIndex index, defs::detectorSettings sett,
Positions pos = {}); Positions pos = {});
/** [Jungfrau][Mythen3] */ /** [Jungfrau][Moench][Mythen3] */
void setDefaultDac(defs::dacIndex index, int defaultValue, void setDefaultDac(defs::dacIndex index, int defaultValue,
defs::detectorSettings sett, Positions pos = {}); defs::detectorSettings sett, Positions pos = {});
@ -528,20 +525,21 @@ class Detector {
* mode.*/ * mode.*/
void setParallelMode(bool value, Positions pos = {}); void setParallelMode(bool value, Positions pos = {});
/** [Gotthard2][Jungfrau] */ /** [Gotthard2][Jungfrau][Moench] */
Result<int> getFilterResistor(Positions pos = {}) const; Result<int> getFilterResistor(Positions pos = {}) const;
/** [Gotthard2][Jungfrau] Set filter resistor. Increasing values for /** [Gotthard2][Jungfrau][Moench] Set filter resistor. Increasing values for
* increasing resistance.\n[Gotthard2] Options: [0|1|2|3]. Default is * increasing resistance.\n[Gotthard2] Options: [0|1|2|3]. Default is
* 0.\n[Jungfrau] Options: [0|1]. Default is 1.*/ * 0.\n[Jungfrau][Moench] Options: [0|1]. Default is 1.*/
void setFilterResistor(int value, Positions pos = {}); void setFilterResistor(int value, Positions pos = {});
/** [Gotthard2][Jungfrau] */ /** [Gotthard2][Jungfrau][Moench] */
Result<defs::currentSrcParameters> Result<defs::currentSrcParameters>
getCurrentSource(Positions pos = {}) const; getCurrentSource(Positions pos = {}) const;
/** [Gotthard2][Jungfrau] Please refer documentation on currentSrcParameters /** [Gotthard2][Jungfrau][Moench] Please refer documentation on
* (sls_detector_defs.h) on the structure and its members */ * currentSrcParameters (sls_detector_defs.h) on the structure and its
* members */
void setCurrentSource(defs::currentSrcParameters par, Positions pos = {}); void setCurrentSource(defs::currentSrcParameters par, Positions pos = {});
/** [CTB][Gotthard2] */ /** [CTB][Gotthard2] */
@ -550,14 +548,14 @@ class Detector {
/** [CTB] Options: 0-255 \n [Gotthard2] Options: 0-7 */ /** [CTB] Options: 0-255 \n [Gotthard2] Options: 0-7 */
void setDBITPipeline(int value, Positions pos = {}); void setDBITPipeline(int value, Positions pos = {});
/** [Eiger][Jungfrau] */ /** [Eiger][Jungfrau][Moench] */
Result<int> getReadNRows(Positions pos = {}) const; Result<int> getReadNRows(Positions pos = {}) const;
/** [Eiger] Number of rows to read out per half module /** [Eiger] Number of rows to read out per half module
* Options: 0 - 256. 256 is default. The permissible values depend on * Options: 0 - 256. 256 is default. The permissible values depend on
* dynamic range and 10Gbe enabled. \n[Jungfrau] Number of rows per module * dynamic range and 10Gbe enabled. \n[Jungfrau][Moench] Number of rows per
* starting from the centre. Options: 8 - 512, must be multiples of 8. * module starting from the centre. Options: 8 - 512, must be multiples
* Default is 512. * of 8. Default is 512.
*/ */
void setReadNRows(const int lines, Positions pos = {}); void setReadNRows(const int lines, Positions pos = {});
@ -636,10 +634,9 @@ class Detector {
* different frame numbers for different modules.*/ * different frame numbers for different modules.*/
void setNextFrameNumber(uint64_t value, Positions pos = {}); void setNextFrameNumber(uint64_t value, Positions pos = {});
/** [Eiger][Mythen3][Jungfrau] Sends an internal software trigger to the /** [Eiger][Mythen3][Jungfrau][Moench] Sends an internal software trigger to
* detector block true if command blocks till frames are sent out from that * the detector block true if command blocks till frames are sent out from
* trigger * that trigger [Eiger][Jungfrau][Moench] Block can be true
* [Eiger][Jungfrau] Block can be true
*/ */
void sendSoftwareTrigger(const bool block = false, Positions pos = {}); void sendSoftwareTrigger(const bool block = false, Positions pos = {});
@ -665,23 +662,23 @@ class Detector {
* * * *
* ************************************************/ * ************************************************/
/** [Jungfrau][Gotthard2][Eiger] */ /** [Jungfrau][Moench][Gotthard2][Eiger] */
Result<int> getNumberofUDPInterfaces(Positions pos = {}) const; Result<int> getNumberofUDPInterfaces(Positions pos = {}) const;
/** [Jungfrau][Gotthard2] Number of udp interfaces to stream data from /** [Jungfrau][Moench][Gotthard2] Number of udp interfaces to stream data
* detector. Default is 1. \n Also enables second interface in receiver for * from detector. Default is 1. \n Also enables second interface in receiver
* listening (Writes a file per interface if writing enabled). \n Also * for listening (Writes a file per interface if writing enabled). \n Also
* restarts client and receiver zmq sockets if zmq streaming enabled. \n * restarts client and receiver zmq sockets if zmq streaming enabled. \n
* [Gotthard2] second interface enabled to send veto information via 10Gbps * [Gotthard2] second interface enabled to send veto information via 10Gbps
* for debugging. By default, if veto enabled, it is sent via 2.5 gbps * for debugging. By default, if veto enabled, it is sent via 2.5 gbps
* interface. */ * interface. */
void setNumberofUDPInterfaces(int n, Positions pos = {}); void setNumberofUDPInterfaces(int n, Positions pos = {});
/** [Jungfrau] */ /** [Jungfrau][Moench] */
Result<int> getSelectedUDPInterface(Positions pos = {}) const; Result<int> getSelectedUDPInterface(Positions pos = {}) const;
/** /**
* [Jungfrau] * [Jungfrau][Moench]
* Effective only when number of interfaces is 1. * Effective only when number of interfaces is 1.
* Options: 0 (outer, default), 1(inner)] //TODO: enum? * Options: 0 (outer, default), 1(inner)] //TODO: enum?
*/ */
@ -695,11 +692,11 @@ class Detector {
*/ */
void setSourceUDPIP(const IpAddr ip, Positions pos = {}); void setSourceUDPIP(const IpAddr ip, Positions pos = {});
/** [Jungfrau] bottom half [Gotthard2] veto debugging */ /** [Jungfrau][Moench] bottom half [Gotthard2] veto debugging */
Result<IpAddr> getSourceUDPIP2(Positions pos = {}) const; Result<IpAddr> getSourceUDPIP2(Positions pos = {}) const;
/** [Jungfrau] bottom half [Gotthard2] veto debugging. \n The source UDP IP /** [Jungfrau][Moench] bottom half [Gotthard2] veto debugging. \n The source
* must be in the same subnet of the destination UDP IP2 */ * UDP IP must be in the same subnet of the destination UDP IP2 */
void setSourceUDPIP2(const IpAddr ip, Positions pos = {}); void setSourceUDPIP2(const IpAddr ip, Positions pos = {});
Result<MacAddr> getSourceUDPMAC(Positions pos = {}) const; Result<MacAddr> getSourceUDPMAC(Positions pos = {}) const;
@ -710,10 +707,10 @@ class Detector {
*/ */
void setSourceUDPMAC(const MacAddr mac, Positions pos = {}); void setSourceUDPMAC(const MacAddr mac, Positions pos = {});
/** [Jungfrau] bottom half [Gotthard2] veto debugging */ /** [Jungfrau][Moench] bottom half [Gotthard2] veto debugging */
Result<MacAddr> getSourceUDPMAC2(Positions pos = {}) const; Result<MacAddr> getSourceUDPMAC2(Positions pos = {}) const;
/** [Jungfrau] bottom half [Gotthard2] veto debugging */ /** [Jungfrau][Moench] bottom half [Gotthard2] veto debugging */
void setSourceUDPMAC2(const MacAddr mac, Positions pos = {}); void setSourceUDPMAC2(const MacAddr mac, Positions pos = {});
Result<UdpDestination> getDestinationUDPList(const uint32_t entry, Result<UdpDestination> getDestinationUDPList(const uint32_t entry,
@ -721,16 +718,16 @@ class Detector {
void setDestinationUDPList(const UdpDestination, const int module_id); void setDestinationUDPList(const UdpDestination, const int module_id);
/** [Jungfrau][Eiger][Mythen3][Gotthard2] */ /** [Jungfrau][Moench][Eiger][Mythen3][Gotthard2] */
Result<int> getNumberofUDPDestinations(Positions pos = {}) const; Result<int> getNumberofUDPDestinations(Positions pos = {}) const;
void clearUDPDestinations(Positions pos = {}); void clearUDPDestinations(Positions pos = {});
/** [Jungfrau][Mythen3][Gotthard2] */ /** [Jungfrau][Moench][Mythen3][Gotthard2] */
Result<int> getFirstUDPDestination(Positions pos = {}) const; Result<int> getFirstUDPDestination(Positions pos = {}) const;
/**[Jungfrau][Gotthard2] Options 0-31 (or number of udp destinations)\n /**[Jungfrau][Moench][Gotthard2] Options 0-31 (or number of udp
* [Mythen3] Options 0-63 (or number of udp destinations) * destinations)\n [Mythen3] Options 0-63 (or number of udp destinations)
*/ */
void setFirstUDPDestination(const int value, Positions pos = {}); void setFirstUDPDestination(const int value, Positions pos = {});
@ -739,10 +736,10 @@ class Detector {
/** IP of the interface in receiver that the detector sends data to */ /** IP of the interface in receiver that the detector sends data to */
void setDestinationUDPIP(const IpAddr ip, Positions pos = {}); void setDestinationUDPIP(const IpAddr ip, Positions pos = {});
/** [Jungfrau] bottom half \n [Gotthard2] veto debugging */ /** [Jungfrau][Moench] bottom half \n [Gotthard2] veto debugging */
Result<IpAddr> getDestinationUDPIP2(Positions pos = {}) const; Result<IpAddr> getDestinationUDPIP2(Positions pos = {}) const;
/** [Jungfrau] bottom half \n [Gotthard2] veto debugging */ /** [Jungfrau][Moench] bottom half \n [Gotthard2] veto debugging */
void setDestinationUDPIP2(const IpAddr ip, Positions pos = {}); void setDestinationUDPIP2(const IpAddr ip, Positions pos = {});
Result<MacAddr> getDestinationUDPMAC(Positions pos = {}) const; Result<MacAddr> getDestinationUDPMAC(Positions pos = {}) const;
@ -754,14 +751,15 @@ class Detector {
*/ */
void setDestinationUDPMAC(const MacAddr mac, Positions pos = {}); void setDestinationUDPMAC(const MacAddr mac, Positions pos = {});
/** [Jungfrau] bottom half \n [Gotthard2] veto debugging */ /** [Jungfrau][Moench] bottom half \n [Gotthard2] veto debugging */
Result<MacAddr> getDestinationUDPMAC2(Positions pos = {}) const; Result<MacAddr> getDestinationUDPMAC2(Positions pos = {}) const;
/* [Jungfrau][Gotthard2] Mac address of the receiver (destination) udp /* [Jungfrau][Moench][Gotthard2] Mac address of the receiver (destination)
* interface 2. \n Not mandatory to set as udp_dstip2 retrieves it from * udp interface 2. \n Not mandatory to set as udp_dstip2 retrieves it from
* slsReceiver process but must be set if you use a custom receiver (not * slsReceiver process but must be set if you use a custom receiver (not
* slsReceiver). \n [Jungfrau] bottom half \n [Gotthard2] veto debugging \n * slsReceiver). \n [Jungfrau][Moench] bottom half \n [Gotthard2] veto
* Use router mac address if router in between detector and receiver. * debugging \n Use router mac address if router in between detector and
* receiver.
*/ */
void setDestinationUDPMAC2(const MacAddr mac, Positions pos = {}); void setDestinationUDPMAC2(const MacAddr mac, Positions pos = {});
@ -771,12 +769,13 @@ class Detector {
* calculated (incremented by 1 if no 2nd interface) */ * calculated (incremented by 1 if no 2nd interface) */
void setDestinationUDPPort(int port, int module_id = -1); void setDestinationUDPPort(int port, int module_id = -1);
/** [Eiger] right port[Jungfrau] bottom half [Gotthard2] veto debugging */ /** [Eiger] right port[Jungfrau][Moench] bottom half [Gotthard2] veto
* debugging */
Result<int> getDestinationUDPPort2(Positions pos = {}) const; Result<int> getDestinationUDPPort2(Positions pos = {}) const;
/** [Eiger] right port[Jungfrau] bottom half [Gotthard2] veto debugging \n /** [Eiger] right port[Jungfrau][Moench] bottom half [Gotthard2] veto
* Default is 50002. \n If module_id is -1, ports for each module is * debugging \n Default is 50002. \n If module_id is -1, ports for each
* calculated (incremented by 1 if no 2nd interface)*/ * module is calculated (incremented by 1 if no 2nd interface)*/
void setDestinationUDPPort2(int port, int module_id = -1); void setDestinationUDPPort2(int port, int module_id = -1);
/** Reconfigures Detector with UDP destination. More for debugging as the /** Reconfigures Detector with UDP destination. More for debugging as the
@ -791,27 +790,28 @@ class Detector {
Result<std::string> printRxConfiguration(Positions pos = {}) const; Result<std::string> printRxConfiguration(Positions pos = {}) const;
/** [Eiger][CTB][Moench][Mythen3] */ /** [Eiger][CTB][Mythen3] */
Result<bool> getTenGiga(Positions pos = {}) const; Result<bool> getTenGiga(Positions pos = {}) const;
/** [Eiger][CTB][Moench][Mythen3] */ /** [Eiger][CTB][Mythen3] */
void setTenGiga(bool value, Positions pos = {}); void setTenGiga(bool value, Positions pos = {});
/** [Eiger][Jungfrau] */ /** [Eiger][Jungfrau][Moench] */
Result<bool> getTenGigaFlowControl(Positions pos = {}) const; Result<bool> getTenGigaFlowControl(Positions pos = {}) const;
/** [Eiger][Jungfrau] */ /** [Eiger][Jungfrau][Moench] */
void setTenGigaFlowControl(bool enable, Positions pos = {}); void setTenGigaFlowControl(bool enable, Positions pos = {});
/** [Eiger][Jungfrau][Mythen3] */ /** [Eiger][Jungfrau][Moench][Mythen3] */
Result<int> getTransmissionDelayFrame(Positions pos = {}) const; Result<int> getTransmissionDelayFrame(Positions pos = {}) const;
/** /**
* Eiger][Jungfrau][Mythen3] Transmission delay of first udp packet being * Eiger][Jungfrau][Moench][Mythen3] Transmission delay of first udp packet
* streamed out of the module.\n[Jungfrau] [0-31] Each value represents 1 * being streamed out of the module.\n[Jungfrau][Moench] [0-31] Each value
* ms\n[Eiger] Additional delay to txndelay_left and txndelay_right. Each * represents 1 ms\n[Eiger] Additional delay to txndelay_left and
* value represents 10ns. Typical value is 50000.\n[Mythen3] [0-16777215] * txndelay_right. Each value represents 10ns. Typical value is
* Each value represents 8 ns (125 MHz clock), max is 134 ms. * 50000.\n[Mythen3] [0-16777215] Each value represents 8 ns (125 MHz
* clock), max is 134 ms.
*/ */
void setTransmissionDelayFrame(int value, Positions pos = {}); void setTransmissionDelayFrame(int value, Positions pos = {});
@ -836,16 +836,16 @@ class Detector {
*/ */
void setTransmissionDelayRight(int value, Positions pos = {}); void setTransmissionDelayRight(int value, Positions pos = {});
/** [Eiger][Jungfrau] */ /** [Eiger][Jungfrau][Moench] */
int getTransmissionDelay() const; int getTransmissionDelay() const;
/** /**
* [Eiger][Jungfrau][Mythen3] Set transmission delay for all modules in the * [Eiger][Jungfrau][Moench][Mythen3] Set transmission delay for all modules
* detector using the step size provided.Sets up \n\t\t[Eiger] txdelay_left * in the detector using the step size provided.Sets up \n\t\t[Eiger]
* to (2 * mod_index * n_delay), \n\t\t[Eiger] txdelay_right to ((2 * * txdelay_left to (2 * mod_index * n_delay), \n\t\t[Eiger] txdelay_right to
* mod_index + 1) * n_delay) and \n\t\t[Eiger] txdelay_frame to (2 * ((2 * mod_index + 1) * n_delay) and \n\t\t[Eiger] txdelay_frame to (2
* *num_modules * n_delay) \n\t\t[Jungfrau][Mythen3] txdelay_frame to * *num_modules * n_delay) \n\t\t[Jungfrau][Moench][Mythen3] txdelay_frame
* (num_modules * n_delay) \nfor every module. * to (num_modules * n_delay) \nfor every module.
*/ */
void setTransmissionDelay(int step); void setTransmissionDelay(int step);
@ -1226,22 +1226,22 @@ class Detector {
///@} ///@}
/** @name Jungfrau Specific */ /** @name Jungfrau/Moench Specific */
///@{ ///@{
/************************************************** /**************************************************
* * * *
* Jungfrau Specific * * Jungfrau/Moench Specific *
* * * *
* ************************************************/ * ************************************************/
/** [Jungfrau] */ /** [Jungfrau][Moench] */
Result<double> getChipVersion(Positions pos = {}) const; Result<double> getChipVersion(Positions pos = {}) const;
/** [Jungfrau] */ /** [Jungfrau][Moench] */
Result<int> getThresholdTemperature(Positions pos = {}) const; Result<int> getThresholdTemperature(Positions pos = {}) const;
/** /**
* [Jungfrau]Set threshold temperature in degrees. * [Jungfrau][Moench]Set threshold temperature in degrees.
* If temperature crosses threshold temperature * If temperature crosses threshold temperature
* and temperature control is enabled (default is disabled), power to chip * and temperature control is enabled (default is disabled), power to chip
* will be switched off and temperature event will be set. \n To power on * will be switched off and temperature event will be set. \n To power on
@ -1250,23 +1250,23 @@ class Detector {
*/ */
void setThresholdTemperature(int temp, Positions pos = {}); void setThresholdTemperature(int temp, Positions pos = {});
/** [Jungfrau] */ /** [Jungfrau][Moench] */
Result<bool> getTemperatureControl(Positions pos = {}) const; Result<bool> getTemperatureControl(Positions pos = {}) const;
/** [Jungfrau] refer to setThresholdTemperature /** [Jungfrau][Moench] refer to setThresholdTemperature
* Default is disabled */ * Default is disabled */
void setTemperatureControl(bool enable, Positions pos = {}); void setTemperatureControl(bool enable, Positions pos = {});
/** [Jungfrau] refer to setThresdholdTemperature */ /** [Jungfrau][Moench] refer to setThresdholdTemperature */
Result<int> getTemperatureEvent(Positions pos = {}) const; Result<int> getTemperatureEvent(Positions pos = {}) const;
/** [Jungfrau] refer to setThresdholdTemperature */ /** [Jungfrau][Moench] refer to setThresdholdTemperature */
void resetTemperatureEvent(Positions pos = {}); void resetTemperatureEvent(Positions pos = {});
/** [Jungfrau] */ /** [Jungfrau][Moench] */
Result<bool> getAutoComparatorDisable(Positions pos = {}) const; Result<bool> getAutoComparatorDisable(Positions pos = {}) const;
/** [Jungfrau] Advanced /** [Jungfrau][Moench] Advanced
* //TODO naming * //TODO naming
* By default, the on-chip gain switching is active during the * By default, the on-chip gain switching is active during the
* entire exposure. This mode disables the on-chip gain switching comparator * entire exposure. This mode disables the on-chip gain switching comparator
@ -1278,55 +1278,55 @@ class Detector {
*/ */
void setAutoComparatorDisable(bool value, Positions pos = {}); void setAutoComparatorDisable(bool value, Positions pos = {});
/** [Jungfrau] */ /** [Jungfrau][Moench] */
Result<ns> getComparatorDisableTime(Positions pos = {}) const; Result<ns> getComparatorDisableTime(Positions pos = {}) const;
/** [Jungfrau] Time before end of exposure when comparator is disabled. It /** [Jungfrau][Moench] Time before end of exposure when comparator is
* is only possible for chipv1.1.*/ * disabled. It is only possible for chipv1.1.*/
void setComparatorDisableTime(ns t, Positions pos = {}); void setComparatorDisableTime(ns t, Positions pos = {});
/** [Jungfrau] Advanced TODO naming */ /** [Jungfrau][Moench] Advanced TODO naming */
Result<int> getNumberOfAdditionalStorageCells(Positions pos = {}) const; Result<int> getNumberOfAdditionalStorageCells(Positions pos = {}) const;
/** [Jungfrau] Advanced \n /** [Jungfrau][Moench] Advanced \n
* Only for chipv1.0. Options: 0 - 15. Default: 0. \n * Only for chipv1.0. Options: 0 - 15. Default: 0. \n
* The #images = #frames x #triggers x (#storagecells + 1) */ * The #images = #frames x #triggers x (#storagecells + 1) */
void setNumberOfAdditionalStorageCells(int value); void setNumberOfAdditionalStorageCells(int value);
/** [Jungfrau] Advanced */ /** [Jungfrau][Moench] Advanced */
Result<int> getStorageCellStart(Positions pos = {}) const; Result<int> getStorageCellStart(Positions pos = {}) const;
/** [Jungfrau] Advanced. Sets the storage cell storing the first acquisition /** [Jungfrau][Moench] Advanced. Sets the storage cell storing the first
* of the series. Options: 0-max. max is 15 (default) for chipv1.0 and 3 * acquisition of the series. Options: 0-max. max is 15 (default) for
* (default) for chipv1.1. * chipv1.0 and 3 (default) for chipv1.1.
*/ */
void setStorageCellStart(int cell, Positions pos = {}); void setStorageCellStart(int cell, Positions pos = {});
/** [Jungfrau] Advanced*/ /** [Jungfrau][Moench] Advanced*/
Result<ns> getStorageCellDelay(Positions pos = {}) const; Result<ns> getStorageCellDelay(Positions pos = {}) const;
/** [Jungfrau] Advanced \n Additional time delay between 2 consecutive /** [Jungfrau][Moench] Advanced \n Additional time delay between 2
* exposures in burst mode. \n Options: (0-1638375 ns (resolution of 25ns)\n * consecutive exposures in burst mode. \n Options: (0-1638375 ns
* Only applicable for chipv1.0. * (resolution of 25ns)\n Only applicable for chipv1.0.
*/ */
void setStorageCellDelay(ns value, Positions pos = {}); void setStorageCellDelay(ns value, Positions pos = {});
/** list of possible gainmode */ /** list of possible gainmode */
std::vector<defs::gainMode> getGainModeList() const; std::vector<defs::gainMode> getGainModeList() const;
/** [Jungfrau]*/ /** [Jungfrau][Moench]*/
Result<defs::gainMode> getGainMode(Positions pos = {}) const; Result<defs::gainMode> getGainMode(Positions pos = {}) const;
/** [Jungfrau] Options: DYNAMIC, FORCE_SWITCH_G1, FORCE_SWITCH_G2, /** [Jungfrau][Moench] Options: DYNAMIC, FORCE_SWITCH_G1, FORCE_SWITCH_G2,
* FIX_G1, FIX_G2, FIX_G0 \n\CAUTION: Do not use FIX_G0 without caution, you * FIX_G1, FIX_G2, FIX_G0 \n\CAUTION: Do not use FIX_G0 without caution, you
* can damage the detector!!!\n * can damage the detector!!!\n
*/ */
void setGainMode(const defs::gainMode mode, Positions pos = {}); void setGainMode(const defs::gainMode mode, Positions pos = {});
/** [Jungfrau] Advanced */ /** [Jungfrau][Moench] Advanced */
Result<int> getNumberOfFilterCells(Positions pos = {}) const; Result<int> getNumberOfFilterCells(Positions pos = {}) const;
/** [Jungfrau] Advanced Options[0-12], only for chip v1.1 /** [Jungfrau][Moench] Advanced Options[0-12], only for chip v1.1
*/ */
void setNumberOfFilterCells(int cell, Positions pos = {}); void setNumberOfFilterCells(int cell, Positions pos = {});
@ -1557,69 +1557,68 @@ class Detector {
///@} ///@}
/** @name CTB / Moench Specific */ /** @name CTB Specific */
///@{ ///@{
/************************************************** /**************************************************
* * * *
* CTB / Moench Specific * * CTB Specific *
* * * *
* ************************************************/ * ************************************************/
/** [CTB][Moench] */ /** [CTB] */
Result<int> getNumberOfAnalogSamples(Positions pos = {}) const; Result<int> getNumberOfAnalogSamples(Positions pos = {}) const;
/** [CTB][Moench] */ /** [CTB] */
void setNumberOfAnalogSamples(int value, Positions pos = {}); void setNumberOfAnalogSamples(int value, Positions pos = {});
/** [CTB][Moench] */ /** [CTB] */
Result<int> getADCClock(Positions pos = {}) const; Result<int> getADCClock(Positions pos = {}) const;
/** [CTB][Moench] */ /** [CTB] */
void setADCClock(int value_in_MHz, Positions pos = {}); void setADCClock(int value_in_MHz, Positions pos = {});
/** [CTB][Moench] */ /** [CTB] */
Result<int> getRUNClock(Positions pos = {}) const; Result<int> getRUNClock(Positions pos = {}) const;
/** [CTB][Moench] */ /** [CTB] */
void setRUNClock(int value_in_MHz, Positions pos = {}); void setRUNClock(int value_in_MHz, Positions pos = {});
/** [CTB][Moench] in MHZ */ /** [CTB] in MHZ */
Result<int> getSYNCClock(Positions pos = {}) const; Result<int> getSYNCClock(Positions pos = {}) const;
/** [CTB][Moench] */ /** [CTB] */
Result<int> getADCPipeline(Positions pos = {}) const; Result<int> getADCPipeline(Positions pos = {}) const;
/** [CTB][Moench] */ /** [CTB] */
void setADCPipeline(int value, Positions pos = {}); void setADCPipeline(int value, Positions pos = {});
/** [CTB][Moench] */ /** [CTB] */
Result<int> getVoltage(defs::dacIndex index, Positions pos = {}) const; Result<int> getVoltage(defs::dacIndex index, Positions pos = {}) const;
/** /**
* [CTB][Moench] mV * [CTB] mV
* [Ctb] Options: V_LIMIT, V_POWER_A, V_POWER_B, V_POWER_C, * [Ctb] Options: V_LIMIT, V_POWER_A, V_POWER_B, V_POWER_C,
* V_POWER_D, V_POWER_IO, V_POWER_CHIP * V_POWER_D, V_POWER_IO, V_POWER_CHIP
* [Moench] Options: V_LIMIT
*/ */
void setVoltage(defs::dacIndex index, int value, Positions pos = {}); void setVoltage(defs::dacIndex index, int value, Positions pos = {});
/** /**
* [CTB][Moench] Options: [0- 4] or [1V, 1.14V, 1.33V, 1.6V, 2V] * [CTB] Options: [0- 4] or [1V, 1.14V, 1.33V, 1.6V, 2V]
*/ */
Result<int> getADCVpp(bool mV = false, Positions pos = {}) const; Result<int> getADCVpp(bool mV = false, Positions pos = {}) const;
/** [CTB][Moench] */ /** [CTB] */
void setADCVpp(int value, bool mV = false, Positions pos = {}); void setADCVpp(int value, bool mV = false, Positions pos = {});
/** [CTB][Moench] */ /** [CTB] */
Result<uint32_t> getADCEnableMask(Positions pos = {}) const; Result<uint32_t> getADCEnableMask(Positions pos = {}) const;
/** [CTB][Moench] */ /** [CTB] */
void setADCEnableMask(uint32_t mask, Positions pos = {}); void setADCEnableMask(uint32_t mask, Positions pos = {});
/** [CTB][Moench] */ /** [CTB] */
Result<uint32_t> getTenGigaADCEnableMask(Positions pos = {}) const; Result<uint32_t> getTenGigaADCEnableMask(Positions pos = {}) const;
/** [CTB][Moench] If any of a consecutive 4 bits are enabled, the " /** [CTB] If any of a consecutive 4 bits are enabled, the "
"complete 4 bits are enabled */ "complete 4 bits are enabled */
void setTenGigaADCEnableMask(uint32_t mask, Positions pos = {}); void setTenGigaADCEnableMask(uint32_t mask, Positions pos = {});
///@} ///@}
@ -1721,78 +1720,78 @@ class Detector {
* * * *
* ************************************************/ * ************************************************/
/** [CTB][Moench][Mythen3] Loads ASCII pattern file directly to server /** [CTB][Mythen3] Loads ASCII pattern file directly to server
* (instead of executing line by line)*/ * (instead of executing line by line)*/
void setPattern(const std::string &fname, Positions pos = {}); void setPattern(const std::string &fname, Positions pos = {});
/** [CTB][Moench][Mythen3] Loads pattern parameters structure directly to /** [CTB][Mythen3] Loads pattern parameters structure directly to
* server */ * server */
void setPattern(const Pattern &pat, Positions pos = {}); void setPattern(const Pattern &pat, Positions pos = {});
/** [CTB][Moench][Mythen3] [Ctb][Moench][Mythen3] Saves pattern to file /** [CTB][Mythen3] [Ctb][Mythen3] Saves pattern to file
* (ascii). \n [Ctb][Moench] Also executes pattern.*/ * (ascii). \n [Ctb] Also executes pattern.*/
void savePattern(const std::string &fname); void savePattern(const std::string &fname);
/** [Mythen3][Moench] Loads and runs default pattern */ /** [Mythen3] Loads and runs default pattern */
void loadDefaultPattern(Positions pos = {}); void loadDefaultPattern(Positions pos = {});
/** [CTB][Moench] */ /** [CTB] */
Result<uint64_t> getPatternIOControl(Positions pos = {}) const; Result<uint64_t> getPatternIOControl(Positions pos = {}) const;
/** [CTB][Moench] */ /** [CTB] */
void setPatternIOControl(uint64_t word, Positions pos = {}); void setPatternIOControl(uint64_t word, Positions pos = {});
/** [CTB][Moench][Mythen3] same as executing for ctb and moench */ /** [CTB][Mythen3] same as executing for ctb */
Result<uint64_t> getPatternWord(int addr, Positions pos = {}); Result<uint64_t> getPatternWord(int addr, Positions pos = {});
/** [CTB][Moench] Caution: If word is -1 reads the addr (same as /** [CTB] Caution: If word is -1 reads the addr (same as
* executing the pattern) * executing the pattern)
* [Mythen3] */ * [Mythen3] */
void setPatternWord(int addr, uint64_t word, Positions pos = {}); void setPatternWord(int addr, uint64_t word, Positions pos = {});
/**[CTB][Moench][Mythen3] Options: level: -1 (complete pattern) and 0-2 /**[CTB][Mythen3] Options: level: -1 (complete pattern) and 0-2
* levels * levels
* @returns array of start address and stop address * @returns array of start address and stop address
*/ */
Result<std::array<int, 2>> Result<std::array<int, 2>>
getPatternLoopAddresses(int level, Positions pos = {}) const; getPatternLoopAddresses(int level, Positions pos = {}) const;
/** [CTB][Moench][Mythen3] Options: level: -1 (complete pattern) and 0-2 /** [CTB][Mythen3] Options: level: -1 (complete pattern) and 0-2
* levels */ * levels */
void setPatternLoopAddresses(int level, int start, int stop, void setPatternLoopAddresses(int level, int start, int stop,
Positions pos = {}); Positions pos = {});
/**[CTB][Moench][Mythen3] Options: level: -1 (complete pattern) and 0-2 /**[CTB][Mythen3] Options: level: -1 (complete pattern) and 0-2
* levels */ * levels */
Result<int> getPatternLoopCycles(int level, Positions pos = {}) const; Result<int> getPatternLoopCycles(int level, Positions pos = {}) const;
/** [CTB][Moench][Mythen3] n: 0-2, level: -1 (complete pattern) and 0-2 /** [CTB][Mythen3] n: 0-2, level: -1 (complete pattern) and 0-2
* levels */ * levels */
void setPatternLoopCycles(int level, int n, Positions pos = {}); void setPatternLoopCycles(int level, int n, Positions pos = {});
/**[CTB][Moench][Mythen3] */ /**[CTB][Mythen3] */
Result<int> getPatternWaitAddr(int level, Positions pos = {}) const; Result<int> getPatternWaitAddr(int level, Positions pos = {}) const;
/** [CTB][Moench][Mythen3] Options: level 0-2 */ /** [CTB][Mythen3] Options: level 0-2 */
void setPatternWaitAddr(int level, int addr, Positions pos = {}); void setPatternWaitAddr(int level, int addr, Positions pos = {});
/** [CTB][Moench][Mythen3] */ /** [CTB][Mythen3] */
Result<uint64_t> getPatternWaitTime(int level, Positions pos = {}) const; Result<uint64_t> getPatternWaitTime(int level, Positions pos = {}) const;
/** [CTB][Moench][Mythen3] Options: level 0-2 */ /** [CTB][Mythen3] Options: level 0-2 */
void setPatternWaitTime(int level, uint64_t t, Positions pos = {}); void setPatternWaitTime(int level, uint64_t t, Positions pos = {});
/** [CTB][Moench][Mythen3] */ /** [CTB][Mythen3] */
Result<uint64_t> getPatternMask(Positions pos = {}); Result<uint64_t> getPatternMask(Positions pos = {});
/** [CTB][Moench][Mythen3] Selects the bits that will have a pattern mask /** [CTB][Mythen3] Selects the bits that will have a pattern mask
* applied to the selected patmask for every pattern. */ * applied to the selected patmask for every pattern. */
void setPatternMask(uint64_t mask, Positions pos = {}); void setPatternMask(uint64_t mask, Positions pos = {});
/** [CTB][Moench][Mythen3] */ /** [CTB][Mythen3] */
Result<uint64_t> getPatternBitMask(Positions pos = {}) const; Result<uint64_t> getPatternBitMask(Positions pos = {}) const;
/** [CTB][Moench][Mythen3] Sets the mask applied to every pattern to the /** [CTB][Mythen3] Sets the mask applied to every pattern to the
* selected bits */ * selected bits */
void setPatternBitMask(uint64_t mask, Positions pos = {}); void setPatternBitMask(uint64_t mask, Positions pos = {});
@ -1800,19 +1799,18 @@ class Detector {
void startPattern(Positions pos = {}); void startPattern(Positions pos = {});
///@} ///@}
/** @name Moench specific */ /** @name Json Header specific */
///@{ ///@{
/************************************************** /**************************************************
* * * *
* Moench specific * * Json Header specific *
* * * *
* ************************************************/ * ************************************************/
/** [Moench] */
Result<std::map<std::string, std::string>> Result<std::map<std::string, std::string>>
getAdditionalJsonHeader(Positions pos = {}) const; getAdditionalJsonHeader(Positions pos = {}) const;
/** [Moench] If empty, reset additional json header. Default is empty. Max /** If empty, reset additional json header. Default is empty. Max
* 20 characters for each key/value. Empty value deletes header. Use only if * 20 characters for each key/value. Empty value deletes header. Use only if
* to be processed by an intermediate user process listening to receiver zmq * to be processed by an intermediate user process listening to receiver zmq
* packets such as in Moench */ * packets such as in Moench */
@ -1820,11 +1818,9 @@ class Detector {
const std::map<std::string, std::string> &jsonHeader, const std::map<std::string, std::string> &jsonHeader,
Positions pos = {}); Positions pos = {});
/** [Moench] */
Result<std::string> getAdditionalJsonParameter(const std::string &key, Result<std::string> getAdditionalJsonParameter(const std::string &key,
Positions pos = {}) const; Positions pos = {}) const;
/** /**
* [Moench]
* Sets the value for additional json header parameters. If not found, * Sets the value for additional json header parameters. If not found,
* the pair is appended. Empty value deletes parameter. Max 20 characters * the pair is appended. Empty value deletes parameter. Max 20 characters
* for each key/value. * for each key/value.
@ -1842,41 +1838,41 @@ class Detector {
* * * *
* ************************************************/ * ************************************************/
/** [Jungfrau][Gotthard][CTB][Moench][Mythen3][Gotthard2] /** [Jungfrau][Moench][Gotthard][CTB][Mythen3][Gotthard2]
* Advanced user Function! * Advanced user Function!
* Program firmware from command line, after which detector controller is * Program firmware from command line, after which detector controller is
* rebooted. forceDeleteNormalFile is true, if normal file found * rebooted. forceDeleteNormalFile is true, if normal file found
* in device tree, it must be deleted, a new device drive created and * in device tree, it must be deleted, a new device drive created and
* programming continued.[Jungfrau][CTB][Moench] fname is a pof file (full * programming continued.[Jungfrau][Moench][CTB] fname is a pof file (full
* path) \n [Mythen3][Gotthard2] fname is an rbf file (full path) * path) \n [Mythen3][Gotthard2] fname is an rbf file (full path)
*/ */
void programFPGA(const std::string &fname, const bool forceDeleteNormalFile, void programFPGA(const std::string &fname, const bool forceDeleteNormalFile,
Positions pos = {}); Positions pos = {});
/** [Jungfrau][CTB][Moench] Advanced user Function! */ /** [Jungfrau][Moench][CTB] Advanced user Function! */
void resetFPGA(Positions pos = {}); void resetFPGA(Positions pos = {});
/** [Jungfrau][Eiger][Ctb][Moench][Mythen3][Gotthard2] Copies detector /** [Jungfrau][Moench][Eiger][Ctb][Mythen3][Gotthard2] Copies detector
* server via TCP (without tftp).\nMakes a symbolic link with a shorter * server via TCP (without tftp).\nMakes a symbolic link with a shorter
* name (without vx.x.x).\nThen, detector controller reboots (except * name (without vx.x.x).\nThen, detector controller reboots (except
* Eiger).\n[Jungfrau][Ctb][Moench] Also deletes old server binary and * Eiger).\n[Jungfrau][Moench][Ctb] Also deletes old server binary and
* changes respawn server to the link, which is effective after a reboot. * changes respawn server to the link, which is effective after a reboot.
*/ */
void updateDetectorServer(const std::string &fname, Positions pos = {}); void updateDetectorServer(const std::string &fname, Positions pos = {});
/** [Jungfrau][Ctb][Moench][Mythen3][Gotthard2] \n /** [Jungfrau][Moench][Ctb][Mythen3][Gotthard2] \n
* Advanced Command!! You could damage the detector. Please use with * Advanced Command!! You could damage the detector. Please use with
* caution.\nUpdates the kernel image. Then, detector controller reboots * caution.\nUpdates the kernel image. Then, detector controller reboots
* with new kernel * with new kernel
*/ */
void updateKernel(const std::string &fname, Positions pos = {}); void updateKernel(const std::string &fname, Positions pos = {});
/** [Jungfrau][Gotthard][CTB][Moench][Mythen3][Gotthard2] Advanced user /** [Jungfrau][Moench][Gotthard][CTB][Mythen3][Gotthard2] Advanced user
* Function! */ * Function! */
void rebootController(Positions pos = {}); void rebootController(Positions pos = {});
/** /**
* Advanced user Function!\n [Jungfrau][Gotthard][CTB][Moench] Updates the * Advanced user Function!\n [Jungfrau][Moench][Gotthard][CTB] Updates the
* firmware, detector server, make a soft link and then reboots detector * firmware, detector server, make a soft link and then reboots detector
* controller. \n [Mythen3][Gotthard2] Will require a script to start up the * controller. \n [Mythen3][Gotthard2] Will require a script to start up the
* shorter named server link at start up \n sname is full path name of * shorter named server link at start up \n sname is full path name of
@ -1913,16 +1909,16 @@ class Detector {
/** Advanced user Function! */ /** Advanced user Function! */
Result<int> getBit(uint32_t addr, int bitnr, Positions pos = {}); Result<int> getBit(uint32_t addr, int bitnr, Positions pos = {});
/** [Gotthard][Jungfrau][Mythen3][Gotthard2][CTB][Moench] Advanced user /** [Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][CTB] Advanced user
* Function! */ * Function! */
void executeFirmwareTest(Positions pos = {}); void executeFirmwareTest(Positions pos = {});
/** [Gotthard][Jungfrau][Mythen3][Gotthard2][CTB][Moench] Advanced user /** [Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][CTB] Advanced user
* Function! Writes different values in a R/W register and confirms the * Function! Writes different values in a R/W register and confirms the
* writes to check bus */ * writes to check bus */
void executeBusTest(Positions pos = {}); void executeBusTest(Positions pos = {});
/** [Gotthard][Jungfrau][CTB][Moench] Advanced user Function! not possible /** [Gotthard][Jungfrau][Moench][CTB] Advanced user Function! not possible
* to read back */ * to read back */
void writeAdcRegister(uint32_t addr, uint32_t value, Positions pos = {}); void writeAdcRegister(uint32_t addr, uint32_t value, Positions pos = {});
@ -1935,11 +1931,11 @@ class Detector {
* incompatible. \n Advanced user Function! */ * incompatible. \n Advanced user Function! */
void setInitialChecks(const bool value); void setInitialChecks(const bool value);
/** [CTB][Moench][Jungfrau] Advanced user Function! */ /** [CTB][Jungfrau][Moench] Advanced user Function! */
Result<uint32_t> getADCInvert(Positions pos = {}) const; Result<uint32_t> getADCInvert(Positions pos = {}) const;
/** [CTB][Moench][Jungfrau] Advanced user Function! \n /** [CTB][Jungfrau][Moench] Advanced user Function! \n
[Jungfrau] Inversions on top of default mask */ [Jungfrau][Moench] Inversions on top of default mask */
void setADCInvert(uint32_t value, Positions pos = {}); void setADCInvert(uint32_t value, Positions pos = {});
///@} ///@}
@ -1976,15 +1972,15 @@ class Detector {
Result<std::string> executeCommand(const std::string &value, Result<std::string> executeCommand(const std::string &value,
Positions pos = {}); Positions pos = {});
/** [Jungfrau][Mythen3][CTB][Moench] /** [Jungfrau][Moench][Mythen3][CTB]
* [Gotthard2] only in continuous mode */ * [Gotthard2] only in continuous mode */
Result<int64_t> getNumberOfFramesFromStart(Positions pos = {}) const; Result<int64_t> getNumberOfFramesFromStart(Positions pos = {}) const;
/** [Jungfrau][Mythen3][CTB][Moench] Get time from detector start /** [Jungfrau][Moench][Mythen3][CTB] Get time from detector start
* [Gotthard2] not in burst and auto mode */ * [Gotthard2] not in burst and auto mode */
Result<ns> getActualTime(Positions pos = {}) const; Result<ns> getActualTime(Positions pos = {}) const;
/** [Jungfrau][Mythen3][CTB][Moench] Get timestamp at a frame start /** [Jungfrau][Moench][Mythen3][CTB] Get timestamp at a frame start
* [Gotthard2] not in burst and auto mode */ * [Gotthard2] not in burst and auto mode */
Result<ns> getMeasurementTime(Positions pos = {}) const; Result<ns> getMeasurementTime(Positions pos = {}) const;

View File

@ -516,7 +516,8 @@ std::string CmdProxy::GapPixels(int action) {
std::ostringstream os; std::ostringstream os;
os << cmd << ' '; os << cmd << ' ';
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
os << "[0, 1]\n\t[Eiger][Jungfrau] Include Gap pixels in client data " os << "[0, 1]\n\t[Eiger][Jungfrau][Moench] Include Gap pixels in "
"client data "
"call back in Detecor api. Will not be in detector streaming, " "call back in Detecor api. Will not be in detector streaming, "
"receiver file or streaming. Default is 0. " "receiver file or streaming. Default is 0. "
<< '\n'; << '\n';
@ -591,8 +592,8 @@ std::string CmdProxy::Exptime(int action) {
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
if (cmd == "exptime") { if (cmd == "exptime") {
os << "[duration] [(optional unit) " os << "[duration] [(optional unit) "
"ns|us|ms|s]\n\t[Eiger][Jungfrau][Gotthard][Gotthard2][" "ns|us|ms|s]\n\t[Eiger][Jungfrau][Moench][Gotthard]["
"Moench][Ctb] Exposure time" "Gotthard2][Ctb] Exposure time"
"\n\t[Mythen3] Exposure time of all gate signals in auto and " "\n\t[Mythen3] Exposure time of all gate signals in auto and "
"trigger mode (internal gating). To specify gate index, use " "trigger mode (internal gating). To specify gate index, use "
"exptime1, exptime2, exptime3." "exptime1, exptime2, exptime3."
@ -676,9 +677,10 @@ std::string CmdProxy::ReadoutSpeed(int action) {
os << cmd << ' '; os << cmd << ' ';
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
os << "\n\t[0 or full_speed|1 or half_speed|2 or " os << "\n\t[0 or full_speed|1 or half_speed|2 or "
"quarter_speed]\n\t\t[Eiger][Jungfrau] Readout " "quarter_speed]\n\t\t[Eiger][Jungfrau][Moench] Readout "
"speed of chip.\n\t\t[Eiger] Default speed is full_speed." "speed of chip.\n\t\t[Eiger] Default speed is full_speed."
"\n\t\t[Jungfrau] Default speed is half_speed. full_speed " "\n\t\t[Jungfrau][Moench] Default speed is half_speed. "
"full_speed "
"option only available from v2.0 boards and is recommended to " "option only available from v2.0 boards and is recommended to "
"set " "set "
"number of interfaces to 2. Also overwrites " "number of interfaces to 2. Also overwrites "
@ -687,7 +689,7 @@ std::string CmdProxy::ReadoutSpeed(int action) {
<< '\n'; << '\n';
} else { } else {
defs::detectorType type = det->getDetectorType().squash(); defs::detectorType type = det->getDetectorType().squash();
if (type == defs::CHIPTESTBOARD || type == defs::MOENCH) { if (type == defs::CHIPTESTBOARD) {
throw RuntimeError( throw RuntimeError(
"ReadoutSpeed not implemented. Did you mean runclk?"); "ReadoutSpeed not implemented. Did you mean runclk?");
} }
@ -716,10 +718,11 @@ std::string CmdProxy::Adcphase(int action) {
os << cmd << ' '; os << cmd << ' ';
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
os << "[n_value] " os << "[n_value] "
"[(optional)deg]\n\t[Jungfrau][Ctb][Moench][Gotthard] " "[(optional)deg]\n\t[Jungfrau][Moench][Ctb][Gotthard] "
"Phase shift of ADC clock. \n\t[Jungfrau] Absolute phase shift. " "Phase shift of ADC clock. \n\t[Jungfrau][Moench] Absolute phase "
"shift. "
"If deg used, then shift in degrees. Changing Speed also resets " "If deg used, then shift in degrees. Changing Speed also resets "
"adcphase to recommended defaults.\n\t[Ctb][Moench] Absolute " "adcphase to recommended defaults.\n\t[Ctb] Absolute "
"phase shift. If deg used, then shift in degrees. Changing " "phase shift. If deg used, then shift in degrees. Changing "
"adcclk also resets adcphase and sets it to previous " "adcclk also resets adcphase and sets it to previous "
"values.\n\t[Gotthard] Relative phase shift. Cannot get" "values.\n\t[Gotthard] Relative phase shift. Cannot get"
@ -772,7 +775,8 @@ std::string CmdProxy::Dbitphase(int action) {
std::ostringstream os; std::ostringstream os;
os << cmd << ' '; os << cmd << ' ';
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
os << "[n_value] [(optional)deg]\n\t[Ctb][Jungfrau] Phase shift of " os << "[n_value] [(optional)deg]\n\t[Ctb][Jungfrau][Moench] Phase "
"shift of "
"clock to latch digital bits. Absolute phase shift. If deg used, " "clock to latch digital bits. Absolute phase shift. If deg used, "
"then shift in degrees. \n\t[Ctb]Changing dbitclk also resets " "then shift in degrees. \n\t[Ctb]Changing dbitclk also resets "
"dbitphase and sets to previous values." "dbitphase and sets to previous values."
@ -1009,7 +1013,8 @@ std::string CmdProxy::CurrentSource(int action) {
os << "\n\t[0|1]\n\t\t[Gotthard2] Enable or disable current source. " os << "\n\t[0|1]\n\t\t[Gotthard2] Enable or disable current source. "
"Default " "Default "
"is disabled.\n\t[0|1] [fix|nofix] [select source] [(only for " "is disabled.\n\t[0|1] [fix|nofix] [select source] [(only for "
"chipv1.1)normal|low]\n\t\t[Jungfrau] Disable or enable current " "chipv1.1)normal|low]\n\t\t[Jungfrau][Moench] Disable or enable "
"current "
"source with some parameters. The select source is 0-63 for " "source with some parameters. The select source is 0-63 for "
"chipv1.0 and a 64 bit mask for chipv1.1. To disable, one needs " "chipv1.0 and a 64 bit mask for chipv1.1. To disable, one needs "
"only one argument '0'." "only one argument '0'."
@ -1258,7 +1263,7 @@ std::string CmdProxy::ResetDacs(int action) {
os << cmd << ' '; os << cmd << ' ';
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
os << "[(optional) hard] " os << "[(optional) hard] "
"\n\t[Eiger][Jungfrau][Gotthard][Moench][Gotthard2][" "\n\t[Eiger][Jungfrau][Moench][Gotthard][Gotthard2]["
"Mythen3]Reset dac values to the defaults. A 'hard' optional " "Mythen3]Reset dac values to the defaults. A 'hard' optional "
"reset will reset the dacs to the hardcoded defaults in on-board " "reset will reset the dacs to the hardcoded defaults in on-board "
"detector server." "detector server."
@ -1289,7 +1294,8 @@ std::string CmdProxy::DefaultDac(int action) {
os << cmd << ' '; os << cmd << ' ';
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
os << "[dac name][value][(optional)setting]\n\tSets the default for " os << "[dac name][value][(optional)setting]\n\tSets the default for "
"that dac to this value.\n\t[Jungfrau][Mythen3] When settings is " "that dac to this value.\n\t[Jungfrau][Moench][Mythen3] When "
"settings is "
"provided, it sets the default value only for that setting" "provided, it sets the default value only for that setting"
<< '\n'; << '\n';
} else if (action == defs::GET_ACTION) { } else if (action == defs::GET_ACTION) {
@ -1432,10 +1438,12 @@ std::string CmdProxy::Trigger(int action) {
os << cmd << ' '; os << cmd << ' ';
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
if (cmd == "trigger") { if (cmd == "trigger") {
os << "\n\t[Eiger][Mythen3][Jungfrau] Sends software trigger " os << "\n\t[Eiger][Mythen3][Jungfrau][Moench] Sends software "
"trigger "
"signal to detector"; "signal to detector";
} else if (cmd == "blockingtrigger") { } else if (cmd == "blockingtrigger") {
os << "\n\t[Eiger][Jungfrau] Sends software trigger signal to " os << "\n\t[Eiger][Jungfrau][Moench] Sends software trigger signal "
"to "
"detector and blocks till the frames are sent out for that " "detector and blocks till the frames are sent out for that "
"trigger."; "trigger.";
} else { } else {
@ -1524,7 +1532,8 @@ std::string CmdProxy::UDPDestinationList(int action) {
"[(optional)mac2=xx:xx:xx:xx:xx:xx]\n\t[port=value] " "[(optional)mac2=xx:xx:xx:xx:xx:xx]\n\t[port=value] "
"[(optional)port2=value\n\tThe order of ip, mac and port does " "[(optional)port2=value\n\tThe order of ip, mac and port does "
"not matter. entry_value can be >0 only for " "not matter. entry_value can be >0 only for "
"[Eiger][Jungfrau][Mythen3][Gotthard2] where round robin is " "[Eiger][Jungfrau][Moench][Mythen3][Gotthard2] where round robin "
"is "
"implemented. If 'auto' used, then ip is set to ip of " "implemented. If 'auto' used, then ip is set to ip of "
"rx_hostname." "rx_hostname."
<< '\n'; << '\n';
@ -1603,9 +1612,10 @@ std::string CmdProxy::UDPSourceIP2(int action) {
std::ostringstream os; std::ostringstream os;
os << cmd << ' '; os << cmd << ' ';
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
os << "[x.x.x.x] or auto\n\t[Jungfrau][Gotthard2] Ip address of the " os << "[x.x.x.x] or auto\n\t[Jungfrau][Moench][Gotthard2] Ip address "
"of the "
"detector (source) udp interface 2. Must be same subnet as " "detector (source) udp interface 2. Must be same subnet as "
"destination udp ip2.\n\t [Jungfrau] top half or inner " "destination udp ip2.\n\t [Jungfrau][Moench] top half or inner "
"interface\n\t [Gotthard2] veto debugging. If 'auto' used, then " "interface\n\t [Gotthard2] veto debugging. If 'auto' used, then "
"ip is set to ip of rx_hostname." "ip is set to ip of rx_hostname."
<< '\n'; << '\n';
@ -1675,9 +1685,10 @@ std::string CmdProxy::UDPDestinationIP2(int action) {
std::ostringstream os; std::ostringstream os;
os << cmd << ' '; os << cmd << ' ';
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
os << "[x.x.x.x] or auto\n\t[Jungfrau][Gotthard2] Ip address of the " os << "[x.x.x.x] or auto\n\t[Jungfrau][Moench][Gotthard2] Ip address "
"of the "
"receiver (destination) udp interface 2. If 'auto' used, then ip " "receiver (destination) udp interface 2. If 'auto' used, then ip "
"is set to ip of rx_hostname.\n\t[Jungfrau] bottom half " "is set to ip of rx_hostname.\n\t[Jungfrau][Moench] bottom half "
"\n\t[Gotthard2] veto debugging. " "\n\t[Gotthard2] veto debugging. "
<< '\n'; << '\n';
} else if (action == defs::GET_ACTION) { } else if (action == defs::GET_ACTION) {
@ -1711,12 +1722,13 @@ std::string CmdProxy::TransmissionDelay(int action) {
std::ostringstream os; std::ostringstream os;
os << cmd << ' '; os << cmd << ' ';
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
os << "[n_delay]\n\t[Eiger][Jungfrau][Mythen3] Set transmission delay " os << "[n_delay]\n\t[Eiger][Jungfrau][Moench][Mythen3] Set "
"transmission delay "
"for all modules in the detector using the step size " "for all modules in the detector using the step size "
"provided.Sets up \n\t\t[Eiger] txdelay_left to (2 * mod_index * " "provided.Sets up \n\t\t[Eiger] txdelay_left to (2 * mod_index * "
"n_delay), \n\t\t[Eiger] txdelay_right to ((2 * mod_index + 1) * " "n_delay), \n\t\t[Eiger] txdelay_right to ((2 * mod_index + 1) * "
"n_delay) and \n\t\t[Eiger] txdelay_frame to (2 *num_modules * " "n_delay) and \n\t\t[Eiger] txdelay_frame to (2 *num_modules * "
"n_delay) \n\t\t[Jungfrau][Mythen3] txdelay_frame to " "n_delay) \n\t\t[Jungfrau][Moench][Mythen3] txdelay_frame to "
"(num_modules * n_delay) \nfor every module." "(num_modules * n_delay) \nfor every module."
<< '\n'; << '\n';
} else if (action == defs::GET_ACTION) { } else if (action == defs::GET_ACTION) {
@ -2058,7 +2070,8 @@ std::string CmdProxy::TemperatureEvent(int action) {
std::ostringstream os; std::ostringstream os;
os << cmd << ' '; os << cmd << ' ';
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
os << "[0]\n\t[Jungfrau] 1, if a temperature event occured. To clear " os << "[0]\n\t[Jungfrau][Moench] 1, if a temperature event occured. To "
"clear "
"this event, set it to 0.\n\tIf temperature crosses threshold " "this event, set it to 0.\n\tIf temperature crosses threshold "
"temperature and temperature control is enabled, power to chip " "temperature and temperature control is enabled, power to chip "
"will be switched off and temperature event occurs. To power on " "will be switched off and temperature event occurs. To power on "
@ -2552,14 +2565,14 @@ std::string CmdProxy::GainCaps(int action) {
return os.str(); return os.str();
} }
/* CTB / Moench Specific */ /* CTB Specific */
std::string CmdProxy::Samples(int action) { std::string CmdProxy::Samples(int action) {
std::ostringstream os; std::ostringstream os;
os << cmd << ' '; os << cmd << ' ';
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
os << "[n_samples]\n\t[CTB] Number of samples (both analog and " os << "[n_samples]\n\t[CTB] Number of samples (both analog and "
"digitial) expected.\n\t[Moench] Number of samples (analog only)" "digitial) expected.\n"
<< '\n'; << '\n';
} else if (action == defs::GET_ACTION) { } else if (action == defs::GET_ACTION) {
if (!args.empty()) { if (!args.empty()) {
@ -2601,7 +2614,7 @@ std::string CmdProxy::AdcVpp(int action) {
os << cmd << ' '; os << cmd << ' ';
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
os << "[dac or mV value][(optional unit) mV] \n\t[Ctb][Moench] Vpp of " os << "[dac or mV value][(optional unit) mV] \n\t[Ctb] Vpp of "
"ADC.\n\t 0 -> 1V ; 1 -> 1.14V ; 2 -> 1.33V ; 3 -> 1.6V ; 4 -> " "ADC.\n\t 0 -> 1V ; 1 -> 1.14V ; 2 -> 1.33V ; 3 -> 1.6V ; 4 -> "
"2V. \n\tAdvanced User function!\n" "2V. \n\tAdvanced User function!\n"
<< '\n'; << '\n';
@ -2743,7 +2756,7 @@ std::string CmdProxy::Pattern(int action) {
std::ostringstream os; std::ostringstream os;
os << cmd << ' '; os << cmd << ' ';
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
os << "[fname]\n\t[Mythen3][Moench][Ctb] Loads ASCII pattern file " os << "[fname]\n\t[Mythen3][Ctb] Loads ASCII pattern file "
"directly to server (instead of executing line by line)" "directly to server (instead of executing line by line)"
<< '\n'; << '\n';
} else if (action == defs::GET_ACTION) { } else if (action == defs::GET_ACTION) {
@ -2764,8 +2777,8 @@ std::string CmdProxy::PatternWord(int action) {
std::ostringstream os; std::ostringstream os;
os << cmd << ' '; os << cmd << ' ';
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
os << "[step or address] [64 bit mask]\n\t[Ctb][Moench][Mythen3] 64 " os << "[step or address] [64 bit mask]\n\t[Ctb][Mythen3] 64 "
"bit pattern at address of pattern memory.\n\t[Ctb][Moench] read " "bit pattern at address of pattern memory.\n\t[Ctb] read "
"is same as executing pattern" "is same as executing pattern"
<< '\n'; << '\n';
} else if (action == defs::GET_ACTION) { } else if (action == defs::GET_ACTION) {
@ -2824,11 +2837,11 @@ std::string CmdProxy::PatternLoopAddresses(int action) {
os << cmd << ' '; os << cmd << ' ';
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
if (cmd == "patlimits") { if (cmd == "patlimits") {
os << "[start addr] [stop addr] \n\t[Ctb][Moench][Mythen3] Limits " os << "[start addr] [stop addr] \n\t[Ctb][Mythen3] Limits "
"of complete pattern." "of complete pattern."
<< '\n'; << '\n';
} else if (cmd == "patloop") { } else if (cmd == "patloop") {
os << "[0-6] [start addr] [stop addr] \n\t[Ctb][Moench][Mythen3] " os << "[0-6] [start addr] [stop addr] \n\t[Ctb][Mythen3] "
"Limits of the loop level provided." "Limits of the loop level provided."
<< "\n\t[Mythen3] Level options: 0-3 only." << '\n'; << "\n\t[Mythen3] Level options: 0-3 only." << '\n';
} else { } else {
@ -2867,7 +2880,7 @@ std::string CmdProxy::PatternLoopCycles(int action) {
os << cmd << ' '; os << cmd << ' ';
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
if (cmd == "patnloop") { if (cmd == "patnloop") {
os << "[0-6] [n_cycles] \n\t[Ctb][Moench][Mythen3] Number of " os << "[0-6] [n_cycles] \n\t[Ctb][Mythen3] Number of "
"cycles of " "cycles of "
"the loop level provided." "the loop level provided."
<< "\n\t[Mythen3] Level options: 0-3 only." << '\n'; << "\n\t[Mythen3] Level options: 0-3 only." << '\n';
@ -2901,7 +2914,7 @@ std::string CmdProxy::PatternWaitAddress(int action) {
os << cmd << ' '; os << cmd << ' ';
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
if (cmd == "patwait") { if (cmd == "patwait") {
os << "[0-6] [addr] \n\t[Ctb][Moench][Mythen3] Wait address for " os << "[0-6] [addr] \n\t[Ctb][Mythen3] Wait address for "
"loop level provided." "loop level provided."
<< "\n\t[Mythen3] Level options: 0-3 only."; << "\n\t[Mythen3] Level options: 0-3 only.";
} else { } else {
@ -2935,7 +2948,7 @@ std::string CmdProxy::PatternWaitTime(int action) {
os << cmd << ' '; os << cmd << ' ';
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
if (cmd == "patwaittime") { if (cmd == "patwaittime") {
os << "[0-6] [n_clk] \n\t[Ctb][Moench][Mythen3] Wait time in clock " os << "[0-6] [n_clk] \n\t[Ctb][Mythen3] Wait time in clock "
"cycles for the loop provided." "cycles for the loop provided."
<< "\n\t[Mythen3] Level options: 0-3 only." << '\n'; << "\n\t[Mythen3] Level options: 0-3 only." << '\n';
} else { } else {
@ -2959,8 +2972,6 @@ std::string CmdProxy::PatternWaitTime(int action) {
return os.str(); return os.str();
} }
/* Moench */
std::string CmdProxy::AdditionalJsonHeader(int action) { std::string CmdProxy::AdditionalJsonHeader(int action) {
std::ostringstream os; std::ostringstream os;
os << cmd << ' '; os << cmd << ' ';
@ -3043,8 +3054,9 @@ std::string CmdProxy::ProgramFpga(int action) {
os << cmd << ' '; os << cmd << ' ';
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
os << "[fname.pof | fname.rbf (full " os << "[fname.pof | fname.rbf (full "
"path)][(opitonal)--force-delete-normal-file]\n\t[Jungfrau][Ctb][" "path)][(opitonal)--force-delete-normal-file]\n\t[Jungfrau]["
"Moench] Programs FPGA from pof file (full path). Then, detector " "Moench][Ctb] "
"Programs FPGA from pof file (full path). Then, detector "
"controller is rebooted. \n\t\tUse --force-delete-normal-file " "controller is rebooted. \n\t\tUse --force-delete-normal-file "
"argument, if normal file found in device tree, it must be " "argument, if normal file found in device tree, it must be "
"deleted, a new device drive created and programming " "deleted, a new device drive created and programming "
@ -3078,11 +3090,11 @@ std::string CmdProxy::UpdateDetectorServer(int action) {
os << cmd << ' '; os << cmd << ' ';
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
os << "[server_name with full " os << "[server_name with full "
"path]\n\t[Jungfrau][Eiger][Ctb][Moench][Mythen3][Gotthard2] " "path]\n\t[Jungfrau][Moench][Eiger][Ctb][Mythen3][Gotthard2] "
"Copies detector server via TCP (without tftp). Makes a symbolic " "Copies detector server via TCP (without tftp). Makes a symbolic "
"link with a shorter name (without vx.x.x). Then, detector " "link with a shorter name (without vx.x.x). Then, detector "
"controller reboots (except " "controller reboots (except "
"Eiger).\n\t[Jungfrau][Ctb][Moench]Also changes respawn server " "Eiger).\n\t[Jungfrau][Moench][Ctb]Also changes respawn server "
"to the link, which is effective after a reboot." "to the link, which is effective after a reboot."
<< '\n'; << '\n';
} else if (action == defs::GET_ACTION) { } else if (action == defs::GET_ACTION) {
@ -3104,7 +3116,7 @@ std::string CmdProxy::UpdateKernel(int action) {
os << cmd << ' '; os << cmd << ' ';
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
os << "[kernel_name with full " os << "[kernel_name with full "
"path]\n\t[Jungfrau][Ctb][Moench][Mythen3][Gotthard2] Advanced " "path]\n\t[Jungfrau][Moench][Ctb][Mythen3][Gotthard2] Advanced "
"Command!! You could damage the detector. Please use with " "Command!! You could damage the detector. Please use with "
"caution.\n\tUpdates the kernel image. Then, detector controller " "caution.\n\tUpdates the kernel image. Then, detector controller "
"reboots with new kernel." "reboots with new kernel."
@ -3129,7 +3141,7 @@ std::string CmdProxy::UpdateFirmwareAndDetectorServer(int action) {
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
os << "\n\tWithout tftp: [server_name (incl fullpath)] [fname.pof " os << "\n\tWithout tftp: [server_name (incl fullpath)] [fname.pof "
"(incl full path)] This does not use " "(incl full path)] This does not use "
"tftp.\n\t\t[Jungfrau][Gotthard][CTB][Moench] Updates the " "tftp.\n\t\t[Jungfrau][Moench][Gotthard][CTB] Updates the "
"firmware, detector server, deletes old server, creates the " "firmware, detector server, deletes old server, creates the "
"symbolic link and then reboots detector controller. " "symbolic link and then reboots detector controller. "
"\n\t\t[Mythen3][Gotthard2] will require a script to start up " "\n\t\t[Mythen3][Gotthard2] will require a script to start up "
@ -3191,7 +3203,7 @@ std::string CmdProxy::AdcRegister(int action) {
std::ostringstream os; std::ostringstream os;
os << cmd << ' '; os << cmd << ' ';
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
os << "[address] [value]\n\t[Jungfrau][Ctb][Moench][Gotthard] Writes " os << "[address] [value]\n\t[Jungfrau][Moench][Ctb][Gotthard] Writes "
"to an adc register in hex. Advanced user Function!" "to an adc register in hex. Advanced user Function!"
<< '\n'; << '\n';
} else if (action == defs::GET_ACTION) { } else if (action == defs::GET_ACTION) {

View File

@ -1252,11 +1252,12 @@ class CmdProxy {
GET_COMMAND(rx_version, getReceiverVersion, "\n\tReceiver version"); GET_COMMAND(rx_version, getReceiverVersion, "\n\tReceiver version");
GET_COMMAND_HEX(serialnumber, getSerialNumber, GET_COMMAND_HEX(serialnumber, getSerialNumber,
"\n\t[Jungfrau][Gotthard][Mythen3][Gotthard2][CTB][Moench]" "\n\t[Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][CTB]"
"Serial number of detector."); "Serial number of detector.");
GET_COMMAND(moduleid, getModuleId, GET_COMMAND(
"\n\t[Gotthard2][Eiger][Mythen3][Jungfrau] 16 bit value " moduleid, getModuleId,
"\n\t[Gotthard2][Eiger][Mythen3][Jungfrau][Moench] 16 bit value "
"(ideally unique) that is streamed out in the UDP header of " "(ideally unique) that is streamed out in the UDP header of "
"the detector. Picked up from a file on the module."); "the detector. Picked up from a file on the module.");
@ -1278,12 +1279,10 @@ class CmdProxy {
"verylowgain, g1_hg, g1_lg, g2_hc_hg, g2_hc_lg, " "verylowgain, g1_hg, g1_lg, g2_hc_hg, g2_hc_lg, "
"g2_lc_hg, g2_lc_lg, g4_hg, g4_lg, gain0]" "g2_lc_hg, g2_lc_lg, g4_hg, g4_lg, gain0]"
"\n\t Detector Settings" "\n\t Detector Settings"
"\n\t[Jungfrau] - [ gain0 | highgain0]" "\n\t[Jungfrau][Moench] - [ gain0 | highgain0]"
"\n\t[Gotthard] - [dynamicgain | highgain | lowgain | " "\n\t[Gotthard] - [dynamicgain | highgain | lowgain | "
"mediumgain | veryhighgain]" "mediumgain | veryhighgain]"
"\n\t[Gotthard2] - [dynamicgain | fixgain1 | fixgain2]" "\n\t[Gotthard2] - [dynamicgain | fixgain1 | fixgain2]"
"\n\t[Moench] - [g1_hg | g1_lg | g2_hc_hg | g2_hc_lg | "
"g2_lc_hg | g2_lc_lg | g4_hg | g4_lg]"
"\n\t[Mythen3] - [standard | fast | highgain] Also changes vrshaper " "\n\t[Mythen3] - [standard | fast | highgain] Also changes vrshaper "
"and vrpreamp. \n\t[Eiger] Use threshold or thresholdnotb. \n\t[Eiger] " "and vrpreamp. \n\t[Eiger] Use threshold or thresholdnotb. \n\t[Eiger] "
"threshold and settings loaded from file found in settingspath. " "threshold and settings loaded from file found in settingspath. "
@ -1301,21 +1300,23 @@ class CmdProxy {
INTEGER_COMMAND_VEC_ID( INTEGER_COMMAND_VEC_ID(
fliprows, getFlipRows, setFlipRows, StringTo<int>, fliprows, getFlipRows, setFlipRows, StringTo<int>,
"[0, 1]\n\t[Eiger] flips rows paramater sent to slsreceiver " "[0, 1]\n\t[Eiger] flips rows paramater sent to slsreceiver "
"to stream as json parameter to flip rows in gui \n\t[Jungfrau] flips " "to stream as json parameter to flip rows in gui "
"\n\t[Jungfrau][Moench] flips "
"rows in the detector itself. For bottom module and number of " "rows in the detector itself. For bottom module and number of "
"interfaces must be set to 2. slsReceiver and slsDetectorGui " "interfaces must be set to 2. slsReceiver and slsDetectorGui "
"does not handle."); "does not handle.");
INTEGER_COMMAND_VEC_ID_GET( INTEGER_COMMAND_VEC_ID_GET(master, getMaster, setMaster, StringTo<int>,
master, getMaster, setMaster, StringTo<int>, "[0, 1]\n\t[Eiger][Gotthard2][Jungfrau][Moench] "
"[0, 1]\n\t[Eiger][Gotthard2][Jungfrau] Sets (half) module to master " "Sets (half) module to master "
"and other(s) to " "and other(s) to "
"slaves.\n\t[Gotthard][Gotthard2][Mythen3][Eiger][Jungfrau] Gets if " "slaves.\n\t[Gotthard][Gotthard2][Mythen3]["
"Eiger][Jungfrau][Moench] Gets if "
"the current (half) module is master."); "the current (half) module is master.");
INTEGER_COMMAND_SET_NOID_GET_ID(sync, getSynchronization, INTEGER_COMMAND_SET_NOID_GET_ID(
setSynchronization, StringTo<int>, sync, getSynchronization, setSynchronization, StringTo<int>,
"[0, 1]\n\t[Jungfrau] Enables or disables " "[0, 1]\n\t[Jungfrau][Moench] Enables or disables "
"synchronization between modules."); "synchronization between modules.");
/* acquisition parameters */ /* acquisition parameters */
@ -1336,28 +1337,29 @@ class CmdProxy {
period, getPeriod, setPeriod, period, getPeriod, setPeriod,
"[duration] [(optional unit) ns|us|ms|s]\n\tPeriod between frames"); "[duration] [(optional unit) ns|us|ms|s]\n\tPeriod between frames");
TIME_COMMAND(delay, getDelayAfterTrigger, setDelayAfterTrigger, TIME_COMMAND(
delay, getDelayAfterTrigger, setDelayAfterTrigger,
"[duration] [(optional unit) " "[duration] [(optional unit) "
"ns|us|ms|s]\n\t[Jungfrau][Gotthard][Mythen3][Gotthard2][Ctb][" "ns|us|ms|s]\n\t[Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][Ctb]["
"Moench] Delay after trigger"); "Moench] Delay after trigger");
GET_COMMAND(framesl, getNumberOfFramesLeft, GET_COMMAND(framesl, getNumberOfFramesLeft,
"\n\t[Gotthard][Jungfrau][Mythen3][Gotthard2][CTB][Moench] " "\n\t[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][CTB] "
"Number of frames left in acquisition." "Number of frames left in acquisition."
"\n\t[Gotthard2] only in continuous auto mode."); "\n\t[Gotthard2] only in continuous auto mode.");
GET_COMMAND(triggersl, getNumberOfTriggersLeft, GET_COMMAND(triggersl, getNumberOfTriggersLeft,
"\n\t[Gotthard][Jungfrau][Mythen3][Gotthard2][CTB][Moench] " "\n\t[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][CTB] "
"Number of triggers left in acquisition. Only when external " "Number of triggers left in acquisition. Only when external "
"trigger used."); "trigger used.");
TIME_GET_COMMAND(delayl, getDelayAfterTriggerLeft, TIME_GET_COMMAND(delayl, getDelayAfterTriggerLeft,
"\n\t[Gotthard][Jungfrau][Mythen3][Gotthard2][CTB][Moench]" "\n\t[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][CTB]"
" DelayLeft Delay Left in Acquisition." " DelayLeft Delay Left in Acquisition."
"\n\t[Gotthard2] only in continuous mode."); "\n\t[Gotthard2] only in continuous mode.");
TIME_GET_COMMAND(periodl, getPeriodLeft, TIME_GET_COMMAND(periodl, getPeriodLeft,
"\n\t[Gotthard][Jungfrau][CTB][Moench][Mythen3][Gotthard2]" "\n\t[Gotthard][Jungfrau][Moench][CTB][Mythen3][Gotthard2]"
" Period left for current frame." " Period left for current frame."
"\n\t[Gotthard2] only in continuous mode."); "\n\t[Gotthard2] only in continuous mode.");
@ -1368,7 +1370,7 @@ class CmdProxy {
"[Eiger] Options: 4, 8, 12, 16, 32. If set to 32, also sets " "[Eiger] Options: 4, 8, 12, 16, 32. If set to 32, also sets "
"clkdivider to 2, else to 0.\n\t" "clkdivider to 2, else to 0.\n\t"
"[Mythen3] Options: 8, 16, 32\n\t" "[Mythen3] Options: 8, 16, 32\n\t"
"[Jungfrau][Gotthard][Ctb][Moench][Mythen3][Gotthard2] 16"); "[Jungfrau][Moench][Gotthard][Ctb][Mythen3][Gotthard2] 16");
GET_COMMAND_NOID(drlist, getDynamicRangeList, GET_COMMAND_NOID(drlist, getDynamicRangeList,
"\n\tGets the list of dynamic ranges for this detector."); "\n\tGets the list of dynamic ranges for this detector.");
@ -1377,7 +1379,7 @@ class CmdProxy {
timing, getTimingMode, setTimingMode, timing, getTimingMode, setTimingMode,
StringTo<slsDetectorDefs::timingMode>, StringTo<slsDetectorDefs::timingMode>,
"[auto|trigger|gating|burst_trigger]\n\tTiming Mode of " "[auto|trigger|gating|burst_trigger]\n\tTiming Mode of "
"detector.\n\t[Jungfrau][Gotthard][Ctb][Moench][Gotthard2] " "detector.\n\t[Jungfrau][Moench][Gotthard][Ctb][Gotthard2] "
"[auto|trigger]\n\t[Mythen3] " "[auto|trigger]\n\t[Mythen3] "
"[auto|trigger|gating|trigger_gating]\n\t[Eiger] " "[auto|trigger|gating|trigger_gating]\n\t[Eiger] "
"[auto|trigger|gating|burst_trigger]"); "[auto|trigger|gating|burst_trigger]");
@ -1390,11 +1392,12 @@ class CmdProxy {
"\n\tList of readout speed levels implemented for this detector."); "\n\tList of readout speed levels implemented for this detector.");
GET_COMMAND(maxadcphaseshift, getMaxADCPhaseShift, GET_COMMAND(maxadcphaseshift, getMaxADCPhaseShift,
"\n\t[Jungfrau][CTB][Moench] Absolute maximum Phase shift of " "\n\t[Jungfrau][Moench][CTB] Absolute maximum Phase shift of "
"ADC clock."); "ADC clock.");
GET_COMMAND(maxdbitphaseshift, getMaxDBITPhaseShift, GET_COMMAND(
"\n\t[CTB][Jungfrau] Absolute maximum Phase shift of of the " maxdbitphaseshift, getMaxDBITPhaseShift,
"\n\t[CTB][Jungfrau][Moench] Absolute maximum Phase shift of of the "
"clock to latch digital bits."); "clock to latch digital bits.");
INTEGER_COMMAND_VEC_ID(highvoltage, getHighVoltage, setHighVoltage, INTEGER_COMMAND_VEC_ID(highvoltage, getHighVoltage, setHighVoltage,
@ -1402,12 +1405,12 @@ class CmdProxy {
"[n_value]\n\tHigh voltage to the sensor in Voltage." "[n_value]\n\tHigh voltage to the sensor in Voltage."
"\n\t[Gotthard] [0|90|110|120|150|180|200]" "\n\t[Gotthard] [0|90|110|120|150|180|200]"
"\n\t[Eiger][Mythen3][Gotthard2] 0-200" "\n\t[Eiger][Mythen3][Gotthard2] 0-200"
"\n\t[Jungfrau][Ctb][Moench] [0|60-200]"); "\n\t[Jungfrau][Moench][Ctb] [0|60-200]");
INTEGER_COMMAND_VEC_ID( INTEGER_COMMAND_VEC_ID(
powerchip, getPowerChip, setPowerChip, StringTo<int>, powerchip, getPowerChip, setPowerChip, StringTo<int>,
"[0, 1]\n\t[Jungfrau][Mythen3][Gotthard2][Moench] Power " "[0, 1]\n\t[Jungfrau][Moench][Mythen3][Gotthard2] Power "
"the chip. \n\t[Moench] Default is 0. \n\t[Jungfrau] Default is 0. Get " "the chip. \n\t[Jungfrau][Moench] Default is 0. Get "
"will return power status. Can be off if temperature event occured " "will return power status. Can be off if temperature event occured "
"(temperature over temp_threshold with temp_control " "(temperature over temp_threshold with temp_control "
"enabled. Will configure chip (only chip v1.1)\n\t[Mythen3][Gotthard2] " "enabled. Will configure chip (only chip v1.1)\n\t[Mythen3][Gotthard2] "
@ -1418,7 +1421,8 @@ class CmdProxy {
imagetest, getImageTestMode, setImageTestMode, StringTo<int>, imagetest, getImageTestMode, setImageTestMode, StringTo<int>,
"[0, 1]\n\t[Gotthard] 1 adds channel intensity with precalculated " "[0, 1]\n\t[Gotthard] 1 adds channel intensity with precalculated "
"values when taking an acquisition. Default is 0." "values when taking an acquisition. Default is 0."
"\n\t[Eiger][Jungfrau] Only for Virtual servers. If 0, each pixel " "\n\t[Eiger][Jungfrau][Moench] Only for Virtual servers. If 0, each "
"pixel "
"intensity incremented by 1. If 1, all pixels almost saturated."); "intensity incremented by 1. If 1, all pixels almost saturated.");
INTEGER_COMMAND_VEC_ID( INTEGER_COMMAND_VEC_ID(
@ -1432,9 +1436,10 @@ class CmdProxy {
INTEGER_COMMAND_VEC_ID( INTEGER_COMMAND_VEC_ID(
filterresistor, getFilterResistor, setFilterResistor, StringTo<int>, filterresistor, getFilterResistor, setFilterResistor, StringTo<int>,
"[value] [Gotthard2][Jungfrau] Set filter resistor. Increasing values " "[value] [Gotthard2][Jungfrau][Moench] Set filter resistor. Increasing "
"values "
"for increasing resistance.\n\t[Gotthard2] Options: [0|1|2|3]. Default " "for increasing resistance.\n\t[Gotthard2] Options: [0|1|2|3]. Default "
"is 0.\n\t[Jungfrau] Options: [0|1]. Default is 1."); "is 0.\n\t[Jungfrau][Moench] Options: [0|1]. Default is 1.");
INTEGER_COMMAND_VEC_ID(dbitpipeline, getDBITPipeline, setDBITPipeline, INTEGER_COMMAND_VEC_ID(dbitpipeline, getDBITPipeline, setDBITPipeline,
StringTo<int>, StringTo<int>,
@ -1449,19 +1454,22 @@ class CmdProxy {
"permissible values depend on dynamic range and 10Gbe " "permissible values depend on dynamic range and 10Gbe "
"enabled.\n\t[8-512 (multiple of 8)]\n\t\t[Jungfrau] Number of rows " "enabled.\n\t[8-512 (multiple of 8)]\n\t\t[Jungfrau] Number of rows "
"per module starting from the centre. Options: 8 - 512, must be " "per module starting from the centre. Options: 8 - 512, must be "
"multiples of 8. Default is 512."); "multiples of 8. Default is 512.\n\t\t[Moench] Number of rows "
"per module starting from the centre. Options:16 - 400, must be "
"multiples of 16. Default is 400.");
/** temperature */ /** temperature */
GET_COMMAND_NOID( GET_COMMAND_NOID(
templist, getTemperatureList, templist, getTemperatureList,
"\n\tList of temperature commands implemented for this detector."); "\n\tList of temperature commands implemented for this detector.");
GET_IND_COMMAND(temp_adc, getTemperature, slsDetectorDefs::TEMPERATURE_ADC, GET_IND_COMMAND(
" °C", "[n_value]\n\t[Jungfrau][Gotthard] ADC Temperature"); temp_adc, getTemperature, slsDetectorDefs::TEMPERATURE_ADC, " °C",
"[n_value]\n\t[Jungfrau][Moench][Gotthard] ADC Temperature");
GET_IND_COMMAND(temp_fpga, getTemperature, GET_IND_COMMAND(temp_fpga, getTemperature,
slsDetectorDefs::TEMPERATURE_FPGA, " °C", slsDetectorDefs::TEMPERATURE_FPGA, " °C",
"[n_value]\n\t[Eiger][Jungfrau][Gotthard][Mythen3][" "[n_value]\n\t[Eiger][Jungfrau][Moench][Gotthard][Mythen3]["
"Gotthard2] FPGA Temperature"); "Gotthard2] FPGA Temperature");
GET_IND_COMMAND(temp_fpgaext, getTemperature, GET_IND_COMMAND(temp_fpgaext, getTemperature,
@ -1595,7 +1603,7 @@ class CmdProxy {
INTEGER_COMMAND_VEC_ID( INTEGER_COMMAND_VEC_ID(
numinterfaces, getNumberofUDPInterfaces, setNumberofUDPInterfaces, numinterfaces, getNumberofUDPInterfaces, setNumberofUDPInterfaces,
StringTo<int>, StringTo<int>,
"[1, 2]\n\t[Jungfrau] Number of udp interfaces to stream " "[1, 2]\n\t[Jungfrau][Moench] Number of udp interfaces to stream "
"data from detector. Default: 1.\n\tAlso enables second interface in " "data from detector. Default: 1.\n\tAlso enables second interface in "
"receiver for listening (Writes a file per interface if writing " "receiver for listening (Writes a file per interface if writing "
"enabled).\n\tAlso restarts client and receiver zmq sockets if zmq " "enabled).\n\tAlso restarts client and receiver zmq sockets if zmq "
@ -1604,12 +1612,14 @@ class CmdProxy {
INTEGER_COMMAND_VEC_ID( INTEGER_COMMAND_VEC_ID(
selinterface, getSelectedUDPInterface, selectUDPInterface, selinterface, getSelectedUDPInterface, selectUDPInterface,
StringTo<int>, StringTo<int>,
"[0, 1]\n\t[Jungfrau] The udp interface to stream data from detector. " "[0, 1]\n\t[Jungfrau][Moench] The udp interface to stream data from "
"detector. "
"Effective only when number of interfaces is 1. Default: 0 (outer)"); "Effective only when number of interfaces is 1. Default: 0 (outer)");
GET_COMMAND( GET_COMMAND(
udp_numdst, getNumberofUDPDestinations, udp_numdst, getNumberofUDPDestinations,
"\n\t[Jungfrau][Eiger][Mythen3][Gotthard2] One can enter upto 32 (64 " "\n\t[Jungfrau][Moench][Eiger][Mythen3][Gotthard2] One can enter upto "
"32 (64 "
"for Mythen3) destinations that the detector will stream images out in " "for Mythen3) destinations that the detector will stream images out in "
"a round robin fashion. This is get only command. Default: 1"); "a round robin fashion. This is get only command. Default: 1");
@ -1620,7 +1630,8 @@ class CmdProxy {
udp_firstdst, getFirstUDPDestination, setFirstUDPDestination, udp_firstdst, getFirstUDPDestination, setFirstUDPDestination,
StringTo<int>, StringTo<int>,
"\n[0 - 31 (or number of udp " "\n[0 - 31 (or number of udp "
"destinations)]\n\t[Jungfrau][Gotthard2]\n[0-63]\n\t[Mythen3]\n\n\t " "destinations)]\n\t[Jungfrau][Moench][Gotthard2]\n[0-63]\n\t[Mythen3]"
"\n\n\t "
"One can set which is the first destination that the detector will " "One can set which is the first destination that the detector will "
"stream images out from in a round robin fashion. The entry must not " "stream images out from in a round robin fashion. The entry must not "
"have been empty. Default: 0"); "have been empty. Default: 0");
@ -1631,9 +1642,9 @@ class CmdProxy {
"interface. \n\t[Eiger] Do not set as detector will replace with its " "interface. \n\t[Eiger] Do not set as detector will replace with its "
"own DHCP Mac (1G) or DHCP Mac + 1 (10G)."); "own DHCP Mac (1G) or DHCP Mac + 1 (10G).");
INTEGER_COMMAND_VEC_ID(udp_srcmac2, getSourceUDPMAC2, setSourceUDPMAC2, INTEGER_COMMAND_VEC_ID(
MacAddr, udp_srcmac2, getSourceUDPMAC2, setSourceUDPMAC2, MacAddr,
"[x:x:x:x:x:x]\n\t[Jungfrau] Mac address of the top " "[x:x:x:x:x:x]\n\t[Jungfrau][Moench] Mac address of the top "
"half or inner (source) udp interface. "); "half or inner (source) udp interface. ");
INTEGER_COMMAND_VEC_ID( INTEGER_COMMAND_VEC_ID(
@ -1646,10 +1657,12 @@ class CmdProxy {
INTEGER_COMMAND_VEC_ID( INTEGER_COMMAND_VEC_ID(
udp_dstmac2, getDestinationUDPMAC2, setDestinationUDPMAC2, MacAddr, udp_dstmac2, getDestinationUDPMAC2, setDestinationUDPMAC2, MacAddr,
"[x:x:x:x:x:x]\n\t[Jungfrau] Mac address of the receiver (destination) " "[x:x:x:x:x:x]\n\t[Jungfrau][Moench] Mac address of the receiver "
"(destination) "
"udp interface 2. Not mandatory to set as udp_dstip2 retrieves it from " "udp interface 2. Not mandatory to set as udp_dstip2 retrieves it from "
"slsReceiver process but must be set if you use a custom receiver (not " "slsReceiver process but must be set if you use a custom receiver (not "
"slsReceiver). \n\t [Jungfrau] top half or inner interface \n\t " "slsReceiver). \n\t [Jungfrau][Moench] top half or inner interface "
"\n\t "
"[Gotthard2] veto debugging. Use router mac if router between detector " "[Gotthard2] veto debugging. Use router mac if router between detector "
"and receiver."); "and receiver.");
@ -1663,10 +1676,10 @@ class CmdProxy {
INTEGER_COMMAND_VEC_ID_GET( INTEGER_COMMAND_VEC_ID_GET(
udp_dstport2, getDestinationUDPPort2, setDestinationUDPPort2, udp_dstport2, getDestinationUDPPort2, setDestinationUDPPort2,
StringTo<int>, StringTo<int>,
"[n]\n\t[Jungfrau][Eiger][Gotthard2] Port number of the " "[n]\n\t[Jungfrau][Moench][Eiger][Gotthard2] Port number of the "
"receiver (destination) udp interface 2. Default is 50002. " "receiver (destination) udp interface 2. Default is 50002. "
"\n\tIf multi command, ports for each module is calculated " "\n\tIf multi command, ports for each module is calculated "
"(incremented by 2) \n\t[Jungfrau] top half or inner interface " "(incremented by 2) \n\t[Jungfrau][Moench] top half or inner interface "
"\n\t[Eiger] " "\n\t[Eiger] "
"right half \n\t[Gotthard2] veto debugging"); "right half \n\t[Gotthard2] veto debugging");
@ -1685,19 +1698,21 @@ class CmdProxy {
GET_COMMAND(rx_printconfig, printRxConfiguration, GET_COMMAND(rx_printconfig, printRxConfiguration,
"\n\tPrints the receiver configuration."); "\n\tPrints the receiver configuration.");
INTEGER_COMMAND_VEC_ID( INTEGER_COMMAND_VEC_ID(tengiga, getTenGiga, setTenGiga, StringTo<int>,
tengiga, getTenGiga, setTenGiga, StringTo<int>, "[0, 1]\n\t[Eiger][Ctb][Mythen3] 10GbE Enable.");
"[0, 1]\n\t[Eiger][Ctb][Moench][Mythen3] 10GbE Enable.");
INTEGER_COMMAND_VEC_ID(flowcontrol10g, getTenGigaFlowControl, INTEGER_COMMAND_VEC_ID(
setTenGigaFlowControl, StringTo<int>, flowcontrol10g, getTenGigaFlowControl, setTenGigaFlowControl,
"[0, 1]\n\t[Eiger][Jungfrau] 10GbE Flow Control."); StringTo<int>,
"[0, 1]\n\t[Eiger][Jungfrau][Moench] 10GbE Flow Control.");
INTEGER_COMMAND_VEC_ID( INTEGER_COMMAND_VEC_ID(
txdelay_frame, getTransmissionDelayFrame, setTransmissionDelayFrame, txdelay_frame, getTransmissionDelayFrame, setTransmissionDelayFrame,
StringTo<int>, StringTo<int>,
"[n_delay]\n\t[Eiger][Jungfrau][Mythen3] Transmission delay of first " "[n_delay]\n\t[Eiger][Jungfrau][Moench][Mythen3] Transmission delay of "
"udp packet being streamed out of the module.\n\t[Jungfrau] [0-31] " "first "
"udp packet being streamed out of the module.\n\t[Jungfrau][Moench] "
"[0-31] "
"Each value represents 1 ms\n\t[Eiger] Additional delay to " "Each value represents 1 ms\n\t[Eiger] Additional delay to "
"txdelay_left and txdelay_right. Each value represents 10ns. Typical " "txdelay_left and txdelay_right. Each value represents 10ns. Typical "
"value is 50000.\n\t[Mythen3] [0-16777215] Each value represents 8 ns " "value is 50000.\n\t[Mythen3] [0-16777215] Each value represents 8 ns "
@ -1939,13 +1954,15 @@ class CmdProxy {
/* Jungfrau Specific */ /* Jungfrau Specific */
GET_COMMAND(chipversion, getChipVersion, GET_COMMAND(
"\n\t[Jungfrau] Returns chip version. Can be 1.0 or 1.1"); chipversion, getChipVersion,
"\n\t[Jungfrau][Moench] Returns chip version. Can be 1.0 or 1.1");
INTEGER_COMMAND_VEC_ID( INTEGER_COMMAND_VEC_ID(
temp_threshold, getThresholdTemperature, setThresholdTemperature, temp_threshold, getThresholdTemperature, setThresholdTemperature,
StringTo<int>, StringTo<int>,
"[n_temp (in degrees)]\n\t[Jungfrau] Threshold temperature in degrees. " "[n_temp (in degrees)]\n\t[Jungfrau][Moench] Threshold temperature in "
"degrees. "
"If temperature crosses threshold temperature and temperature control " "If temperature crosses threshold temperature and temperature control "
"is enabled, power to chip will be switched off and temperature event " "is enabled, power to chip will be switched off and temperature event "
"occurs. To power on chip again, temperature has to be less than " "occurs. To power on chip again, temperature has to be less than "
@ -1954,7 +1971,7 @@ class CmdProxy {
INTEGER_COMMAND_VEC_ID( INTEGER_COMMAND_VEC_ID(
temp_control, getTemperatureControl, setTemperatureControl, temp_control, getTemperatureControl, setTemperatureControl,
StringTo<int>, StringTo<int>,
"[0, 1]\n\t[Jungfrau] Temperature control enable. Default is 0 " "[0, 1]\n\t[Jungfrau][Moench] Temperature control enable. Default is 0 "
"(disabled). If temperature crosses threshold temperature and " "(disabled). If temperature crosses threshold temperature and "
"temperature control is enabled, power to chip will be switched off " "temperature control is enabled, power to chip will be switched off "
"and temperature event occurs. To power on chip again, temperature has " "and temperature event occurs. To power on chip again, temperature has "
@ -1964,7 +1981,8 @@ class CmdProxy {
INTEGER_COMMAND_VEC_ID( INTEGER_COMMAND_VEC_ID(
autocompdisable, getAutoComparatorDisable, setAutoComparatorDisable, autocompdisable, getAutoComparatorDisable, setAutoComparatorDisable,
StringTo<int>, StringTo<int>,
"[0, 1]\n\t[Jungfrau] Auto comparator disable mode. By default, the " "[0, 1]\n\t[Jungfrau][Moench] Auto comparator disable mode. By "
"default, the "
"on-chip gain switching is active during the entire exposure.This mode " "on-chip gain switching is active during the entire exposure.This mode "
"disables the on - chip gain switching comparator automatically after " "disables the on - chip gain switching comparator automatically after "
"93.75% (only for chipv1.0) of exposure time (only for longer than " "93.75% (only for chipv1.0) of exposure time (only for longer than "
@ -1973,16 +1991,17 @@ class CmdProxy {
"disabled(comparator enabled throughout). 1 enables mode. 0 disables " "disabled(comparator enabled throughout). 1 enables mode. 0 disables "
"mode. "); "mode. ");
TIME_COMMAND(compdisabletime, getComparatorDisableTime, TIME_COMMAND(
setComparatorDisableTime, compdisabletime, getComparatorDisableTime, setComparatorDisableTime,
"[duration] [(optional unit) ns|us|ms|s]\n\t[Jungfrau] Time " "[duration] [(optional unit) ns|us|ms|s]\n\t[Jungfrau][Moench] Time "
"before end of exposure when comparator is disabled. It is " "before end of exposure when comparator is disabled. It is "
"only possible for chipv1.1."); "only possible for chipv1.1.");
INTEGER_COMMAND_SET_NOID_GET_ID( INTEGER_COMMAND_SET_NOID_GET_ID(
extrastoragecells, getNumberOfAdditionalStorageCells, extrastoragecells, getNumberOfAdditionalStorageCells,
setNumberOfAdditionalStorageCells, StringTo<int>, setNumberOfAdditionalStorageCells, StringTo<int>,
"[0-15]\n\t[Jungfrau] Only for chipv1.0. Number of additional storage " "[0-15]\n\t[Jungfrau][Moench] Only for chipv1.0. Number of additional "
"storage "
"cells. Default is " "cells. Default is "
"0. For advanced users only. \n\tThe #images = #frames x #triggers x " "0. For advanced users only. \n\tThe #images = #frames x #triggers x "
"(#extrastoragecells + 1)."); "(#extrastoragecells + 1).");
@ -1990,13 +2009,15 @@ class CmdProxy {
INTEGER_COMMAND_VEC_ID( INTEGER_COMMAND_VEC_ID(
storagecell_start, getStorageCellStart, setStorageCellStart, storagecell_start, getStorageCellStart, setStorageCellStart,
StringTo<int>, StringTo<int>,
"[0-max]\n\t[Jungfrau] Storage cell that stores the first acquisition " "[0-max]\n\t[Jungfrau][Moench] Storage cell that stores the first "
"acquisition "
"of the series. max is 15 (default) for chipv1.0 and 3 (default) for " "of the series. max is 15 (default) for chipv1.0 and 3 (default) for "
"chipv1.1. For advanced users only."); "chipv1.1. For advanced users only.");
TIME_COMMAND( TIME_COMMAND(
storagecell_delay, getStorageCellDelay, setStorageCellDelay, storagecell_delay, getStorageCellDelay, setStorageCellDelay,
"[duration (0-1638375 ns)] [(optional unit) ns|us|ms|s]\n\t[Jungfrau] " "[duration (0-1638375 ns)] [(optional unit) "
"ns|us|ms|s]\n\t[Jungfrau][Moench] "
"Additional time delay between 2 consecutive exposures in burst mode " "Additional time delay between 2 consecutive exposures in burst mode "
"(resolution of 25ns). Only applicable for chipv1.0. For advanced " "(resolution of 25ns). Only applicable for chipv1.0. For advanced "
"users only."); "users only.");
@ -2007,9 +2028,10 @@ class CmdProxy {
"Jungfrau] Gain mode.\n\tCAUTION: Do not use fixg0 without caution, " "Jungfrau] Gain mode.\n\tCAUTION: Do not use fixg0 without caution, "
"you can damage the detector!!!"); "you can damage the detector!!!");
INTEGER_COMMAND_VEC_ID(filtercells, getNumberOfFilterCells, INTEGER_COMMAND_VEC_ID(
setNumberOfFilterCells, StringTo<int>, filtercells, getNumberOfFilterCells, setNumberOfFilterCells,
"[0-12]\n\t[Jungfrau] Set Filter Cell. Only for " StringTo<int>,
"[0-12]\n\t[Jungfrau][Moench] Set Filter Cell. Only for "
"chipv1.1. Advanced user Command"); "chipv1.1. Advanced user Command");
/* Gotthard Specific */ /* Gotthard Specific */
@ -2092,36 +2114,36 @@ class CmdProxy {
INTEGER_COMMAND_VEC_ID( INTEGER_COMMAND_VEC_ID(
asamples, getNumberOfAnalogSamples, setNumberOfAnalogSamples, asamples, getNumberOfAnalogSamples, setNumberOfAnalogSamples,
StringTo<int>, StringTo<int>,
"[n_samples]\n\t[CTB][Moench] Number of analog samples expected."); "[n_samples]\n\t[CTB] Number of analog samples expected.");
INTEGER_COMMAND_VEC_ID( INTEGER_COMMAND_VEC_ID(
adcclk, getADCClock, setADCClock, StringTo<int>, adcclk, getADCClock, setADCClock, StringTo<int>,
"[n_clk in MHz]\n\t[Ctb][Moench] ADC clock frequency in MHz."); "[n_clk in MHz]\n\t[Ctb] ADC clock frequency in MHz.");
INTEGER_COMMAND_VEC_ID(runclk, getRUNClock, setRUNClock, StringTo<int>, INTEGER_COMMAND_VEC_ID(runclk, getRUNClock, setRUNClock, StringTo<int>,
"[n_clk in MHz]\n\t[Ctb][Moench] Run clock in MHz."); "[n_clk in MHz]\n\t[Ctb] Run clock in MHz.");
GET_COMMAND(syncclk, getSYNCClock, GET_COMMAND(syncclk, getSYNCClock,
"[n_clk in MHz]\n\t[Ctb][Moench] Sync clock in MHz."); "[n_clk in MHz]\n\t[Ctb] Sync clock in MHz.");
INTEGER_COMMAND_VEC_ID( INTEGER_COMMAND_VEC_ID(adcpipeline, getADCPipeline, setADCPipeline,
adcpipeline, getADCPipeline, setADCPipeline, StringTo<int>, StringTo<int>,
"[n_value]\n\t[Ctb][Moench] Pipeline for ADC clock."); "[n_value]\n\t[Ctb] Pipeline for ADC clock.");
INTEGER_IND_COMMAND(v_limit, getVoltage, setVoltage, StringTo<int>, INTEGER_IND_COMMAND(v_limit, getVoltage, setVoltage, StringTo<int>,
defs::V_LIMIT, defs::V_LIMIT,
"[n_value]\n\t[Ctb][Moench] Soft limit for power " "[n_value]\n\t[Ctb] Soft limit for power "
"supplies (ctb only) and DACS in mV."); "supplies (ctb only) and DACS in mV.");
INTEGER_COMMAND_HEX(adcenable, getADCEnableMask, setADCEnableMask, INTEGER_COMMAND_HEX(adcenable, getADCEnableMask, setADCEnableMask,
StringTo<uint32_t>, StringTo<uint32_t>,
"[bitmask]\n\t[Ctb][Moench] ADC Enable Mask for 1Gb " "[bitmask]\n\t[Ctb] ADC Enable Mask for 1Gb "
"Enable for each 32 ADC channel."); "Enable for each 32 ADC channel.");
INTEGER_COMMAND_HEX( INTEGER_COMMAND_HEX(
adcenable10g, getTenGigaADCEnableMask, setTenGigaADCEnableMask, adcenable10g, getTenGigaADCEnableMask, setTenGigaADCEnableMask,
StringTo<uint32_t>, StringTo<uint32_t>,
"[bitmask]\n\t[Ctb][Moench] ADC Enable Mask for 10Gb mode for each 32 " "[bitmask]\n\t[Ctb] ADC Enable Mask for 10Gb mode for each 32 "
"ADC channel. However, if any of a consecutive 4 bits are enabled, the " "ADC channel. However, if any of a consecutive 4 bits are enabled, the "
"complete 4 bits are enabled."); "complete 4 bits are enabled.");
@ -2222,28 +2244,28 @@ class CmdProxy {
EXECUTE_SET_COMMAND_NOID_1ARG( EXECUTE_SET_COMMAND_NOID_1ARG(
savepattern, savePattern, savepattern, savePattern,
"[fname]\n\t[Ctb][Moench][Mythen3] Saves pattern to file (ascii). " "[fname]\n\t[Ctb][Mythen3] Saves pattern to file (ascii). "
"\n\t[Ctb][Moench] Also executes pattern."); "\n\t[Ctb] Also executes pattern.");
EXECUTE_SET_COMMAND( EXECUTE_SET_COMMAND(
defaultpattern, loadDefaultPattern, defaultpattern, loadDefaultPattern,
"\n\t[Mythen3][Moench] Loads and runs default pattern in pattern " "\n\t[Mythen3] Loads and runs default pattern in pattern "
"generator. It is to go back to initial settings."); "generator. It is to go back to initial settings.");
INTEGER_COMMAND_HEX_WIDTH16(patioctrl, getPatternIOControl, INTEGER_COMMAND_HEX_WIDTH16(patioctrl, getPatternIOControl,
setPatternIOControl, StringTo<uint64_t>, setPatternIOControl, StringTo<uint64_t>,
"[64 bit mask]\n\t[Ctb][Moench] 64 bit mask " "[64 bit mask]\n\t[Ctb] 64 bit mask "
"defining input (0) and output (1) signals."); "defining input (0) and output (1) signals.");
INTEGER_COMMAND_HEX_WIDTH16( INTEGER_COMMAND_HEX_WIDTH16(
patmask, getPatternMask, setPatternMask, StringTo<uint64_t>, patmask, getPatternMask, setPatternMask, StringTo<uint64_t>,
"[64 bit mask]\n\t[Ctb][Moench][Mythen3] Selects the bits that will " "[64 bit mask]\n\t[Ctb][Mythen3] Selects the bits that will "
"have a pattern mask applied to the selected patmask for every " "have a pattern mask applied to the selected patmask for every "
"pattern."); "pattern.");
INTEGER_COMMAND_HEX_WIDTH16( INTEGER_COMMAND_HEX_WIDTH16(
patsetbit, getPatternBitMask, setPatternBitMask, StringTo<uint64_t>, patsetbit, getPatternBitMask, setPatternBitMask, StringTo<uint64_t>,
"[64 bit mask]\n\t[Ctb][Moench][Mythen3] Sets the mask applied to " "[64 bit mask]\n\t[Ctb][Mythen3] Sets the mask applied to "
"every pattern to the selected bits."); "every pattern to the selected bits.");
EXECUTE_SET_COMMAND(patternstart, startPattern, EXECUTE_SET_COMMAND(patternstart, startPattern,
@ -2253,10 +2275,10 @@ class CmdProxy {
/* Advanced */ /* Advanced */
EXECUTE_SET_COMMAND(resetfpga, resetFPGA, EXECUTE_SET_COMMAND(resetfpga, resetFPGA,
"\n\t[Jungfrau][Ctb][Moench] Reset FPGA."); "\n\t[Jungfrau][Moench][Ctb] Reset FPGA.");
EXECUTE_SET_COMMAND(rebootcontroller, rebootController, EXECUTE_SET_COMMAND(rebootcontroller, rebootController,
"\n\t[Jungfrau][Ctb][Moench][Gotthard][Mythen3][" "\n\t[Jungfrau][Moench][Ctb][Gotthard][Mythen3]["
"Gotthard2] Reboot controller of detector."); "Gotthard2] Reboot controller of detector.");
INTEGER_COMMAND_VEC_ID( INTEGER_COMMAND_VEC_ID(
@ -2267,18 +2289,18 @@ class CmdProxy {
EXECUTE_SET_COMMAND( EXECUTE_SET_COMMAND(
firmwaretest, executeFirmwareTest, firmwaretest, executeFirmwareTest,
"\n\t[Jungfrau][Gotthard][Mythen3][Gotthard2][Ctb][Moench] Firmware " "\n\t[Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][Ctb] Firmware "
"test, ie. reads a read fixed pattern from a register."); "test, ie. reads a read fixed pattern from a register.");
EXECUTE_SET_COMMAND( EXECUTE_SET_COMMAND(
bustest, executeBusTest, bustest, executeBusTest,
"\n\t[Jungfrau][Gotthard][Mythen3][Gotthard2][Ctb][Moench] Bus test, " "\n\t[Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][Ctb] Bus test, "
"ie. Writes different values in a R/W register and confirms the " "ie. Writes different values in a R/W register and confirms the "
"writes to check bus.\n\tAdvanced User function!"); "writes to check bus.\n\tAdvanced User function!");
INTEGER_COMMAND_HEX( INTEGER_COMMAND_HEX(
adcinvert, getADCInvert, setADCInvert, StringTo<uint32_t>, adcinvert, getADCInvert, setADCInvert, StringTo<uint32_t>,
"[bitmask]\n\t[Ctb][Moench][Jungfrau] ADC Inversion " "[bitmask]\n\t[Ctb][Jungfrau][Moench] ADC Inversion "
"Mask.\n\t[Jungfrau][Moench] Inversions on top of the default mask."); "Mask.\n\t[Jungfrau][Moench] Inversions on top of the default mask.");
/* Insignificant */ /* Insignificant */
@ -2303,19 +2325,19 @@ class CmdProxy {
"\n\tClient IP Address that last communicated with the detector."); "\n\tClient IP Address that last communicated with the detector.");
GET_COMMAND(framecounter, getNumberOfFramesFromStart, GET_COMMAND(framecounter, getNumberOfFramesFromStart,
"\n\t[Jungfrau][Mythen3][Gotthard2][Moench][CTB] " "\n\t[Jungfrau][Moench][Mythen3][Gotthard2][CTB] "
"Number of frames from start run control." "Number of frames from start run control."
"\n\t[Gotthard2] only in continuous mode."); "\n\t[Gotthard2] only in continuous mode.");
TIME_GET_COMMAND(runtime, getActualTime, TIME_GET_COMMAND(runtime, getActualTime,
"[(optional unit) " "[(optional unit) "
"ns|us|ms|s]\n\t[Jungfrau][Mythen3][Gotthard2][Moench][" "ns|us|ms|s]\n\t[Jungfrau][Moench][Mythen3][Gotthard2]["
"CTB] Time from detector start up." "CTB] Time from detector start up."
"\n\t[Gotthard2] not in burst and auto mode."); "\n\t[Gotthard2] not in burst and auto mode.");
TIME_GET_COMMAND(frametime, getMeasurementTime, TIME_GET_COMMAND(frametime, getMeasurementTime,
"[(optional unit) " "[(optional unit) "
"ns|us|ms|s]\n\t[Jungfrau][Mythen3][Gotthard2][Moench][" "ns|us|ms|s]\n\t[Jungfrau][Moench][Mythen3][Gotthard2]["
"CTB] Timestamp at a frame start." "CTB] Timestamp at a frame start."
"\n\t[Gotthard2] not in burst and auto mode."); "\n\t[Gotthard2] not in burst and auto mode.");
}; };

View File

@ -183,17 +183,12 @@ std::vector<defs::detectorSettings> Detector::getSettingsList() const {
defs::HIGHGAIN, defs::DYNAMICGAIN, defs::LOWGAIN, defs::MEDIUMGAIN, defs::HIGHGAIN, defs::DYNAMICGAIN, defs::LOWGAIN, defs::MEDIUMGAIN,
defs::VERYHIGHGAIN}; defs::VERYHIGHGAIN};
case defs::JUNGFRAU: case defs::JUNGFRAU:
case defs::MOENCH:
return std::vector<defs::detectorSettings>{defs::GAIN0, return std::vector<defs::detectorSettings>{defs::GAIN0,
defs::HIGHGAIN0}; defs::HIGHGAIN0};
case defs::GOTTHARD2: case defs::GOTTHARD2:
return std::vector<defs::detectorSettings>{ return std::vector<defs::detectorSettings>{
defs::DYNAMICGAIN, defs::FIXGAIN1, defs::FIXGAIN2}; defs::DYNAMICGAIN, defs::FIXGAIN1, defs::FIXGAIN2};
case defs::MOENCH:
return std::vector<defs::detectorSettings>{
defs::G1_HIGHGAIN, defs::G1_LOWGAIN,
defs::G2_HIGHCAP_HIGHGAIN, defs::G2_HIGHCAP_LOWGAIN,
defs::G2_LOWCAP_HIGHGAIN, defs::G2_LOWCAP_LOWGAIN,
defs::G4_HIGHGAIN, defs::G4_LOWGAIN};
case defs::MYTHEN3: case defs::MYTHEN3:
return std::vector<defs::detectorSettings>{defs::STANDARD, defs::FAST, return std::vector<defs::detectorSettings>{defs::STANDARD, defs::FAST,
defs::HIGHGAIN}; defs::HIGHGAIN};
@ -482,6 +477,7 @@ std::vector<defs::speedLevel> Detector::getReadoutSpeedList() const {
switch (getDetectorType().squash()) { switch (getDetectorType().squash()) {
case defs::EIGER: case defs::EIGER:
case defs::JUNGFRAU: case defs::JUNGFRAU:
case defs::MOENCH:
return std::vector<defs::speedLevel>{defs::FULL_SPEED, defs::HALF_SPEED, return std::vector<defs::speedLevel>{defs::FULL_SPEED, defs::HALF_SPEED,
defs::QUARTER_SPEED}; defs::QUARTER_SPEED};
case defs::GOTTHARD2: case defs::GOTTHARD2:
@ -604,6 +600,7 @@ std::vector<defs::dacIndex> Detector::getTemperatureList() const {
case defs::CHIPTESTBOARD: case defs::CHIPTESTBOARD:
return std::vector<defs::dacIndex>{defs::SLOW_ADC_TEMP}; return std::vector<defs::dacIndex>{defs::SLOW_ADC_TEMP};
case defs::JUNGFRAU: case defs::JUNGFRAU:
case defs::MOENCH:
case defs::GOTTHARD: case defs::GOTTHARD:
return std::vector<defs::dacIndex>{defs::TEMPERATURE_ADC, return std::vector<defs::dacIndex>{defs::TEMPERATURE_ADC,
defs::TEMPERATURE_FPGA}; defs::TEMPERATURE_FPGA};
@ -642,6 +639,7 @@ Result<int> Detector::getTemperature(defs::dacIndex index,
switch (getDetectorType().squash()) { switch (getDetectorType().squash()) {
case defs::EIGER: case defs::EIGER:
case defs::JUNGFRAU: case defs::JUNGFRAU:
case defs::MOENCH:
case defs::MYTHEN3: case defs::MYTHEN3:
case defs::GOTTHARD2: case defs::GOTTHARD2:
for (auto &it : res) { for (auto &it : res) {
@ -669,6 +667,7 @@ std::vector<defs::dacIndex> Detector::getDacList() const {
defs::VREF_DS, defs::VCASCN_PB, defs::VCASCP_PB, defs::VOUT_CM, defs::VREF_DS, defs::VCASCN_PB, defs::VCASCP_PB, defs::VOUT_CM,
defs::VCASC_OUT, defs::VIN_CM, defs::VREF_COMP, defs::IB_TESTC}; defs::VCASC_OUT, defs::VIN_CM, defs::VREF_COMP, defs::IB_TESTC};
case defs::JUNGFRAU: case defs::JUNGFRAU:
case defs::MOENCH:
return std::vector<defs::dacIndex>{ return std::vector<defs::dacIndex>{
defs::VB_COMP, defs::VDD_PROT, defs::VIN_COM, defs::VREF_PRECH, defs::VB_COMP, defs::VDD_PROT, defs::VIN_COM, defs::VREF_PRECH,
defs::VB_PIXBUF, defs::VB_DS, defs::VREF_DS, defs::VREF_COMP}; defs::VB_PIXBUF, defs::VB_DS, defs::VREF_DS, defs::VREF_COMP};
@ -686,10 +685,6 @@ std::vector<defs::dacIndex> Detector::getDacList() const {
defs::VCAS, defs::VRPREAMP, defs::VCAL_N, defs::VIPRE, defs::VCAS, defs::VRPREAMP, defs::VCAL_N, defs::VIPRE,
defs::VISHAPER, defs::VCAL_P, defs::VTRIM, defs::VDCSH, defs::VISHAPER, defs::VCAL_P, defs::VTRIM, defs::VDCSH,
defs::VTHRESHOLD}; defs::VTHRESHOLD};
case defs::MOENCH:
return std::vector<defs::dacIndex>{
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::CHIPTESTBOARD:
for (int i = 0; i != 18; ++i) { for (int i = 0; i != 18; ++i) {
retval.push_back(static_cast<defs::dacIndex>(i)); retval.push_back(static_cast<defs::dacIndex>(i));
@ -919,7 +914,8 @@ Result<int> Detector::getNumberofUDPInterfaces(Positions pos) const {
} }
void Detector::setNumberofUDPInterfaces(int n, Positions pos) { void Detector::setNumberofUDPInterfaces(int n, Positions pos) {
if (getDetectorType().squash() != defs::JUNGFRAU) { auto detType = getDetectorType().squash();
if (detType != defs::JUNGFRAU && detType != defs::MOENCH) {
throw RuntimeError( throw RuntimeError(
"Cannot set number of udp interfaces for this detector."); "Cannot set number of udp interfaces for this detector.");
} }
@ -1600,7 +1596,7 @@ void Detector::setTop(bool value, Positions pos) {
pimpl->Parallel(&Module::setTop, pos, value); pimpl->Parallel(&Module::setTop, pos, value);
} }
// Jungfrau Specific // Jungfrau/moench Specific
Result<double> Detector::getChipVersion(Positions pos) const { Result<double> Detector::getChipVersion(Positions pos) const {
return pimpl->Parallel(&Module::getChipVersion, pos); return pimpl->Parallel(&Module::getChipVersion, pos);
} }
@ -1672,6 +1668,7 @@ void Detector::setStorageCellDelay(ns value, Positions pos) {
std::vector<defs::gainMode> Detector::getGainModeList() const { std::vector<defs::gainMode> Detector::getGainModeList() const {
switch (getDetectorType().squash()) { switch (getDetectorType().squash()) {
case defs::JUNGFRAU: case defs::JUNGFRAU:
case defs::MOENCH:
return std::vector<defs::gainMode>{ return std::vector<defs::gainMode>{
defs::DYNAMIC, defs::FORCE_SWITCH_G1, defs::FORCE_SWITCH_G2, defs::DYNAMIC, defs::FORCE_SWITCH_G1, defs::FORCE_SWITCH_G2,
defs::FIX_G1, defs::FIX_G2, defs::FIX_G0}; defs::FIX_G1, defs::FIX_G2, defs::FIX_G0};
@ -1963,7 +1960,7 @@ void Detector::setDigitalPulsing(bool value, Positions pos) {
pimpl->Parallel(&Module::setDigitalPulsing, pos, value); pimpl->Parallel(&Module::setDigitalPulsing, pos, value);
} }
// CTB/ Moench Specific // CTB Specific
Result<int> Detector::getNumberOfAnalogSamples(Positions pos) const { Result<int> Detector::getNumberOfAnalogSamples(Positions pos) const {
return pimpl->Parallel(&Module::getNumberOfAnalogSamples, pos); return pimpl->Parallel(&Module::getNumberOfAnalogSamples, pos);
@ -2301,8 +2298,6 @@ void Detector::startPattern(Positions pos) {
pimpl->Parallel(&Module::startPattern, pos); pimpl->Parallel(&Module::startPattern, pos);
} }
// Moench
Result<std::map<std::string, std::string>> Result<std::map<std::string, std::string>>
Detector::getAdditionalJsonHeader(Positions pos) const { Detector::getAdditionalJsonHeader(Positions pos) const {
return pimpl->Parallel(&Module::getAdditionalJsonHeader, pos); return pimpl->Parallel(&Module::getAdditionalJsonHeader, pos);

View File

@ -320,10 +320,10 @@ void DetectorImpl::addModule(const std::string &hostname) {
// module type updated by now // module type updated by now
shm()->detType = Parallel(&Module::getDetectorType, {}) shm()->detType = Parallel(&Module::getDetectorType, {})
.tsquash("Inconsistent detector types."); .tsquash("Inconsistent detector types.");
// for moench and ctb // for ctb
modules[pos]->updateNumberOfChannels(); modules[pos]->updateNumberOfChannels();
// for eiger, jungfrau, gotthard2 // for eiger, jungfrau, moench, gotthard2
modules[pos]->updateNumberofUDPInterfaces(); modules[pos]->updateNumberofUDPInterfaces();
// update zmq port in case numudpinterfaces changed // update zmq port in case numudpinterfaces changed
@ -413,6 +413,7 @@ void DetectorImpl::setGapPixelsinCallback(const bool enable) {
if (enable) { if (enable) {
switch (shm()->detType) { switch (shm()->detType) {
case JUNGFRAU: case JUNGFRAU:
case MOENCH:
break; break;
case EIGER: case EIGER:
if (size() && modules[0]->getQuad()) { if (size() && modules[0]->getQuad()) {
@ -435,6 +436,7 @@ int DetectorImpl::getTransmissionDelay() const {
bool eiger = false; bool eiger = false;
switch (shm()->detType) { switch (shm()->detType) {
case JUNGFRAU: case JUNGFRAU:
case MOENCH:
case MYTHEN3: case MYTHEN3:
break; break;
case EIGER: case EIGER:
@ -478,6 +480,7 @@ void DetectorImpl::setTransmissionDelay(int step) {
bool eiger = false; bool eiger = false;
switch (shm()->detType) { switch (shm()->detType) {
case JUNGFRAU: case JUNGFRAU:
case MOENCH:
case MYTHEN3: case MYTHEN3:
break; break;
case EIGER: case EIGER:
@ -882,10 +885,10 @@ int DetectorImpl::InsertGapPixels(char *image, char *&gpImage, bool quadEnable,
nMod1TotPixelsx /= 2; nMod1TotPixelsx /= 2;
} }
// eiger requires inter chip gap pixels are halved // eiger requires inter chip gap pixels are halved
// jungfrau prefers same inter chip gap pixels as the boundary pixels // jungfrau/moench prefers same inter chip gap pixels as the boundary pixels
int divisionValue = 2; int divisionValue = 2;
slsDetectorDefs::detectorType detType = shm()->detType; slsDetectorDefs::detectorType detType = shm()->detType;
if (detType == JUNGFRAU) { if (detType == JUNGFRAU || detType == MOENCH) {
divisionValue = 1; divisionValue = 1;
} }
LOG(logDEBUG) << "Insert Gap pixels Calculations:\n\t" LOG(logDEBUG) << "Insert Gap pixels Calculations:\n\t"
@ -1382,8 +1385,8 @@ std::vector<char> DetectorImpl::readProgrammingFile(const std::string &fname) {
bool isPof = false; bool isPof = false;
switch (shm()->detType) { switch (shm()->detType) {
case JUNGFRAU: case JUNGFRAU:
case CHIPTESTBOARD:
case MOENCH: case MOENCH:
case CHIPTESTBOARD:
if (fname.find(".pof") == std::string::npos) { if (fname.find(".pof") == std::string::npos) {
throw RuntimeError("Programming file must be a pof file."); throw RuntimeError("Programming file must be a pof file.");
} }
@ -1521,6 +1524,7 @@ defs::xy DetectorImpl::getPortGeometry() const {
portGeometry.x = modules[0]->getNumberofUDPInterfacesFromShm(); portGeometry.x = modules[0]->getNumberofUDPInterfacesFromShm();
break; break;
case JUNGFRAU: case JUNGFRAU:
case MOENCH:
portGeometry.y = modules[0]->getNumberofUDPInterfacesFromShm(); portGeometry.y = modules[0]->getNumberofUDPInterfacesFromShm();
break; break;
default: default:
@ -1539,7 +1543,7 @@ defs::xy DetectorImpl::calculatePosition(int moduleIndex,
} }
defs::ROI DetectorImpl::getRxROI() const { defs::ROI DetectorImpl::getRxROI() const {
if (shm()->detType == CHIPTESTBOARD || shm()->detType == MOENCH) { if (shm()->detType == CHIPTESTBOARD) {
throw RuntimeError("RxRoi not implemented for this Detector"); throw RuntimeError("RxRoi not implemented for this Detector");
} }
if (modules.size() == 0) { if (modules.size() == 0) {
@ -1614,7 +1618,7 @@ defs::ROI DetectorImpl::getRxROI() const {
} }
void DetectorImpl::setRxROI(const defs::ROI arg) { void DetectorImpl::setRxROI(const defs::ROI arg) {
if (shm()->detType == CHIPTESTBOARD || shm()->detType == MOENCH) { if (shm()->detType == CHIPTESTBOARD) {
throw RuntimeError("RxRoi not implemented for this Detector"); throw RuntimeError("RxRoi not implemented for this Detector");
} }
if (modules.size() == 0) { if (modules.size() == 0) {

View File

@ -357,7 +357,7 @@ class DetectorImpl : public virtual slsDetectorDefs {
*/ */
void readFrameFromReceiver(); void readFrameFromReceiver();
/** [Eiger][Jungfrau] /** [Eiger][Jungfrau][Moench]
* add gap pixels to the imag * add gap pixels to the imag
* @param image pointer to image without gap pixels * @param image pointer to image without gap pixels
* @param gpImage poiner to image with gap pixels, if NULL, allocated * @param gpImage poiner to image with gap pixels, if NULL, allocated

View File

@ -91,7 +91,7 @@ std::string GetHelpDac(std::string dac) {
} }
if (dac == "vref_ds") { if (dac == "vref_ds") {
return std::string("[dac or mV value][(optional unit) mV] " return std::string("[dac or mV value][(optional unit) mV] "
"\n\t[Gotthard][Jungfrau] Dac for ??"); "\n\t[Gotthard][Jungfrau][Moench] Dac for ??");
} }
if (dac == "vcascn_pb") { if (dac == "vcascn_pb") {
return std::string( return std::string(
@ -103,7 +103,7 @@ std::string GetHelpDac(std::string dac) {
} }
if (dac == "vout_cm") { if (dac == "vout_cm") {
return std::string("[dac or mV value][(optional unit) mV] " return std::string("[dac or mV value][(optional unit) mV] "
"\n\t[Gotthard] Dac for ??\n\t[Moench] Dac for 5"); "\n\t[Gotthard] Dac for ??");
} }
if (dac == "vcasc_out") { if (dac == "vcasc_out") {
return std::string( return std::string(
@ -111,11 +111,11 @@ std::string GetHelpDac(std::string dac) {
} }
if (dac == "vin_cm") { if (dac == "vin_cm") {
return std::string("[dac or mV value][(optional unit) mV] " return std::string("[dac or mV value][(optional unit) mV] "
"\n\t[Gotthard] Dac for ??\n\t[Moench] Dac for 2"); "\n\t[Gotthard] Dac for ??");
} }
if (dac == "vref_comp") { if (dac == "vref_comp") {
return std::string("[dac or mV value][(optional unit) mV] " return std::string("[dac or mV value][(optional unit) mV] "
"\n\t[Gotthard][Jungfrau] Dac for ??"); "\n\t[Gotthard][Jungfrau][Moench] Dac for ??");
} }
if (dac == "ib_test_c") { if (dac == "ib_test_c") {
return std::string( return std::string(
@ -129,7 +129,7 @@ std::string GetHelpDac(std::string dac) {
if (dac == "vipre") { if (dac == "vipre") {
return std::string( return std::string(
"[dac or mV value][(optional unit) mV] \n\t[Mythen3] Dac for the " "[dac or mV value][(optional unit) mV] \n\t[Mythen3] Dac for the "
"preamplifier's input transistor current.\n\t[Moench] Dac for 1"); "preamplifier's input transistor current.");
} }
if (dac == "vdcsh") { if (dac == "vdcsh") {
return std::string( return std::string(
@ -224,7 +224,8 @@ std::string GetHelpDac(std::string dac) {
} }
if (dac == "vref_prech") { if (dac == "vref_prech") {
return std::string( return std::string(
"[dac or mV value][(optional unit) mV] \n\t[Gotthard2][Jungfrau] " "[dac or mV value][(optional unit) mV] "
"\n\t[Gotthard2][Jungfrau][Moench] "
"Dac for reference votlage for precharing the preamplifier."); "Dac for reference votlage for precharing the preamplifier.");
} }
if (dac == "vref_l_adc") { if (dac == "vref_l_adc") {
@ -254,44 +255,39 @@ std::string GetHelpDac(std::string dac) {
"common mode voltage of ADC DAC bank 2."); "common mode voltage of ADC DAC bank 2.");
} }
if (dac == "vb_ds") { if (dac == "vb_ds") {
return std::string( return std::string("[dac or mV value][(optional unit) mV] "
"[dac or mV value][(optional unit) mV] \n\t[Jungfrau] Dac for ??"); "\n\t[Jungfrau][Moench] Dac for ??");
} }
if (dac == "vb_comp") { if (dac == "vb_comp") {
return std::string( return std::string("[dac or mV value][(optional unit) mV] "
"[dac or mV value][(optional unit) mV] \n\t[Jungfrau] Dac for ??"); "\n\t[Jungfrau][Moench] Dac for ??");
} }
if (dac == "vb_pixbuf") { if (dac == "vb_pixbuf") {
return std::string( return std::string("[dac or mV value][(optional unit) mV] "
"[dac or mV value][(optional unit) mV] \n\t[Jungfrau] Dac for ??"); "\n\t[Jungfrau][Moench] Dac for ??");
} }
if (dac == "vin_com") { if (dac == "vin_com") {
return std::string( return std::string("[dac or mV value][(optional unit) mV] "
"[dac or mV value][(optional unit) mV] \n\t[Jungfrau] Dac for ??"); "\n\t[Jungfrau][Moench] Dac for ??");
} }
if (dac == "vdd_prot") { if (dac == "vdd_prot") {
return std::string( return std::string("[dac or mV value][(optional unit) mV] "
"[dac or mV value][(optional unit) mV] \n\t[Jungfrau] Dac for ??"); "\n\t[Jungfrau][Moench] Dac for ??");
} }
if (dac == "vbp_colbuf") { if (dac == "vbp_colbuf") {
return std::string( return std::string("[dac or mV value][(optional unit) mV] \n");
"[dac or mV value][(optional unit) mV] \n\t[Moench] Dac for 0");
} }
if (dac == "vb_sda") { if (dac == "vb_sda") {
return std::string( return std::string("[dac or mV value][(optional unit) mV] \n");
"[dac or mV value][(optional unit) mV] \n\t[Moench] Dac for 3");
} }
if (dac == "vcasc_sfp") { if (dac == "vcasc_sfp") {
return std::string( return std::string("[dac or mV value][(optional unit) mV] \n");
"[dac or mV value][(optional unit) mV] \n\t[Moench] Dac for 4");
} }
if (dac == "vipre_cds") { if (dac == "vipre_cds") {
return std::string( return std::string("[dac or mV value][(optional unit) mV] \n");
"[dac or mV value][(optional unit) mV] \n\t[Moench] Dac for 6");
} }
if (dac == "ibias_sfp") { if (dac == "ibias_sfp") {
return std::string( return std::string("[dac or mV value][(optional unit) mV] \n");
"[dac or mV value][(optional unit) mV] \n\t[Moench] Dac for 7");
} }
// clang-format off // clang-format off

View File

@ -155,7 +155,7 @@ slsDetectorDefs::detectorType Module::getDetectorType() const {
} }
void Module::updateNumberOfChannels() { void Module::updateNumberOfChannels() {
if (shm()->detType == CHIPTESTBOARD || shm()->detType == MOENCH) { if (shm()->detType == CHIPTESTBOARD) {
std::array<int, 2> retvals{}; std::array<int, 2> retvals{};
sendToDetector(F_GET_NUM_CHANNELS, nullptr, retvals); sendToDetector(F_GET_NUM_CHANNELS, nullptr, retvals);
shm()->nChan.x = retvals[0]; shm()->nChan.x = retvals[0];
@ -1225,7 +1225,7 @@ std::string Module::printReceiverConfiguration() {
os << "\n\nModule " << moduleIndex << "\nReceiver Hostname:\t" os << "\n\nModule " << moduleIndex << "\nReceiver Hostname:\t"
<< getReceiverHostname(); << getReceiverHostname();
if (shm()->detType == JUNGFRAU) { if (shm()->detType == JUNGFRAU || shm()->detType == MOENCH) {
os << "\nNumber of Interfaces:\t" << getNumberofUDPInterfacesFromShm() os << "\nNumber of Interfaces:\t" << getNumberofUDPInterfacesFromShm()
<< "\nSelected Interface:\t" << getSelectedUDPInterface(); << "\nSelected Interface:\t" << getSelectedUDPInterface();
} }
@ -1235,14 +1235,15 @@ std::string Module::printReceiverConfiguration() {
<< getDestinationUDPIP() << "\nDestination UDP MAC:\t" << getDestinationUDPIP() << "\nDestination UDP MAC:\t"
<< getDestinationUDPMAC(); << getDestinationUDPMAC();
if (shm()->detType == JUNGFRAU) { if (shm()->detType == JUNGFRAU || shm()->detType == MOENCH) {
os << "\nSource UDP IP2:\t" << getSourceUDPIP2() os << "\nSource UDP IP2:\t" << getSourceUDPIP2()
<< "\nSource UDP MAC2:\t" << getSourceUDPMAC2() << "\nSource UDP MAC2:\t" << getSourceUDPMAC2()
<< "\nDestination UDP IP2:\t" << getDestinationUDPIP2() << "\nDestination UDP IP2:\t" << getDestinationUDPIP2()
<< "\nDestination UDP MAC2:\t" << getDestinationUDPMAC2(); << "\nDestination UDP MAC2:\t" << getDestinationUDPMAC2();
} }
os << "\nDestination UDP Port:\t" << getDestinationUDPPort(); os << "\nDestination UDP Port:\t" << getDestinationUDPPort();
if (shm()->detType == JUNGFRAU || shm()->detType == EIGER) { if (shm()->detType == JUNGFRAU || shm()->detType == MOENCH ||
shm()->detType == EIGER) {
os << "\nDestination UDP Port2:\t" << getDestinationUDPPort2(); os << "\nDestination UDP Port2:\t" << getDestinationUDPPort2();
} }
os << "\n"; os << "\n";
@ -1791,7 +1792,7 @@ void Module::setTop(bool value) {
sendToDetector(F_SET_TOP, static_cast<int>(value), nullptr); sendToDetector(F_SET_TOP, static_cast<int>(value), nullptr);
} }
// Jungfrau Specific // Jungfrau/Moench Specific
double Module::getChipVersion() const { double Module::getChipVersion() const {
return (sendToDetector<int>(F_GET_CHIP_VERSION)) / 10.00; return (sendToDetector<int>(F_GET_CHIP_VERSION)) / 10.00;
} }
@ -2303,7 +2304,7 @@ void Module::setDigitalPulsing(const bool enable) {
sendToDetector(F_SET_DIGITAL_PULSING, static_cast<int>(enable), nullptr); sendToDetector(F_SET_DIGITAL_PULSING, static_cast<int>(enable), nullptr);
} }
// CTB / Moench Specific // CTB Specific
int Module::getNumberOfAnalogSamples() const { int Module::getNumberOfAnalogSamples() const {
return sendToDetector<int>(F_GET_NUM_ANALOG_SAMPLES); return sendToDetector<int>(F_GET_NUM_ANALOG_SAMPLES);
} }
@ -2538,8 +2539,6 @@ void Module::setPatternBitMask(uint64_t mask) {
void Module::startPattern() { sendToDetector(F_START_PATTERN); } void Module::startPattern() { sendToDetector(F_START_PATTERN); }
// Moench
std::map<std::string, std::string> Module::getAdditionalJsonHeader() const { std::map<std::string, std::string> Module::getAdditionalJsonHeader() const {
// TODO, refactor this function with a more robust sending. // TODO, refactor this function with a more robust sending.
// Now assuming whitespace separated key value // Now assuming whitespace separated key value
@ -2632,8 +2631,8 @@ void Module::programFPGA(std::vector<char> buffer,
const bool forceDeleteNormalFile) { const bool forceDeleteNormalFile) {
switch (shm()->detType) { switch (shm()->detType) {
case JUNGFRAU: case JUNGFRAU:
case CHIPTESTBOARD:
case MOENCH: case MOENCH:
case CHIPTESTBOARD:
sendProgram(true, buffer, F_PROGRAM_FPGA, "Update Firmware", "", sendProgram(true, buffer, F_PROGRAM_FPGA, "Update Firmware", "",
forceDeleteNormalFile); forceDeleteNormalFile);
break; break;
@ -2653,8 +2652,8 @@ void Module::updateDetectorServer(std::vector<char> buffer,
const std::string &serverName) { const std::string &serverName) {
switch (shm()->detType) { switch (shm()->detType) {
case JUNGFRAU: case JUNGFRAU:
case CHIPTESTBOARD:
case MOENCH: case MOENCH:
case CHIPTESTBOARD:
sendProgram(true, buffer, F_UPDATE_DETECTOR_SERVER, sendProgram(true, buffer, F_UPDATE_DETECTOR_SERVER,
"Update Detector Server (no tftp)", serverName); "Update Detector Server (no tftp)", serverName);
break; break;
@ -2674,8 +2673,8 @@ void Module::updateDetectorServer(std::vector<char> buffer,
void Module::updateKernel(std::vector<char> buffer) { void Module::updateKernel(std::vector<char> buffer) {
switch (shm()->detType) { switch (shm()->detType) {
case JUNGFRAU: case JUNGFRAU:
case CHIPTESTBOARD:
case MOENCH: case MOENCH:
case CHIPTESTBOARD:
sendProgram(true, buffer, F_UPDATE_KERNEL, "Update Kernel"); sendProgram(true, buffer, F_UPDATE_KERNEL, "Update Kernel");
break; break;
case MYTHEN3: case MYTHEN3:

View File

@ -388,7 +388,7 @@ class Module : public virtual slsDetectorDefs {
/************************************************** /**************************************************
* * * *
* Jungfrau Specific * * Jungfrau/Moench Specific *
* * * *
* ************************************************/ * ************************************************/
double getChipVersion() const; double getChipVersion() const;
@ -490,7 +490,7 @@ class Module : public virtual slsDetectorDefs {
/************************************************** /**************************************************
* * * *
* CTB / Moench Specific * * CTB Specific *
* * * *
* ************************************************/ * ************************************************/
int getNumberOfAnalogSamples() const; int getNumberOfAnalogSamples() const;
@ -501,12 +501,6 @@ class Module : public virtual slsDetectorDefs {
void setADCEnableMask(uint32_t mask); void setADCEnableMask(uint32_t mask);
uint32_t getTenGigaADCEnableMask() const; uint32_t getTenGigaADCEnableMask() const;
void setTenGigaADCEnableMask(uint32_t mask); void setTenGigaADCEnableMask(uint32_t mask);
/**************************************************
* *
* CTB Specific *
* *
* ************************************************/
int getNumberOfDigitalSamples() const; int getNumberOfDigitalSamples() const;
void setNumberOfDigitalSamples(int value); void setNumberOfDigitalSamples(int value);
readoutMode getReadoutMode() const; readoutMode getReadoutMode() const;

View File

@ -107,7 +107,7 @@ TEST_CASE("adcvpp", "[.cmd]") {
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH) { if (det_type == defs::CHIPTESTBOARD) {
auto prev_val = det.getADCVpp(false); auto prev_val = det.getADCVpp(false);
{ {
std::ostringstream oss; std::ostringstream oss;
@ -132,14 +132,14 @@ TEST_CASE("adcvpp", "[.cmd]") {
} }
} }
/* CTB/ Moench Specific */ /* CTB Specific */
TEST_CASE("samples", "[.cmd]") { TEST_CASE("samples", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH) { if (det_type == defs::CHIPTESTBOARD) {
auto prev_asamples = det.getNumberOfAnalogSamples(); auto prev_asamples = det.getNumberOfAnalogSamples();
Result<int> prev_dsamples = 0; Result<int> prev_dsamples = 0;
if (det_type == defs::CHIPTESTBOARD) { if (det_type == defs::CHIPTESTBOARD) {
@ -186,7 +186,7 @@ TEST_CASE("asamples", "[.cmd]") {
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH) { if (det_type == defs::CHIPTESTBOARD) {
auto prev_val = det.getNumberOfAnalogSamples(); auto prev_val = det.getNumberOfAnalogSamples();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -216,7 +216,7 @@ TEST_CASE("adcclk", "[.cmd]") {
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH) { if (det_type == defs::CHIPTESTBOARD) {
auto prev_val = det.getADCClock(); auto prev_val = det.getADCClock();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -247,7 +247,7 @@ TEST_CASE("runclk", "[.cmd]") {
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH) { if (det_type == defs::CHIPTESTBOARD) {
auto prev_val = det.getRUNClock(); auto prev_val = det.getRUNClock();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -277,7 +277,7 @@ TEST_CASE("syncclk", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH) { if (det_type == defs::CHIPTESTBOARD) {
REQUIRE_NOTHROW(proxy.Call("syncclk", {}, -1, GET)); REQUIRE_NOTHROW(proxy.Call("syncclk", {}, -1, GET));
} else { } else {
// clock index might work // clock index might work
@ -290,7 +290,7 @@ TEST_CASE("adcpipeline", "[.cmd]") {
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH) { if (det_type == defs::CHIPTESTBOARD) {
auto prev_val = det.getADCPipeline(); auto prev_val = det.getADCPipeline();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -325,7 +325,7 @@ TEST_CASE("v_limit", "[.cmd]") {
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH) { if (det_type == defs::CHIPTESTBOARD) {
auto prev_val = det.getVoltage(defs::V_LIMIT); auto prev_val = det.getVoltage(defs::V_LIMIT);
{ {
std::ostringstream oss; std::ostringstream oss;
@ -363,7 +363,7 @@ TEST_CASE("adcenable", "[.cmd]") {
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH) { if (det_type == defs::CHIPTESTBOARD) {
auto prev_val = det.getADCEnableMask(); auto prev_val = det.getADCEnableMask();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -393,7 +393,7 @@ TEST_CASE("adcenable10g", "[.cmd]") {
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH) { if (det_type == defs::CHIPTESTBOARD) {
auto prev_val = det.getTenGigaADCEnableMask(); auto prev_val = det.getTenGigaADCEnableMask();
{ {
std::ostringstream oss; std::ostringstream oss;

View File

@ -23,7 +23,7 @@ TEST_CASE("Setting and reading back Jungfrau dacs", "[.cmd][.dacs]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU) { if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
SECTION("vb_comp") { test_dac(defs::VB_COMP, "vb_comp", 1220); } SECTION("vb_comp") { test_dac(defs::VB_COMP, "vb_comp", 1220); }
SECTION("vdd_prot") { test_dac(defs::VDD_PROT, "vdd_prot", 3000); } SECTION("vdd_prot") { test_dac(defs::VDD_PROT, "vdd_prot", 3000); }
SECTION("vin_com") { test_dac(defs::VIN_COM, "vin_com", 1053); } SECTION("vin_com") { test_dac(defs::VIN_COM, "vin_com", 1053); }
@ -102,7 +102,7 @@ TEST_CASE("selinterface", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU) { if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
auto prev_val = det.getSelectedUDPInterface().tsquash( auto prev_val = det.getSelectedUDPInterface().tsquash(
"inconsistent selected interface to test"); "inconsistent selected interface to test");
{ {
@ -127,13 +127,13 @@ TEST_CASE("selinterface", "[.cmd]") {
} }
} }
/* Jungfrau Specific */ /* Jungfrau/moench Specific */
TEST_CASE("temp_threshold", "[.cmd]") { TEST_CASE("temp_threshold", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU) { if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
auto prev_val = det.getThresholdTemperature(); auto prev_val = det.getThresholdTemperature();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -163,7 +163,7 @@ TEST_CASE("chipversion", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU) { if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
REQUIRE_NOTHROW(proxy.Call("chipversion", {}, -1, GET)); REQUIRE_NOTHROW(proxy.Call("chipversion", {}, -1, GET));
} else { } else {
REQUIRE_THROWS(proxy.Call("chipversion", {}, -1, GET)); REQUIRE_THROWS(proxy.Call("chipversion", {}, -1, GET));
@ -175,7 +175,7 @@ TEST_CASE("temp_control", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU) { if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
auto prev_val = det.getTemperatureControl(); auto prev_val = det.getTemperatureControl();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -205,7 +205,7 @@ TEST_CASE("temp_event", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU) { if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
{ {
std::ostringstream oss; std::ostringstream oss;
proxy.Call("temp_event", {"0"}, -1, PUT, oss); proxy.Call("temp_event", {"0"}, -1, PUT, oss);
@ -226,7 +226,7 @@ TEST_CASE("autocompdisable", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU) { if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
auto prev_val = det.getAutoComparatorDisable(); auto prev_val = det.getAutoComparatorDisable();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -256,7 +256,7 @@ TEST_CASE("compdisabletime", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU && if ((det_type == defs::JUNGFRAU || det_type == defs::MOENCH) &&
det.getChipVersion().squash() * 10 == 11) { det.getChipVersion().squash() * 10 == 11) {
auto prev_val = det.getComparatorDisableTime(); auto prev_val = det.getComparatorDisableTime();
{ {
@ -287,7 +287,7 @@ TEST_CASE("extrastoragecells", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU) { if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
// chip version 1.0 // chip version 1.0
if (det.getChipVersion().squash() * 10 == 10) { if (det.getChipVersion().squash() * 10 == 10) {
auto prev_val = det.getNumberOfAdditionalStorageCells().tsquash( auto prev_val = det.getNumberOfAdditionalStorageCells().tsquash(
@ -330,7 +330,7 @@ TEST_CASE("storagecell_start", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU) { if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
auto prev_val = det.getStorageCellStart(); auto prev_val = det.getStorageCellStart();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -375,7 +375,7 @@ TEST_CASE("storagecell_delay", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU) { if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
// chip version 1.0 // chip version 1.0
if (det.getChipVersion().squash() * 10 == 10) { if (det.getChipVersion().squash() * 10 == 10) {
auto prev_val = det.getStorageCellDelay(); auto prev_val = det.getStorageCellDelay();
@ -416,7 +416,7 @@ TEST_CASE("gainmode", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU) { if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
auto prev_val = det.getGainMode(); auto prev_val = det.getGainMode();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -465,7 +465,7 @@ TEST_CASE("filtercells", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU) { if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
// chip version 1.1 // chip version 1.1
if (det.getChipVersion().squash() * 10 == 11) { if (det.getChipVersion().squash() * 10 == 11) {
auto prev_val = det.getNumberOfFilterCells(); auto prev_val = det.getNumberOfFilterCells();
@ -510,7 +510,7 @@ TEST_CASE("sync", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU) { if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
auto prev_val = det.getSynchronization().tsquash( auto prev_val = det.getSynchronization().tsquash(
"inconsistent synchronization to test"); "inconsistent synchronization to test");
{ {

View File

@ -19,94 +19,4 @@ using test::PUT;
/* dacs */ /* dacs */
TEST_CASE("Setting and reading back MOENCH dacs", "[.cmd][.dacs]") {
// vbp_colbuf, vipre, vin_cm", vb_sda, vcasc_sfp, vout_cm, vipre_cds,
// ibias_sfp
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::MOENCH) {
SECTION("vbp_colbuf") {
test_dac(defs::VBP_COLBUF, "vbp_colbuf", 1300);
}
SECTION("vipre") { test_dac(defs::VIPRE, "vipre", 1000); }
SECTION("vin_cm") { test_dac(defs::VIN_CM, "vin_cm", 1400); }
SECTION("vb_sda") { test_dac(defs::VB_SDA, "vb_sda", 680); }
SECTION("vcasc_sfp") { test_dac(defs::VCASC_SFP, "vcasc_sfp", 1428); }
SECTION("vout_cm") { test_dac(defs::VOUT_CM, "vout_cm", 1200); }
SECTION("vipre_cds") { test_dac(defs::VIPRE_CDS, "vipre_cds", 800); }
SECTION("ibias_sfp") { test_dac(defs::IBIAS_SFP, "ibias_sfp", 900); }
// eiger
REQUIRE_THROWS(proxy.Call("dac", {"vthreshold"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vsvp"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vsvn"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vtrim"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vrpreamp"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vrshaper"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vtgstv"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcmp_ll"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcmp_lr"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcal"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcmp_rl"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcmp_rr"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"rxb_rb"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"rxb_lb"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcp"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcn"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vishaper"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"iodelay"}, -1, GET));
// jungfrau
REQUIRE_THROWS(proxy.Call("dac", {"vb_comp"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vdd_prot"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vin_com"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vref_prech"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vb_pixbuf"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vb_ds"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vref_ds"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vref_comp"}, -1, GET));
// gotthard
REQUIRE_THROWS(proxy.Call("dac", {"vref_ds"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcascn_pb"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcascp_pb"}, -1, GET));
// REQUIRE_THROWS(proxy.Call("dac", {"vout_cm"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcasc_out"}, -1, GET));
// REQUIRE_THROWS(proxy.Call("dac", {"vin_cm"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vref_comp"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"ib_test_c"}, -1, GET));
// mythen3
REQUIRE_THROWS(proxy.Call("dac", {"vrpreamp"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vrshaper"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vrshaper_n"}, -1, GET));
// REQUIRE_THROWS(proxy.Call("dac", {"vipre"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vishaper"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vdcsh"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vth1"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vth2"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vth3"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcal_n"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcal_p"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vtrim"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcassh"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcas"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vicin"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vipre_out"}, -1, GET));
// gotthard2
REQUIRE_THROWS(proxy.Call("dac", {"vref_h_adc"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vb_comp_fe"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vb_comp_adc"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcom_cds"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vref_rstore"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vb_opa_1st"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vref_comp_fe"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcom_adc1"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vref_l_adc"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vref_cds"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vb_cs"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vb_opa_fd"}, -1, GET));
REQUIRE_THROWS(proxy.Call("dac", {"vcom_adc2"}, -1, GET));
}
}
} // namespace sls } // namespace sls

View File

@ -23,8 +23,7 @@ TEST_CASE("pattern", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH || if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) {
det_type == defs::MYTHEN3) {
// no proper test for put // no proper test for put
REQUIRE_THROWS(proxy.Call("pattern", {}, -1, GET)); REQUIRE_THROWS(proxy.Call("pattern", {}, -1, GET));
} else { } else {
@ -36,8 +35,7 @@ TEST_CASE("savepattern", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH || if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) {
det_type == defs::MYTHEN3) {
REQUIRE_THROWS( REQUIRE_THROWS(
proxy.Call("savepattern", {"/tmp/pattern.txt"}, -1, GET)); proxy.Call("savepattern", {"/tmp/pattern.txt"}, -1, GET));
if (det.size() == 1) { if (det.size() == 1) {
@ -54,7 +52,7 @@ TEST_CASE("defaultpattern", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::MOENCH || det_type == defs::MYTHEN3) { if (det_type == defs::MYTHEN3) {
REQUIRE_THROWS(proxy.Call("defaultpattern", {}, -1, GET)); REQUIRE_THROWS(proxy.Call("defaultpattern", {}, -1, GET));
REQUIRE_NOTHROW(proxy.Call("defaultpattern", {}, -1, PUT)); REQUIRE_NOTHROW(proxy.Call("defaultpattern", {}, -1, PUT));
} else { } else {
@ -68,7 +66,7 @@ TEST_CASE("patioctrl", "[.cmd]") {
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH) { if (det_type == defs::CHIPTESTBOARD) {
auto prev_val = det.getPatternIOControl(); auto prev_val = det.getPatternIOControl();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -98,8 +96,7 @@ TEST_CASE("patword", "[.cmd]") {
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH || if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) {
det_type == defs::MYTHEN3) {
int addr = 0x23; int addr = 0x23;
std::string saddr = ToStringHex(addr, 4); std::string saddr = ToStringHex(addr, 4);
auto prev_val = det.getPatternWord(addr); auto prev_val = det.getPatternWord(addr);
@ -134,8 +131,7 @@ TEST_CASE("patlimits", "[.cmd]") {
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH || if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) {
det_type == defs::MYTHEN3) {
auto prev_val = det.getPatternLoopAddresses(-1); auto prev_val = det.getPatternLoopAddresses(-1);
{ {
std::ostringstream oss; std::ostringstream oss;
@ -161,8 +157,7 @@ TEST_CASE("patloop", "[.cmd]") {
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH || if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) {
det_type == defs::MYTHEN3) {
for (int iLoop = 0; iLoop != MAX_PATTERN_LEVELS; ++iLoop) { for (int iLoop = 0; iLoop != MAX_PATTERN_LEVELS; ++iLoop) {
// m3 only has 3 levels // m3 only has 3 levels
if (det_type == defs::MYTHEN3 && iLoop >= 3) { if (det_type == defs::MYTHEN3 && iLoop >= 3) {
@ -208,8 +203,7 @@ TEST_CASE("patnloop", "[.cmd]") {
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH || if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) {
det_type == defs::MYTHEN3) {
for (int iLoop = 0; iLoop != MAX_PATTERN_LEVELS; ++iLoop) { for (int iLoop = 0; iLoop != MAX_PATTERN_LEVELS; ++iLoop) {
// m3 only has 3 levels // m3 only has 3 levels
if (det_type == defs::MYTHEN3 && iLoop >= 3) { if (det_type == defs::MYTHEN3 && iLoop >= 3) {
@ -254,8 +248,7 @@ TEST_CASE("patwait", "[.cmd]") {
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH || if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) {
det_type == defs::MYTHEN3) {
for (int iLoop = 0; iLoop != MAX_PATTERN_LEVELS; ++iLoop) { for (int iLoop = 0; iLoop != MAX_PATTERN_LEVELS; ++iLoop) {
// m3 only has 3 levels // m3 only has 3 levels
if (det_type == defs::MYTHEN3 && iLoop >= 3) { if (det_type == defs::MYTHEN3 && iLoop >= 3) {
@ -300,8 +293,7 @@ TEST_CASE("patwaittime", "[.cmd]") {
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH || if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) {
det_type == defs::MYTHEN3) {
for (int iLoop = 0; iLoop != MAX_PATTERN_LEVELS; ++iLoop) { for (int iLoop = 0; iLoop != MAX_PATTERN_LEVELS; ++iLoop) {
// m3 only has 3 levels // m3 only has 3 levels
if (det_type == defs::MYTHEN3 && iLoop >= 3) { if (det_type == defs::MYTHEN3 && iLoop >= 3) {
@ -346,8 +338,7 @@ TEST_CASE("patmask", "[.cmd]") {
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH || if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) {
det_type == defs::MYTHEN3) {
auto prev_val = det.getPatternMask(); auto prev_val = det.getPatternMask();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -372,8 +363,7 @@ TEST_CASE("patsetbit", "[.cmd]") {
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH || if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) {
det_type == defs::MYTHEN3) {
auto prev_val = det.getPatternBitMask(); auto prev_val = det.getPatternBitMask();
{ {
std::ostringstream oss; std::ostringstream oss;

View File

@ -451,7 +451,7 @@ TEST_CASE("rx_roi", "[.cmd]") {
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH) { if (det_type == defs::CHIPTESTBOARD) {
REQUIRE_THROWS(proxy.Call("rx_roi", {"5", "10"}, -1, PUT)); REQUIRE_THROWS(proxy.Call("rx_roi", {"5", "10"}, -1, PUT));
} else { } else {
auto prev_val = det.getRxROI(); auto prev_val = det.getRxROI();
@ -513,7 +513,7 @@ TEST_CASE("rx_clearroi", "[.cmd]") {
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH) { if (det_type == defs::CHIPTESTBOARD) {
REQUIRE_THROWS(proxy.Call("rx_clearroi", {}, -1, PUT)); REQUIRE_THROWS(proxy.Call("rx_clearroi", {}, -1, PUT));
} else { } else {
auto prev_val = det.getRxROI(); auto prev_val = det.getRxROI();
@ -805,7 +805,7 @@ TEST_CASE("rx_zmqport", "[.cmd][.rx]") {
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::EIGER) { if (det_type == defs::EIGER) {
socketsperdetector *= 2; socketsperdetector *= 2;
} else if (det_type == defs::JUNGFRAU) { } else if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
proxy.Call("numinterfaces", {"2"}, -1, PUT); proxy.Call("numinterfaces", {"2"}, -1, PUT);
socketsperdetector *= 2; socketsperdetector *= 2;
} }
@ -830,7 +830,7 @@ TEST_CASE("rx_zmqport", "[.cmd][.rx]") {
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
det.setRxZmqPort(prev_val_zmqport[i], i); det.setRxZmqPort(prev_val_zmqport[i], i);
} }
if (det_type == defs::JUNGFRAU) { if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
det.setNumberofUDPInterfaces(prev_val_numinterfaces); det.setNumberofUDPInterfaces(prev_val_numinterfaces);
} }
} }
@ -948,8 +948,6 @@ TEST_CASE("rx_dbitoffset", "[.cmd][.rx]") {
} }
} }
/* Moench */
TEST_CASE("rx_jsonaddheader", "[.cmd][.rx]") { TEST_CASE("rx_jsonaddheader", "[.cmd][.rx]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);

View File

@ -149,7 +149,8 @@ TEST_CASE("moduleid", "[.cmd]") {
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::GOTTHARD2 || det_type == defs::MYTHEN3 || if (det_type == defs::GOTTHARD2 || det_type == defs::MYTHEN3 ||
det_type == defs::EIGER || det_type == defs::JUNGFRAU) { det_type == defs::EIGER || det_type == defs::JUNGFRAU ||
det_type == defs::MOENCH) {
REQUIRE_NOTHROW(proxy.Call("moduleid", {}, -1, GET)); REQUIRE_NOTHROW(proxy.Call("moduleid", {}, -1, GET));
} else { } else {
REQUIRE_THROWS(proxy.Call("moduleid", {}, -1, GET)); REQUIRE_THROWS(proxy.Call("moduleid", {}, -1, GET));
@ -217,6 +218,7 @@ TEST_CASE("settings", "[.cmd]") {
std::vector<std::string> sett; std::vector<std::string> sett;
switch (det_type) { switch (det_type) {
case defs::JUNGFRAU: case defs::JUNGFRAU:
case defs::MOENCH:
sett.push_back("gain0"); sett.push_back("gain0");
sett.push_back("highgain0"); sett.push_back("highgain0");
break; break;
@ -232,16 +234,6 @@ TEST_CASE("settings", "[.cmd]") {
sett.push_back("fixgain1"); sett.push_back("fixgain1");
sett.push_back("fixgain2"); sett.push_back("fixgain2");
break; break;
case defs::MOENCH:
sett.push_back("g1_hg");
sett.push_back("g1_lg");
sett.push_back("g2_hc_hg");
sett.push_back("g2_hc_lg");
sett.push_back("g2_lc_hg");
sett.push_back("g2_lc_lg");
sett.push_back("g4_hg");
sett.push_back("g4_lg");
break;
case defs::MYTHEN3: case defs::MYTHEN3:
sett.push_back("standard"); sett.push_back("standard");
sett.push_back("fast"); sett.push_back("fast");
@ -525,7 +517,8 @@ TEST_CASE("gappixels", "[.cmd]") {
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::EIGER) { if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::EIGER) {
auto prev_val = det.getGapPixelsinCallback(); auto prev_val = det.getGapPixelsinCallback();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -562,17 +555,17 @@ TEST_CASE("fliprows", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
bool jungfrauhw2 = false; bool hw2 = false;
if (det_type == defs::JUNGFRAU && if ((det_type == defs::JUNGFRAU || det_type == defs::MOENCH) &&
((det.getHardwareVersion().tsquash( ((det.getHardwareVersion().tsquash(
"inconsistent serial number to test") == "2.0"))) { "inconsistent serial number to test") == "2.0"))) {
jungfrauhw2 = true; hw2 = true;
} }
if (det_type == defs::EIGER || jungfrauhw2) { if (det_type == defs::EIGER || hw2) {
auto previous = det.getFlipRows(); auto previous = det.getFlipRows();
auto previous_numudp = det.getNumberofUDPInterfaces().tsquash( auto previous_numudp = det.getNumberofUDPInterfaces().tsquash(
"inconsistent number of udp interfaces to test"); "inconsistent number of udp interfaces to test");
if (det_type == defs::JUNGFRAU) { if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
det.setNumberofUDPInterfaces(2); det.setNumberofUDPInterfaces(2);
} }
std::ostringstream oss1, oss2, oss3; std::ostringstream oss1, oss2, oss3;
@ -585,7 +578,7 @@ TEST_CASE("fliprows", "[.cmd]") {
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
det.setFlipRows(previous[i], {i}); det.setFlipRows(previous[i], {i});
} }
if (det_type == defs::JUNGFRAU) { if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
det.setNumberofUDPInterfaces(previous_numudp); det.setNumberofUDPInterfaces(previous_numudp);
} }
} else { } else {
@ -599,10 +592,10 @@ TEST_CASE("master", "[.cmd]") {
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::EIGER || det_type == defs::MYTHEN3 || if (det_type == defs::EIGER || det_type == defs::MYTHEN3 ||
det_type == defs::GOTTHARD || det_type == defs::GOTTHARD2 || det_type == defs::GOTTHARD || det_type == defs::GOTTHARD2 ||
det_type == defs::JUNGFRAU) { det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
REQUIRE_NOTHROW(proxy.Call("master", {}, -1, GET)); REQUIRE_NOTHROW(proxy.Call("master", {}, -1, GET));
if (det_type == defs::EIGER || det_type == defs::GOTTHARD2 || if (det_type == defs::EIGER || det_type == defs::GOTTHARD2 ||
det_type == defs::JUNGFRAU) { det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
// get previous master // get previous master
int prevMaster = 0; int prevMaster = 0;
{ {
@ -743,7 +736,7 @@ TEST_CASE("exptime", "[.cmd][.time]") {
proxy.Call("exptime", {"1s"}, -1, PUT, oss); proxy.Call("exptime", {"1s"}, -1, PUT, oss);
REQUIRE(oss.str() == "exptime 1s\n"); REQUIRE(oss.str() == "exptime 1s\n");
} }
if (det_type != defs::JUNGFRAU) { if (det_type != defs::JUNGFRAU && det_type != defs::MOENCH) {
{ {
std::ostringstream oss; std::ostringstream oss;
proxy.Call("exptime", {"0"}, -1, PUT, oss); proxy.Call("exptime", {"0"}, -1, PUT, oss);
@ -849,7 +842,6 @@ TEST_CASE("delayl", "[.cmd]") {
switch (det_type) { switch (det_type) {
case defs::EIGER: case defs::EIGER:
case defs::CHIPTESTBOARD: case defs::CHIPTESTBOARD:
case defs::MOENCH:
case defs::GOTTHARD2: case defs::GOTTHARD2:
case defs::MYTHEN3: case defs::MYTHEN3:
REQUIRE_THROWS(proxy.Call("delayl", {}, -1, GET)); REQUIRE_THROWS(proxy.Call("delayl", {}, -1, GET));
@ -867,7 +859,6 @@ TEST_CASE("periodl", "[.cmd]") {
switch (det_type) { switch (det_type) {
case defs::EIGER: case defs::EIGER:
case defs::CHIPTESTBOARD: case defs::CHIPTESTBOARD:
case defs::MOENCH:
case defs::GOTTHARD2: case defs::GOTTHARD2:
case defs::MYTHEN3: case defs::MYTHEN3:
REQUIRE_THROWS(proxy.Call("periodl", {}, -1, GET)); REQUIRE_THROWS(proxy.Call("periodl", {}, -1, GET));
@ -1001,12 +992,12 @@ TEST_CASE("readoutspeed", "[.cmd]") {
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::EIGER || det_type == defs::JUNGFRAU || if (det_type == defs::EIGER || det_type == defs::JUNGFRAU ||
det_type == defs::GOTTHARD2) { det_type == defs::MOENCH || det_type == defs::GOTTHARD2) {
auto prev_val = det.getReadoutSpeed(); auto prev_val = det.getReadoutSpeed();
// full speed for jungfrau only works for new boards (chipv1.1 is with // full speed for jungfrau/moench only works for new boards (chipv1.1 is
// new board [hw1.0 and chipv1.0 not tested here]) // with new board [hw1.0 and chipv1.0 not tested here])
if ((det_type == defs::JUNGFRAU && if (((det_type == defs::JUNGFRAU || det_type == defs::MOENCH) &&
det.getChipVersion().squash() * 10 == 11) || det.getChipVersion().squash() * 10 == 11) ||
(det_type == defs::EIGER)) { (det_type == defs::EIGER)) {
std::ostringstream oss1, oss2, oss3, oss4; std::ostringstream oss1, oss2, oss3, oss4;
@ -1020,7 +1011,8 @@ TEST_CASE("readoutspeed", "[.cmd]") {
REQUIRE(oss4.str() == "readoutspeed full_speed\n"); REQUIRE(oss4.str() == "readoutspeed full_speed\n");
} }
if (det_type == defs::EIGER || det_type == defs::JUNGFRAU) { if (det_type == defs::EIGER || det_type == defs::JUNGFRAU ||
det_type == defs::MOENCH) {
{ {
std::ostringstream oss1, oss2, oss3, oss4; std::ostringstream oss1, oss2, oss3, oss4;
proxy.Call("readoutspeed", {"1"}, -1, PUT, oss1); proxy.Call("readoutspeed", {"1"}, -1, PUT, oss1);
@ -1086,7 +1078,7 @@ TEST_CASE("readoutspeedlist", "[.cmd]") {
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::GOTTHARD2 || det_type == defs::JUNGFRAU || if (det_type == defs::GOTTHARD2 || det_type == defs::JUNGFRAU ||
det_type == defs::EIGER) { det_type == defs::MOENCH || det_type == defs::EIGER) {
REQUIRE_NOTHROW(proxy.Call("readoutspeedlist", {}, -1, GET)); REQUIRE_NOTHROW(proxy.Call("readoutspeedlist", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("readoutspeedlist", {}, -1, PUT)); REQUIRE_THROWS(proxy.Call("readoutspeedlist", {}, -1, PUT));
} else { } else {
@ -1099,7 +1091,7 @@ TEST_CASE("adcphase", "[.cmd]") {
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::GOTTHARD || det_type == defs::JUNGFRAU || if (det_type == defs::GOTTHARD || det_type == defs::JUNGFRAU ||
det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH) { det_type == defs::MOENCH || det_type == defs::CHIPTESTBOARD) {
if (det_type == defs::GOTTHARD) { if (det_type == defs::GOTTHARD) {
std::ostringstream oss1; std::ostringstream oss1;
proxy.Call("adcphase", {"20"}, -1, PUT, oss1); proxy.Call("adcphase", {"20"}, -1, PUT, oss1);
@ -1137,8 +1129,8 @@ TEST_CASE("maxadcphaseshift", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::CHIPTESTBOARD || if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::MOENCH || det_type == defs::CHIPTESTBOARD ||
det_type == defs::MYTHEN3 || // only because clk index of 0 exists det_type == defs::MYTHEN3 || // only because clk index of 0 exists
det_type == defs::GOTTHARD2) { // only because clk index of 0 exists det_type == defs::GOTTHARD2) { // only because clk index of 0 exists
REQUIRE_NOTHROW(proxy.Call("maxadcphaseshift", {}, -1, GET)); REQUIRE_NOTHROW(proxy.Call("maxadcphaseshift", {}, -1, GET));
@ -1151,7 +1143,8 @@ TEST_CASE("dbitphase", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::CHIPTESTBOARD) { if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::CHIPTESTBOARD) {
auto prev_val = det.getDBITPhase(); auto prev_val = det.getDBITPhase();
{ {
std::ostringstream oss1, oss2; std::ostringstream oss1, oss2;
@ -1180,7 +1173,8 @@ TEST_CASE("maxdbitphaseshift", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::CHIPTESTBOARD || if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::CHIPTESTBOARD ||
det_type == defs::MYTHEN3 || // only because clk index of 0 exists det_type == defs::MYTHEN3 || // only because clk index of 0 exists
det_type == defs::GOTTHARD2) { // only because clk index of 0 exists det_type == defs::GOTTHARD2) { // only because clk index of 0 exists
REQUIRE_NOTHROW(proxy.Call("maxdbitphaseshift", {}, -1, GET)); REQUIRE_NOTHROW(proxy.Call("maxdbitphaseshift", {}, -1, GET));
@ -1305,8 +1299,8 @@ TEST_CASE("highvoltage", "[.cmd]") {
} }
} }
// range 0, 60 - 200 // range 0, 60 - 200
else if (det_type == defs::JUNGFRAU || det_type == defs::CHIPTESTBOARD || else if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::MOENCH) { det_type == defs::CHIPTESTBOARD) {
REQUIRE_THROWS(proxy.Call("highvoltage", {"50"}, -1, PUT)); REQUIRE_THROWS(proxy.Call("highvoltage", {"50"}, -1, PUT));
{ {
std::ostringstream oss1, oss2; std::ostringstream oss1, oss2;
@ -1384,8 +1378,8 @@ TEST_CASE("powerchip", "[.cmd]") {
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::MYTHEN3 || if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::GOTTHARD2 || det_type == defs::MOENCH) { det_type == defs::MYTHEN3 || det_type == defs::GOTTHARD2) {
auto prev_val = det.getPowerChip(); auto prev_val = det.getPowerChip();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -1434,8 +1428,9 @@ TEST_CASE("imagetest", "[.cmd]") {
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
det.setImageTestMode(prev_val[i], {i}); det.setImageTestMode(prev_val[i], {i});
} }
} else if (det_type != defs::JUNGFRAU && det_type != defs::EIGER) { } else if (det_type != defs::JUNGFRAU && det_type != defs::MOENCH &&
// wont fail for eiger and jungfrau virtual servers det_type != defs::EIGER) {
// wont fail for eiger and jungfrau/moench virtual servers
REQUIRE_THROWS(proxy.Call("imagetest", {}, -1, GET)); REQUIRE_THROWS(proxy.Call("imagetest", {}, -1, GET));
} }
} }
@ -1557,7 +1552,7 @@ TEST_CASE("filterresistor", "[.cmd]") {
// only for chipv1.1 // only for chipv1.1
bool chip11 = false; bool chip11 = false;
if (det_type == defs::JUNGFRAU && if ((det_type == defs::JUNGFRAU || det_type == defs::MOENCH) &&
det.getChipVersion().squash() * 10 == 11) { det.getChipVersion().squash() * 10 == 11) {
chip11 = true; chip11 = true;
} }
@ -1648,14 +1643,15 @@ TEST_CASE("readnrows", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::EIGER || det_type == defs::JUNGFRAU) { if (det_type == defs::EIGER || det_type == defs::JUNGFRAU ||
bool jungfrauhw2 = false; det_type == defs::MOENCH) {
if (det_type == defs::JUNGFRAU && bool hw2 = false;
if ((det_type == defs::JUNGFRAU || det_type == defs::MOENCH) &&
((det.getHardwareVersion().tsquash( ((det.getHardwareVersion().tsquash(
"inconsistent hardware version number to test") == "2.0"))) { "inconsistent hardware version number to test") == "2.0"))) {
jungfrauhw2 = true; hw2 = true;
} }
if (det_type == defs::JUNGFRAU && !jungfrauhw2) { if ((det_type == defs::JUNGFRAU || det_type == defs::MOENCH) && !hw2) {
{ {
std::ostringstream oss; std::ostringstream oss;
proxy.Call("readnrows", {}, -1, GET, oss); proxy.Call("readnrows", {}, -1, GET, oss);
@ -1678,7 +1674,7 @@ TEST_CASE("readnrows", "[.cmd]") {
proxy.Call("readnrows", {"16"}, -1, PUT, oss); proxy.Call("readnrows", {"16"}, -1, PUT, oss);
REQUIRE(oss.str() == "readnrows 16\n"); REQUIRE(oss.str() == "readnrows 16\n");
} }
if (det_type == defs::JUNGFRAU) { if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
REQUIRE_THROWS(proxy.Call("readnrows", {"7"}, -1, PUT)); REQUIRE_THROWS(proxy.Call("readnrows", {"7"}, -1, PUT));
REQUIRE_THROWS(proxy.Call("readnrows", {"20"}, -1, PUT)); REQUIRE_THROWS(proxy.Call("readnrows", {"20"}, -1, PUT));
REQUIRE_THROWS(proxy.Call("readnrows", {"44"}, -1, PUT)); REQUIRE_THROWS(proxy.Call("readnrows", {"44"}, -1, PUT));
@ -1700,7 +1696,8 @@ TEST_CASE("currentsource", "[.cmd]") {
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::GOTTHARD2 || det_type == defs::JUNGFRAU) { if (det_type == defs::GOTTHARD2 || det_type == defs::JUNGFRAU ||
det_type == defs::MOENCH) {
auto prev_val = det.getCurrentSource(); auto prev_val = det.getCurrentSource();
if (det_type == defs::GOTTHARD2) { if (det_type == defs::GOTTHARD2) {
@ -1724,7 +1721,7 @@ TEST_CASE("currentsource", "[.cmd]") {
REQUIRE_THROWS(proxy.Call("currentsource", REQUIRE_THROWS(proxy.Call("currentsource",
{"1", "fix", "42", "normal"}, -1, PUT)); {"1", "fix", "42", "normal"}, -1, PUT));
} }
// jungfrau // jungfrau/moench
else { else {
int chipVersion = det.getChipVersion().tsquash( int chipVersion = det.getChipVersion().tsquash(
"inconsistent chip versions to test") * "inconsistent chip versions to test") *
@ -1852,7 +1849,8 @@ TEST_CASE("temp_adc", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::GOTTHARD) { if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::GOTTHARD) {
REQUIRE_NOTHROW(proxy.Call("temp_adc", {}, -1, GET)); REQUIRE_NOTHROW(proxy.Call("temp_adc", {}, -1, GET));
std::ostringstream oss; std::ostringstream oss;
REQUIRE_NOTHROW(proxy.Call("temp_adc", {}, 0, GET, oss)); REQUIRE_NOTHROW(proxy.Call("temp_adc", {}, 0, GET, oss));
@ -1867,7 +1865,7 @@ TEST_CASE("temp_fpga", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type != defs::MOENCH && det_type != defs::CHIPTESTBOARD) { if (det_type != defs::CHIPTESTBOARD) {
REQUIRE_NOTHROW(proxy.Call("temp_fpga", {}, -1, GET)); REQUIRE_NOTHROW(proxy.Call("temp_fpga", {}, -1, GET));
std::ostringstream oss; std::ostringstream oss;
REQUIRE_NOTHROW(proxy.Call("temp_fpga", {}, 0, GET, oss)); REQUIRE_NOTHROW(proxy.Call("temp_fpga", {}, 0, GET, oss));
@ -1924,7 +1922,7 @@ TEST_CASE("defaultdac", "[.cmd]") {
det.setDefaultDac(it, prev_val[i], {i}); det.setDefaultDac(it, prev_val[i], {i});
} }
} }
if (det_type == defs::JUNGFRAU) { if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
std::vector<defs::dacIndex> daclist = { std::vector<defs::dacIndex> daclist = {
defs::VREF_PRECH, defs::VREF_DS, defs::VREF_COMP}; defs::VREF_PRECH, defs::VREF_DS, defs::VREF_COMP};
for (auto it : daclist) { for (auto it : daclist) {
@ -1964,7 +1962,7 @@ TEST_CASE("resetdacs", "[.cmd]") {
REQUIRE_NOTHROW(proxy.Call("resetdacs", {}, -1, PUT)); REQUIRE_NOTHROW(proxy.Call("resetdacs", {}, -1, PUT));
REQUIRE_NOTHROW(proxy.Call("resetdacs", {"hard"}, -1, PUT)); REQUIRE_NOTHROW(proxy.Call("resetdacs", {"hard"}, -1, PUT));
// settings should not change especially for jungfrau and m3 // settings should not change especially for jungfrau/moench and m3
auto next_val = det.getSettings(); auto next_val = det.getSettings();
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
REQUIRE(prev_val[i] == next_val[i]); REQUIRE(prev_val[i] == next_val[i]);
@ -1984,7 +1982,8 @@ TEST_CASE("trigger", "[.cmd]") {
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::MYTHEN3) { if (det_type == defs::MYTHEN3) {
REQUIRE_NOTHROW(proxy.Call("trigger", {}, -1, PUT)); REQUIRE_NOTHROW(proxy.Call("trigger", {}, -1, PUT));
} else if (det_type == defs::EIGER || det_type == defs::JUNGFRAU) { } else if (det_type == defs::EIGER || det_type == defs::JUNGFRAU ||
det_type == defs::MOENCH) {
auto prev_timing = auto prev_timing =
det.getTimingMode().tsquash("inconsistent timing mode in test"); det.getTimingMode().tsquash("inconsistent timing mode in test");
auto prev_frames = auto prev_frames =
@ -2024,7 +2023,8 @@ TEST_CASE("blockingtrigger", "[.cmd]") {
CmdProxy proxy(&det); CmdProxy proxy(&det);
REQUIRE_THROWS(proxy.Call("blockingtrigger", {}, -1, GET)); REQUIRE_THROWS(proxy.Call("blockingtrigger", {}, -1, GET));
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::EIGER || det_type == defs::JUNGFRAU) { if (det_type == defs::EIGER || det_type == defs::JUNGFRAU ||
det_type == defs::MOENCH) {
auto prev_timing = auto prev_timing =
det.getTimingMode().tsquash("inconsistent timing mode in test"); det.getTimingMode().tsquash("inconsistent timing mode in test");
auto prev_frames = auto prev_frames =
@ -2275,6 +2275,7 @@ TEST_CASE("scan", "[.cmd]") {
notImplementedInd = defs::VCASCP_PB; notImplementedInd = defs::VCASCP_PB;
break; break;
case defs::JUNGFRAU: case defs::JUNGFRAU:
case defs::MOENCH:
ind = defs::VB_COMP; ind = defs::VB_COMP;
notImplementedInd = defs::VSVP; notImplementedInd = defs::VSVP;
break; break;
@ -2282,10 +2283,6 @@ TEST_CASE("scan", "[.cmd]") {
ind = defs::VREF_DS; ind = defs::VREF_DS;
notImplementedInd = defs::VSVP; notImplementedInd = defs::VSVP;
break; break;
case defs::MOENCH:
ind = defs::VBP_COLBUF;
notImplementedInd = defs::VSVP;
break;
case defs::GOTTHARD2: case defs::GOTTHARD2:
ind = defs::VB_COMP_FE; ind = defs::VB_COMP_FE;
notImplementedInd = defs::VSVP; notImplementedInd = defs::VSVP;
@ -2401,7 +2398,7 @@ TEST_CASE("numinterfaces", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU) { if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
auto prev_val = det.getNumberofUDPInterfaces().tsquash( auto prev_val = det.getNumberofUDPInterfaces().tsquash(
"inconsistent numinterfaces to test"); "inconsistent numinterfaces to test");
{ {
@ -2456,8 +2453,9 @@ TEST_CASE("udp_dstlist", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::EIGER || if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::MYTHEN3 || det_type == defs::GOTTHARD2) { det_type == defs::EIGER || det_type == defs::MYTHEN3 ||
det_type == defs::GOTTHARD2) {
REQUIRE_NOTHROW(proxy.Call("udp_dstlist", {}, 0, GET, std::cout, 0)); REQUIRE_NOTHROW(proxy.Call("udp_dstlist", {}, 0, GET, std::cout, 0));
REQUIRE_THROWS(proxy.Call( REQUIRE_THROWS(proxy.Call(
"udp_dstlist", {"ip=0.0.0.0", "mac=00:00:00:00:00:00", "port=1233"}, "udp_dstlist", {"ip=0.0.0.0", "mac=00:00:00:00:00:00", "port=1233"},
@ -2471,8 +2469,9 @@ TEST_CASE("udp_numdst", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::EIGER || if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::MYTHEN3 || det_type == defs::GOTTHARD2) { det_type == defs::EIGER || det_type == defs::MYTHEN3 ||
det_type == defs::GOTTHARD2) {
REQUIRE_NOTHROW(proxy.Call("udp_numdst", {}, -1, GET)); REQUIRE_NOTHROW(proxy.Call("udp_numdst", {}, -1, GET));
} else { } else {
REQUIRE_THROWS(proxy.Call("udp_numdst", {}, -1, GET)); REQUIRE_THROWS(proxy.Call("udp_numdst", {}, -1, GET));
@ -2491,8 +2490,8 @@ TEST_CASE("udp_firstdst", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::MYTHEN3 || if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::GOTTHARD2) { det_type == defs::MYTHEN3 || det_type == defs::GOTTHARD2) {
auto prev_val = det.getFirstUDPDestination(); auto prev_val = det.getFirstUDPDestination();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -2568,7 +2567,8 @@ TEST_CASE("udp_srcip2", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::GOTTHARD2) { if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::GOTTHARD2) {
auto prev_val = det.getSourceUDPIP2(); auto prev_val = det.getSourceUDPIP2();
REQUIRE_THROWS(proxy.Call("udp_srcip2", {"0.0.0.0"}, -1, PUT)); REQUIRE_THROWS(proxy.Call("udp_srcip2", {"0.0.0.0"}, -1, PUT));
{ {
@ -2589,7 +2589,8 @@ TEST_CASE("udp_dstip2", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::GOTTHARD2) { if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::GOTTHARD2) {
REQUIRE_THROWS(proxy.Call("udp_dstip2", {"0.0.0.0"}, -1, PUT)); REQUIRE_THROWS(proxy.Call("udp_dstip2", {"0.0.0.0"}, -1, PUT));
} else { } else {
REQUIRE_THROWS(proxy.Call("udp_dstip2", {}, -1, GET)); REQUIRE_THROWS(proxy.Call("udp_dstip2", {}, -1, GET));
@ -2600,7 +2601,8 @@ TEST_CASE("udp_srcmac2", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::GOTTHARD2) { if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::GOTTHARD2) {
auto prev_val = det.getSourceUDPMAC2(); auto prev_val = det.getSourceUDPMAC2();
REQUIRE_THROWS( REQUIRE_THROWS(
proxy.Call("udp_srcmac2", {"00:00:00:00:00:00"}, -1, PUT)); proxy.Call("udp_srcmac2", {"00:00:00:00:00:00"}, -1, PUT));
@ -2623,7 +2625,8 @@ TEST_CASE("udp_dstmac2", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::GOTTHARD2) { if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::GOTTHARD2) {
REQUIRE_THROWS( REQUIRE_THROWS(
proxy.Call("udp_dstmac2", {"00:00:00:00:00:00"}, -1, PUT)); proxy.Call("udp_dstmac2", {"00:00:00:00:00:00"}, -1, PUT));
} else { } else {
@ -2635,8 +2638,8 @@ TEST_CASE("udp_dstport2", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::GOTTHARD2 || if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::EIGER) { det_type == defs::GOTTHARD2 || det_type == defs::EIGER) {
auto prev_val = det.getDestinationUDPPort2(); auto prev_val = det.getDestinationUDPPort2();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -2671,7 +2674,7 @@ TEST_CASE("tengiga", "[.cmd]") {
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::EIGER || det_type == defs::CHIPTESTBOARD || if (det_type == defs::EIGER || det_type == defs::CHIPTESTBOARD ||
det_type == defs::MOENCH || det_type == defs::MYTHEN3) { det_type == defs::MYTHEN3) {
auto tengiga = det.getTenGiga(); auto tengiga = det.getTenGiga();
det.setTenGiga(false); det.setTenGiga(false);
@ -2694,7 +2697,8 @@ TEST_CASE("flowcontrol10g", "[.cmd]") {
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::EIGER || det_type == defs::JUNGFRAU) { if (det_type == defs::EIGER || det_type == defs::JUNGFRAU ||
det_type == defs::MOENCH) {
auto prev_val = det.getTenGigaFlowControl(); auto prev_val = det.getTenGigaFlowControl();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -2724,10 +2728,11 @@ TEST_CASE("txdelay_frame", "[.cmd]") {
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::EIGER || det_type == defs::JUNGFRAU || if (det_type == defs::EIGER || det_type == defs::JUNGFRAU ||
det_type == defs::MYTHEN3) { det_type == defs::MOENCH || det_type == defs::MYTHEN3) {
auto prev_val = det.getTransmissionDelayFrame(); auto prev_val = det.getTransmissionDelayFrame();
auto val = 5000; auto val = 5000;
if (det_type == defs::JUNGFRAU || det_type == defs::MYTHEN3) { if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::MYTHEN3) {
val = 5; val = 5;
} }
std::string sval = std::to_string(val); std::string sval = std::to_string(val);
@ -2751,10 +2756,11 @@ TEST_CASE("txdelay", "[.cmd]") {
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::EIGER || det_type == defs::JUNGFRAU || if (det_type == defs::EIGER || det_type == defs::JUNGFRAU ||
det_type == defs::MYTHEN3) { det_type == defs::MOENCH || det_type == defs::MYTHEN3) {
// cannot get transmission delay with just one module // cannot get transmission delay with just one module
if ((det_type == defs::JUNGFRAU || det_type == defs::MYTHEN3) && if ((det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::MYTHEN3) &&
(det.size() < 2)) { (det.size() < 2)) {
REQUIRE_THROWS(proxy.Call("txdelay", {}, -1, GET)); REQUIRE_THROWS(proxy.Call("txdelay", {}, -1, GET));
int val = 5; int val = 5;
@ -2776,7 +2782,8 @@ TEST_CASE("txdelay", "[.cmd]") {
} }
auto prev_frame = det.getTransmissionDelayFrame(); auto prev_frame = det.getTransmissionDelayFrame();
auto val = 5000; auto val = 5000;
if (det_type == defs::JUNGFRAU || det_type == defs::MYTHEN3) { if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::MYTHEN3) {
val = 5; val = 5;
} }
std::string sval = std::to_string(val); std::string sval = std::to_string(val);
@ -2829,7 +2836,7 @@ TEST_CASE("zmqport", "[.cmd]") {
int prev = 1; int prev = 1;
if (det_type == defs::EIGER) { if (det_type == defs::EIGER) {
socketsperdetector *= 2; socketsperdetector *= 2;
} else if (det_type == defs::JUNGFRAU) { } else if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
prev = det.getNumberofUDPInterfaces().squash(); prev = det.getNumberofUDPInterfaces().squash();
det.setNumberofUDPInterfaces(2); det.setNumberofUDPInterfaces(2);
socketsperdetector *= 2; socketsperdetector *= 2;
@ -2863,7 +2870,7 @@ TEST_CASE("zmqport", "[.cmd]") {
std::to_string(port + i * socketsperdetector) + std::to_string(port + i * socketsperdetector) +
'\n'); '\n');
} }
if (det_type == defs::JUNGFRAU) { if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
det.setNumberofUDPInterfaces(prev); det.setNumberofUDPInterfaces(prev);
} }
} }
@ -2917,8 +2924,8 @@ TEST_CASE("programfpga", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH || if (det_type == defs::CHIPTESTBOARD || det_type == defs::JUNGFRAU ||
det_type == defs::JUNGFRAU || det_type == defs::MYTHEN3 || det_type == defs::MOENCH || det_type == defs::MYTHEN3 ||
det_type == defs::GOTTHARD2) { det_type == defs::GOTTHARD2) {
// TODO program a real board? // TODO program a real board?
/// afs/psi.ch/project/sls_det_firmware/jungfrau_firmware/cyclone_V/v0_8/Jungfrau_MCB.pof /// afs/psi.ch/project/sls_det_firmware/jungfrau_firmware/cyclone_V/v0_8/Jungfrau_MCB.pof
@ -2949,8 +2956,8 @@ TEST_CASE("updatekernel", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::CHIPTESTBOARD || if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::MOENCH || det_type == defs::MYTHEN3 || det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3 ||
det_type == defs::GOTTHARD2) { det_type == defs::GOTTHARD2) {
// TODO: send real server? // TODO: send real server?
// std::ostringstream oss; // std::ostringstream oss;
@ -2968,8 +2975,8 @@ TEST_CASE("rebootcontroller", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::CHIPTESTBOARD || if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::MOENCH || det_type == defs::MYTHEN3 || det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3 ||
det_type == defs::GOTTHARD2 || det_type == defs::GOTTHARD) { det_type == defs::GOTTHARD2 || det_type == defs::GOTTHARD) {
// TODO: reboot real server? // TODO: reboot real server?
// REQUIRE_NOTHROW(proxy.Call("rebootcontroller", {}, -1, PUT)); // REQUIRE_NOTHROW(proxy.Call("rebootcontroller", {}, -1, PUT));
@ -2984,8 +2991,8 @@ TEST_CASE("update", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::CHIPTESTBOARD || if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::MOENCH) { det_type == defs::CHIPTESTBOARD) {
// TODO: update real server and firmware? // TODO: update real server and firmware?
// REQUIRE_NOTHROW(proxy.Call("update", // REQUIRE_NOTHROW(proxy.Call("update",
// {"jungfrauDetectorServerv4.0.1.0", "pc13784", // {"jungfrauDetectorServerv4.0.1.0", "pc13784",
@ -3028,8 +3035,8 @@ TEST_CASE("adcreg", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::CHIPTESTBOARD || if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::MOENCH || det_type == defs::GOTTHARD) { det_type == defs::CHIPTESTBOARD || det_type == defs::GOTTHARD) {
std::ostringstream oss; std::ostringstream oss;
proxy.Call("adcreg", {"0x8", "0x3"}, -1, PUT, oss); proxy.Call("adcreg", {"0x8", "0x3"}, -1, PUT, oss);
REQUIRE(oss.str() == "adcreg [0x8, 0x3]\n"); REQUIRE(oss.str() == "adcreg [0x8, 0x3]\n");
@ -3113,8 +3120,8 @@ TEST_CASE("firmwaretest", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::CHIPTESTBOARD || if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::MOENCH || det_type == defs::GOTTHARD || det_type == defs::CHIPTESTBOARD || det_type == defs::GOTTHARD ||
det_type == defs::MYTHEN3 || det_type == defs::GOTTHARD2) { det_type == defs::MYTHEN3 || det_type == defs::GOTTHARD2) {
std::ostringstream oss; std::ostringstream oss;
proxy.Call("firmwaretest", {}, -1, PUT, oss); proxy.Call("firmwaretest", {}, -1, PUT, oss);
@ -3130,8 +3137,8 @@ TEST_CASE("bustest", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::CHIPTESTBOARD || if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::MOENCH || det_type == defs::GOTTHARD || det_type == defs::CHIPTESTBOARD || det_type == defs::GOTTHARD ||
det_type == defs::MYTHEN3 || det_type == defs::GOTTHARD2) { det_type == defs::MYTHEN3 || det_type == defs::GOTTHARD2) {
std::ostringstream oss; std::ostringstream oss;
proxy.Call("bustest", {}, -1, PUT, oss); proxy.Call("bustest", {}, -1, PUT, oss);
@ -3170,8 +3177,8 @@ TEST_CASE("adcinvert", "[.cmd]") {
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MOENCH || if (det_type == defs::CHIPTESTBOARD || det_type == defs::JUNGFRAU ||
det_type == defs::JUNGFRAU) { det_type == defs::MOENCH) {
auto prev_val = det.getADCInvert(); auto prev_val = det.getADCInvert();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -3261,8 +3268,8 @@ TEST_CASE("framecounter", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::CHIPTESTBOARD || if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::MOENCH || det_type == defs::MYTHEN3 || det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3 ||
det_type == defs::GOTTHARD2) { det_type == defs::GOTTHARD2) {
auto framecounter = det.getNumberOfFramesFromStart().squash(); auto framecounter = det.getNumberOfFramesFromStart().squash();
std::ostringstream oss; std::ostringstream oss;
@ -3280,8 +3287,8 @@ TEST_CASE("runtime", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::CHIPTESTBOARD || if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::MOENCH || det_type == defs::MYTHEN3 || det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3 ||
det_type == defs::GOTTHARD2) { det_type == defs::GOTTHARD2) {
std::ostringstream oss; std::ostringstream oss;
proxy.Call("runtime", {}, -1, GET, oss); proxy.Call("runtime", {}, -1, GET, oss);
@ -3298,8 +3305,8 @@ TEST_CASE("frametime", "[.cmd]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::CHIPTESTBOARD || if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::MOENCH || det_type == defs::MYTHEN3 || det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3 ||
det_type == defs::GOTTHARD2) { det_type == defs::GOTTHARD2) {
std::ostringstream oss; std::ostringstream oss;
proxy.Call("frametime", {}, -1, GET, oss); proxy.Call("frametime", {}, -1, GET, oss);

View File

@ -351,7 +351,7 @@ int ClientInterface::setup_receiver(Interface &socket) {
} }
impl()->setUDPPortNumber(arg.udp_dstport); impl()->setUDPPortNumber(arg.udp_dstport);
impl()->setUDPPortNumber2(arg.udp_dstport2); impl()->setUDPPortNumber2(arg.udp_dstport2);
if (detType == JUNGFRAU || detType == GOTTHARD2) { if (detType == JUNGFRAU || detType == MOENCH || detType == GOTTHARD2) {
try { try {
impl()->setNumberofUDPInterfaces(arg.udpInterfaces); impl()->setNumberofUDPInterfaces(arg.udpInterfaces);
} catch (const RuntimeError &e) { } catch (const RuntimeError &e) {
@ -367,10 +367,10 @@ int ClientInterface::setup_receiver(Interface &socket) {
if (detType == GOTTHARD2) { if (detType == GOTTHARD2) {
impl()->setNumberOfBursts(arg.bursts); impl()->setNumberOfBursts(arg.bursts);
} }
if (detType == JUNGFRAU) { if (detType == JUNGFRAU || detType == MOENCH) {
impl()->setNumberOfAdditionalStorageCells(arg.additionalStorageCells); impl()->setNumberOfAdditionalStorageCells(arg.additionalStorageCells);
} }
if (detType == MOENCH || detType == CHIPTESTBOARD) { if (detType == CHIPTESTBOARD) {
try { try {
impl()->setNumberofAnalogSamples(arg.analogSamples); impl()->setNumberofAnalogSamples(arg.analogSamples);
} catch (const RuntimeError &e) { } catch (const RuntimeError &e) {
@ -408,7 +408,7 @@ int ClientInterface::setup_receiver(Interface &socket) {
} }
impl()->setThresholdEnergy(arg.thresholdEnergyeV[0]); impl()->setThresholdEnergy(arg.thresholdEnergyeV[0]);
} }
if (detType == EIGER || detType == JUNGFRAU) { if (detType == EIGER || detType == JUNGFRAU || detType == MOENCH) {
impl()->setReadNRows(arg.readNRows); impl()->setReadNRows(arg.readNRows);
} }
if (detType == MYTHEN3) { if (detType == MYTHEN3) {
@ -428,8 +428,7 @@ int ClientInterface::setup_receiver(Interface &socket) {
} }
} }
impl()->setTimingMode(arg.timMode); impl()->setTimingMode(arg.timMode);
if (detType == EIGER || detType == MOENCH || detType == CHIPTESTBOARD || if (detType == EIGER || detType == CHIPTESTBOARD || detType == MYTHEN3) {
detType == MYTHEN3) {
try { try {
impl()->setTenGigaEnable(arg.tenGiga); impl()->setTenGigaEnable(arg.tenGiga);
} catch (const RuntimeError &e) { } catch (const RuntimeError &e) {
@ -444,7 +443,7 @@ int ClientInterface::setup_receiver(Interface &socket) {
"due to fifo memory allocation."); "due to fifo memory allocation.");
} }
} }
if (detType == CHIPTESTBOARD || detType == MOENCH) { if (detType == CHIPTESTBOARD) {
try { try {
impl()->setADCEnableMask(arg.adcMask); impl()->setADCEnableMask(arg.adcMask);
} catch (const RuntimeError &e) { } catch (const RuntimeError &e) {
@ -488,8 +487,8 @@ void ClientInterface::setDetectorType(detectorType arg) {
case GOTTHARD: case GOTTHARD:
case EIGER: case EIGER:
case CHIPTESTBOARD: case CHIPTESTBOARD:
case MOENCH:
case JUNGFRAU: case JUNGFRAU:
case MOENCH:
case MYTHEN3: case MYTHEN3:
case GOTTHARD2: case GOTTHARD2:
break; break;
@ -611,7 +610,7 @@ int ClientInterface::set_burst_mode(Interface &socket) {
int ClientInterface::set_num_analog_samples(Interface &socket) { int ClientInterface::set_num_analog_samples(Interface &socket) {
auto value = socket.Receive<int>(); auto value = socket.Receive<int>();
LOG(logDEBUG1) << "Setting num analog samples to " << value; LOG(logDEBUG1) << "Setting num analog samples to " << value;
if (detType != CHIPTESTBOARD && detType != MOENCH) { if (detType != CHIPTESTBOARD) {
functionNotImplemented(); functionNotImplemented();
} }
try { try {
@ -939,8 +938,7 @@ int ClientInterface::get_overwrite(Interface &socket) {
int ClientInterface::enable_tengiga(Interface &socket) { int ClientInterface::enable_tengiga(Interface &socket) {
auto val = socket.Receive<int>(); auto val = socket.Receive<int>();
if (detType != EIGER && detType != CHIPTESTBOARD && detType != MOENCH && if (detType != EIGER && detType != CHIPTESTBOARD && detType != MYTHEN3)
detType != MYTHEN3)
functionNotImplemented(); functionNotImplemented();
if (val >= 0) { if (val >= 0) {
@ -1365,7 +1363,7 @@ int ClientInterface::set_read_n_rows(Interface &socket) {
auto arg = socket.Receive<int>(); auto arg = socket.Receive<int>();
if (arg >= 0) { if (arg >= 0) {
verifyIdle(socket); verifyIdle(socket);
if (detType != EIGER && detType != JUNGFRAU) { if (detType != EIGER && detType != JUNGFRAU && detType != MOENCH) {
throw RuntimeError("Could not set number of rows. Not implemented " throw RuntimeError("Could not set number of rows. Not implemented "
"for this detector"); "for this detector");
} }
@ -1448,7 +1446,7 @@ MacAddr ClientInterface::setUdpIp2(IpAddr arg) {
int ClientInterface::set_udp_ip2(Interface &socket) { int ClientInterface::set_udp_ip2(Interface &socket) {
auto arg = socket.Receive<IpAddr>(); auto arg = socket.Receive<IpAddr>();
verifyIdle(socket); verifyIdle(socket);
if (detType != JUNGFRAU && detType != GOTTHARD2) { if (detType != JUNGFRAU && detType != MOENCH && detType != GOTTHARD2) {
throw RuntimeError( throw RuntimeError(
"UDP Destination IP2 not implemented for this detector"); "UDP Destination IP2 not implemented for this detector");
} }
@ -1467,7 +1465,8 @@ int ClientInterface::set_udp_port(Interface &socket) {
int ClientInterface::set_udp_port2(Interface &socket) { int ClientInterface::set_udp_port2(Interface &socket) {
auto arg = socket.Receive<int>(); auto arg = socket.Receive<int>();
verifyIdle(socket); verifyIdle(socket);
if (detType != JUNGFRAU && detType != EIGER && detType != GOTTHARD2) { if (detType != JUNGFRAU && detType != MOENCH && detType != EIGER &&
detType != GOTTHARD2) {
throw RuntimeError( throw RuntimeError(
"UDP Destination Port2 not implemented for this detector"); "UDP Destination Port2 not implemented for this detector");
} }
@ -1480,7 +1479,7 @@ int ClientInterface::set_num_interfaces(Interface &socket) {
auto arg = socket.Receive<int>(); auto arg = socket.Receive<int>();
arg = (arg > 1 ? 2 : 1); arg = (arg > 1 ? 2 : 1);
verifyIdle(socket); verifyIdle(socket);
if (detType != JUNGFRAU && detType != GOTTHARD2) { if (detType != JUNGFRAU && detType != MOENCH && detType != GOTTHARD2) {
throw RuntimeError( throw RuntimeError(
"Number of interfaces not implemented for this detector"); "Number of interfaces not implemented for this detector");
} }
@ -1727,7 +1726,7 @@ int ClientInterface::get_receiver_roi(Interface &socket) {
int ClientInterface::set_receiver_roi(Interface &socket) { int ClientInterface::set_receiver_roi(Interface &socket) {
auto arg = socket.Receive<ROI>(); auto arg = socket.Receive<ROI>();
if (detType == CHIPTESTBOARD || detType == MOENCH) if (detType == CHIPTESTBOARD)
functionNotImplemented(); functionNotImplemented();
LOG(logDEBUG1) << "Set Receiver ROI: " << ToString(arg); LOG(logDEBUG1) << "Set Receiver ROI: " << ToString(arg);
verifyIdle(socket); verifyIdle(socket);
@ -1741,7 +1740,7 @@ int ClientInterface::set_receiver_roi(Interface &socket) {
int ClientInterface::set_receiver_roi_metadata(Interface &socket) { int ClientInterface::set_receiver_roi_metadata(Interface &socket) {
auto arg = socket.Receive<ROI>(); auto arg = socket.Receive<ROI>();
if (detType == CHIPTESTBOARD || detType == MOENCH) if (detType == CHIPTESTBOARD)
functionNotImplemented(); functionNotImplemented();
LOG(logDEBUG1) << "Set Receiver ROI Metadata: " << ToString(arg); LOG(logDEBUG1) << "Set Receiver ROI Metadata: " << ToString(arg);
verifyIdle(socket); verifyIdle(socket);

View File

@ -480,7 +480,6 @@ void DataProcessor::PadMissingPackets(sls_receiver_header header, char *data) {
memset(data + (pnum * dsize), 0xFF, dsize + 2); memset(data + (pnum * dsize), 0xFF, dsize + 2);
break; break;
case CHIPTESTBOARD: case CHIPTESTBOARD:
case MOENCH:
if (pnum == (pperFrame - 1)) if (pnum == (pperFrame - 1))
memset(data + (pnum * dsize), 0xFF, corrected_dsize); memset(data + (pnum * dsize), 0xFF, corrected_dsize);
else else

View File

@ -352,6 +352,36 @@ class JungfrauData : public GeneralData {
}; };
}; };
class MoenchData : public GeneralData {
public:
MoenchData() {
detType = slsDetectorDefs::MOENCH;
headerSizeinPacket = sizeof(slsDetectorDefs::sls_detector_header);
dataSize = 6400;
packetSize = headerSizeinPacket + dataSize;
framesPerFile = MOENCH_MAX_FRAMES_PER_FILE;
fifoDepth = 1000;
standardheader = true;
maxRowsPerReadout = 400;
UpdateImageSize();
};
void SetNumberofInterfaces(const int n) {
numUDPInterfaces = n;
UpdateImageSize();
};
private:
void UpdateImageSize() {
nPixelsX = (400);
nPixelsY = (400) / numUDPInterfaces;
imageSize = int(nPixelsX * nPixelsY * GetPixelDepth());
packetsPerFrame = imageSize / dataSize;
udpSocketBufferSize = (1000 * 1024 * 1024) / numUDPInterfaces;
};
};
class Mythen3Data : public GeneralData { class Mythen3Data : public GeneralData {
private: private:
int ncounters{0}; int ncounters{0};
@ -565,68 +595,4 @@ class ChipTestBoardData : public GeneralData {
}; };
}; };
class MoenchData : public GeneralData {
private:
const int NUM_BYTES_PER_ANALOG_CHANNEL = 2;
public:
MoenchData() {
detType = slsDetectorDefs::MOENCH;
headerSizeinPacket = sizeof(slsDetectorDefs::sls_detector_header);
frameIndexMask = 0xFFFFFF;
framesPerFile = MOENCH_MAX_FRAMES_PER_FILE;
fifoDepth = 2500;
standardheader = true;
UpdateImageSize();
};
void SetNumberOfAnalogSamples(int n) {
nAnalogSamples = n;
UpdateImageSize();
};
void SetOneGigaAdcEnableMask(int n) {
adcEnableMaskOneGiga = n;
UpdateImageSize();
};
void SetTenGigaAdcEnableMask(int n) {
adcEnableMaskTenGiga = n;
UpdateImageSize();
};
void SetTenGigaEnable(bool tg) {
tengigaEnable = tg;
UpdateImageSize();
};
private:
void UpdateImageSize() {
uint32_t adcEnableMask =
(tengigaEnable ? adcEnableMaskTenGiga : adcEnableMaskOneGiga);
// count number of channels in x, each adc has 25 channels each
int nchanTop = __builtin_popcount(adcEnableMask & 0xF0F0F0F0) * 25;
int nchanBot = __builtin_popcount(adcEnableMask & 0x0F0F0F0F) * 25;
nPixelsX = nchanTop > 0 ? nchanTop : nchanBot;
// if both top and bottom adcs enabled, rows = 2
int nrows = 1;
if (nchanTop > 0 && nchanBot > 0) {
nrows = 2;
}
nPixelsY = nAnalogSamples / 25 * nrows;
LOG(logINFO) << "Number of Pixels: [" << nPixelsX << ", " << nPixelsY
<< "]";
dataSize = tengigaEnable ? 8144 : UDP_PACKET_DATA_BYTES;
packetSize = headerSizeinPacket + dataSize;
imageSize = nPixelsX * nPixelsY * NUM_BYTES_PER_ANALOG_CHANNEL;
packetsPerFrame = ceil((double)imageSize / (double)dataSize);
LOG(logDEBUG) << "Databytes: " << imageSize;
};
};
} // namespace sls } // namespace sls

View File

@ -113,8 +113,8 @@ void Implementation::setDetectorType(const detectorType d) {
case GOTTHARD: case GOTTHARD:
case EIGER: case EIGER:
case JUNGFRAU: case JUNGFRAU:
case CHIPTESTBOARD:
case MOENCH: case MOENCH:
case CHIPTESTBOARD:
case MYTHEN3: case MYTHEN3:
case GOTTHARD2: case GOTTHARD2:
LOG(logINFO) << " ***** " << ToString(d) << " Receiver *****"; LOG(logINFO) << " ***** " << ToString(d) << " Receiver *****";
@ -138,12 +138,12 @@ void Implementation::setDetectorType(const detectorType d) {
case JUNGFRAU: case JUNGFRAU:
generalData = new JungfrauData(); generalData = new JungfrauData();
break; break;
case CHIPTESTBOARD:
generalData = new ChipTestBoardData();
break;
case MOENCH: case MOENCH:
generalData = new MoenchData(); generalData = new MoenchData();
break; break;
case CHIPTESTBOARD:
generalData = new ChipTestBoardData();
break;
case MYTHEN3: case MYTHEN3:
generalData = new Mythen3Data(); generalData = new Mythen3Data();
break; break;

View File

@ -460,7 +460,6 @@ void Listener::CopyPacket(char *dst, char *src, uint32_t dataSize,
memcpy(dst + dataSize - 2, &src[detHeaderSize], dataSize + 2); memcpy(dst + dataSize - 2, &src[detHeaderSize], dataSize + 2);
break; break;
case CHIPTESTBOARD: case CHIPTESTBOARD:
case MOENCH:
if (pnum == (generalData->packetsPerFrame - 1)) if (pnum == (generalData->packetsPerFrame - 1))
memcpy(dst + (pnum * dataSize), &src[detHeaderSize], memcpy(dst + (pnum * dataSize), &src[detHeaderSize],
correctedDataSize); correctedDataSize);

View File

@ -16,6 +16,9 @@ void MasterAttributes::GetBinaryAttributes(
case slsDetectorDefs::JUNGFRAU: case slsDetectorDefs::JUNGFRAU:
GetJungfrauBinaryAttributes(w); GetJungfrauBinaryAttributes(w);
break; break;
case slsDetectorDefs::MOENCH:
GetMoenchBinaryAttributes(w);
break;
case slsDetectorDefs::EIGER: case slsDetectorDefs::EIGER:
GetEigerBinaryAttributes(w); GetEigerBinaryAttributes(w);
break; break;
@ -25,9 +28,6 @@ void MasterAttributes::GetBinaryAttributes(
case slsDetectorDefs::GOTTHARD2: case slsDetectorDefs::GOTTHARD2:
GetGotthard2BinaryAttributes(w); GetGotthard2BinaryAttributes(w);
break; break;
case slsDetectorDefs::MOENCH:
GetMoenchBinaryAttributes(w);
break;
case slsDetectorDefs::CHIPTESTBOARD: case slsDetectorDefs::CHIPTESTBOARD:
GetCtbBinaryAttributes(w); GetCtbBinaryAttributes(w);
break; break;
@ -48,6 +48,9 @@ void MasterAttributes::WriteHDF5Attributes(H5::H5File *fd, H5::Group *group) {
case slsDetectorDefs::JUNGFRAU: case slsDetectorDefs::JUNGFRAU:
WriteJungfrauHDF5Attributes(fd, group); WriteJungfrauHDF5Attributes(fd, group);
break; break;
case slsDetectorDefs::MOENCH:
WriteMoenchHDF5Attributes(fd, group);
break;
case slsDetectorDefs::EIGER: case slsDetectorDefs::EIGER:
WriteEigerHDF5Attributes(fd, group); WriteEigerHDF5Attributes(fd, group);
break; break;
@ -57,9 +60,6 @@ void MasterAttributes::WriteHDF5Attributes(H5::H5File *fd, H5::Group *group) {
case slsDetectorDefs::GOTTHARD2: case slsDetectorDefs::GOTTHARD2:
WriteGotthard2HDF5Attributes(fd, group); WriteGotthard2HDF5Attributes(fd, group);
break; break;
case slsDetectorDefs::MOENCH:
WriteMoenchHDF5Attributes(fd, group);
break;
case slsDetectorDefs::CHIPTESTBOARD: case slsDetectorDefs::CHIPTESTBOARD:
WriteCtbHDF5Attributes(fd, group); WriteCtbHDF5Attributes(fd, group);
break; break;
@ -622,6 +622,28 @@ void MasterAttributes::WriteJungfrauHDF5Attributes(H5::H5File *fd,
} }
#endif #endif
void MasterAttributes::GetMoenchBinaryAttributes(
rapidjson::PrettyWriter<rapidjson::StringBuffer> *w) {
w->Key("Exptime");
w->String(ToString(exptime).c_str());
w->Key("Period");
w->String(ToString(period).c_str());
w->Key("Number of UDP Interfaces");
w->Uint(numUDPInterfaces);
w->Key("Number of rows");
w->Uint(readNRows);
}
#ifdef HDF5C
void MasterAttributes::WriteMoenchuHDF5Attributes(H5::H5File *fd,
H5::Group *group) {
MasterAttributes::WriteHDF5Exptime(fd, group);
MasterAttributes::WriteHDF5Period(fd, group);
MasterAttributes::WriteHDF5NumUDPInterfaces(fd, group);
MasterAttributes::WriteHDF5ReadNRows(fd, group);
}
#endif
void MasterAttributes::GetEigerBinaryAttributes( void MasterAttributes::GetEigerBinaryAttributes(
rapidjson::PrettyWriter<rapidjson::StringBuffer> *w) { rapidjson::PrettyWriter<rapidjson::StringBuffer> *w) {
w->Key("Dynamic Range"); w->Key("Dynamic Range");
@ -719,31 +741,6 @@ void MasterAttributes::WriteGotthard2HDF5Attributes(H5::H5File *fd,
} }
#endif #endif
void MasterAttributes::GetMoenchBinaryAttributes(
rapidjson::PrettyWriter<rapidjson::StringBuffer> *w) {
w->Key("Exptime");
w->String(ToString(exptime).c_str());
w->Key("Period");
w->String(ToString(period).c_str());
w->Key("Ten Giga");
w->Uint(tenGiga);
w->Key("ADC Mask");
w->String(ToStringHex(adcmask).c_str());
w->Key("Analog Samples");
w->Uint(analogSamples);
}
#ifdef HDF5C
void MasterAttributes::WriteMoenchHDF5Attributes(H5::H5File *fd,
H5::Group *group) {
MasterAttributes::WriteHDF5Exptime(fd, group);
MasterAttributes::WriteHDF5Period(fd, group);
MasterAttributes::WriteHDF5TenGiga(fd, group);
MasterAttributes::WriteHDF5AdcMask(fd, group);
MasterAttributes::WriteHDF5AnalogSamples(fd, group);
}
#endif
void MasterAttributes::GetCtbBinaryAttributes( void MasterAttributes::GetCtbBinaryAttributes(
rapidjson::PrettyWriter<rapidjson::StringBuffer> *w) { rapidjson::PrettyWriter<rapidjson::StringBuffer> *w) {
w->Key("Exptime"); w->Key("Exptime");

View File

@ -24,9 +24,9 @@ namespace sls {
#define MAX_FRAMES_PER_FILE 20000 #define MAX_FRAMES_PER_FILE 20000
#define SHORT_MAX_FRAMES_PER_FILE 100000 #define SHORT_MAX_FRAMES_PER_FILE 100000
#define MOENCH_MAX_FRAMES_PER_FILE 100000
#define EIGER_MAX_FRAMES_PER_FILE 10000 #define EIGER_MAX_FRAMES_PER_FILE 10000
#define JFRAU_MAX_FRAMES_PER_FILE 10000 #define JFRAU_MAX_FRAMES_PER_FILE 10000
#define MOENCH_MAX_FRAMES_PER_FILE 10000
#define CTB_MAX_FRAMES_PER_FILE 20000 #define CTB_MAX_FRAMES_PER_FILE 20000
#define MYTHEN3_MAX_FRAMES_PER_FILE 10000 #define MYTHEN3_MAX_FRAMES_PER_FILE 10000
#define GOTTHARD2_MAX_FRAMES_PER_FILE 20000 #define GOTTHARD2_MAX_FRAMES_PER_FILE 20000

View File

@ -48,7 +48,7 @@
#define SLS_DETECTOR_HEADER_VERSION 0x2 #define SLS_DETECTOR_HEADER_VERSION 0x2
#define SLS_DETECTOR_JSON_HEADER_VERSION 0x4 #define SLS_DETECTOR_JSON_HEADER_VERSION 0x4
// ctb/ moench 1g udp (read from fifo) // ctb 1g udp (read from fifo)
#define UDP_PACKET_DATA_BYTES (1344) #define UDP_PACKET_DATA_BYTES (1344)
/** maximum trim en */ /** maximum trim en */
@ -404,7 +404,7 @@ typedef struct {
enum clockIndex { ADC_CLOCK, DBIT_CLOCK, RUN_CLOCK, SYNC_CLOCK }; enum clockIndex { ADC_CLOCK, DBIT_CLOCK, RUN_CLOCK, SYNC_CLOCK };
/** /**
* read out mode (ctb, moench) * read out mode (ctb)
*/ */
enum readoutMode { ANALOG_ONLY, DIGITAL_ONLY, ANALOG_AND_DIGITAL }; enum readoutMode { ANALOG_ONLY, DIGITAL_ONLY, ANALOG_AND_DIGITAL };
@ -632,6 +632,13 @@ struct detParameters {
nChipY = 1; nChipY = 1;
nDacs = 8; nDacs = 8;
break; break;
case slsDetectorDefs::detectorType::MOENCH:
nChanX = 400;
nChanY = 400;
nChipX = 1;
nChipY = 1;
nDacs = 8;
break;
case slsDetectorDefs::detectorType::JUNGFRAU: case slsDetectorDefs::detectorType::JUNGFRAU:
nChanX = 256; nChanX = 256;
nChanY = 256; nChanY = 256;
@ -646,13 +653,6 @@ struct detParameters {
nChipY = 1; nChipY = 1;
nDacs = 24; nDacs = 24;
break; break;
case slsDetectorDefs::detectorType::MOENCH:
nChanX = 32;
nChanY = 1;
nChipX = 1;
nChipY = 1;
nDacs = 8;
break;
case slsDetectorDefs::detectorType::EIGER: case slsDetectorDefs::detectorType::EIGER:
nChanX = 256; nChanX = 256;
nChanY = 256; nChanY = 256;

View File

@ -1,9 +1,10 @@
// SPDX-License-Identifier: LGPL-3.0-or-other // SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package // Copyright (C) 2021 Contributors to the SLS Detector Package
/** API versions */ /** API versions */
#define RELEASE "7.0.0.rc1" #define RELEASE "developer"
#define APILIB "7.0.0.rc1 0x221208" #define APILIB "developer 0x221213"
#define APIRECEIVER "7.0.0.rc1 0x221208" #define APIRECEIVER "developer 0x221213"
#define APICTB "developer 0x221213" #define APICTB "developer 0x221213"
#define APIGOTTHARD "developer 0x221213" #define APIGOTTHARD "developer 0x221213"
#define APIGOTTHARD2 "developer 0x221213" #define APIGOTTHARD2 "developer 0x221213"