mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-21 09:08:00 +02:00
1. Ctb transceiver ro (#773)
* transceiverenable, tsamples, romode for tranceiver and digital_transceiver * 202 spec instr only for transceiver mode * removed check for empty in trans readout and clean memory before reading from fifo * ctb read fifo strobe for all after reading all channels, adding 1us after selecting channel, changing fw date * updated 10gb transceiver enable ---- * added transceiver (tsamples, romode(transceiver, digital_transceiver), transceiverenable (mask) * clean memory before reading from fifo (for analog and digital as well) * read fifo then read strobe (also corresp fw) fixes number of reads (also for analg and digital)-> increases all pipelines by 1 * fixed bug in rearranging digital data in receiver * fixed bug in streaming size of data after rearranging * fixed bug in setbit, clearbit,and getbit * status checks fifo before returning idle (transmitting if data in fifo if transceiver more enabled) * soem matterhorn specifics that will need to be put into pattern in a month or two. this is temporary. * NOTE: breaking api. rxParameters struct has transceiverenabel and tsamples given from det to receiver
This commit is contained in:
@ -58,11 +58,13 @@ class GeneralData {
|
||||
bool tengigaEnable{false};
|
||||
uint32_t nAnalogSamples{0};
|
||||
uint32_t nDigitalSamples{0};
|
||||
uint32_t nTransceiverSamples{0};
|
||||
slsDetectorDefs::readoutMode readoutType{slsDetectorDefs::ANALOG_ONLY};
|
||||
uint32_t adcEnableMaskOneGiga{BIT32_MASK};
|
||||
uint32_t adcEnableMaskTenGiga{BIT32_MASK};
|
||||
slsDetectorDefs::ROI detectorRoi{};
|
||||
uint32_t counterMask{0};
|
||||
uint32_t transceiverMask{0};
|
||||
|
||||
GeneralData(){};
|
||||
virtual ~GeneralData(){};
|
||||
@ -132,6 +134,16 @@ class GeneralData {
|
||||
return 0;
|
||||
};
|
||||
|
||||
virtual int GetNumberOfDigitalDatabytes() {
|
||||
ThrowGenericError("GetNumberOfDigitalDatabytes");
|
||||
return 0;
|
||||
};
|
||||
|
||||
virtual int GetNumberOfTransceiverDatabytes() {
|
||||
ThrowGenericError("GetNumberOfTransceiverDatabytes");
|
||||
return 0;
|
||||
};
|
||||
|
||||
virtual void SetNumberOfAnalogSamples(int n) {
|
||||
ThrowGenericError("SetNumberOfAnalogSamples");
|
||||
};
|
||||
@ -140,6 +152,10 @@ class GeneralData {
|
||||
ThrowGenericError("SetNumberOfDigitalSamples");
|
||||
};
|
||||
|
||||
virtual void SetNumberOfTransceiverSamples(int n) {
|
||||
ThrowGenericError("SetNumberOfTransceiverSamples");
|
||||
};
|
||||
|
||||
virtual void SetOneGigaAdcEnableMask(int n) {
|
||||
ThrowGenericError("SetOneGigaAdcEnableMask");
|
||||
};
|
||||
@ -151,6 +167,10 @@ class GeneralData {
|
||||
virtual void SetReadoutMode(slsDetectorDefs::readoutMode r) {
|
||||
ThrowGenericError("SetReadoutMode");
|
||||
};
|
||||
|
||||
virtual void SetTransceiverEnableMask(int n) {
|
||||
ThrowGenericError("SetTransceiverEnableMask");
|
||||
};
|
||||
};
|
||||
|
||||
class GotthardData : public GeneralData {
|
||||
@ -507,7 +527,10 @@ class ChipTestBoardData : public GeneralData {
|
||||
private:
|
||||
const int NCHAN_DIGITAL = 64;
|
||||
const int NUM_BYTES_PER_ANALOG_CHANNEL = 2;
|
||||
const int NUM_BYTES_PER_TRANSCEIVER_CHANNEL = 8;
|
||||
int nAnalogBytes = 0;
|
||||
int nDigitalBytes = 0;
|
||||
int nTransceiverBytes = 0;
|
||||
|
||||
public:
|
||||
/** Constructor */
|
||||
@ -527,6 +550,10 @@ class ChipTestBoardData : public GeneralData {
|
||||
public:
|
||||
int GetNumberOfAnalogDatabytes() { return nAnalogBytes; };
|
||||
|
||||
int GetNumberOfDigitalDatabytes() { return nDigitalBytes; };
|
||||
|
||||
int GetNumberOfTransceiverDatabytes() { return nTransceiverBytes; };
|
||||
|
||||
void SetNumberOfAnalogSamples(int n) {
|
||||
nAnalogSamples = n;
|
||||
UpdateImageSize();
|
||||
@ -537,6 +564,11 @@ class ChipTestBoardData : public GeneralData {
|
||||
UpdateImageSize();
|
||||
};
|
||||
|
||||
void SetNumberOfTransceiverSamples(int n) {
|
||||
nTransceiverSamples = n;
|
||||
UpdateImageSize();
|
||||
};
|
||||
|
||||
void SetOneGigaAdcEnableMask(int n) {
|
||||
adcEnableMaskOneGiga = n;
|
||||
UpdateImageSize();
|
||||
@ -547,6 +579,11 @@ class ChipTestBoardData : public GeneralData {
|
||||
UpdateImageSize();
|
||||
};
|
||||
|
||||
void SetTransceiverEnableMask(int n) {
|
||||
transceiverMask = n;
|
||||
UpdateImageSize();
|
||||
};
|
||||
|
||||
void SetReadoutMode(slsDetectorDefs::readoutMode r) {
|
||||
readoutType = r;
|
||||
UpdateImageSize();
|
||||
@ -560,8 +597,9 @@ class ChipTestBoardData : public GeneralData {
|
||||
private:
|
||||
void UpdateImageSize() {
|
||||
nAnalogBytes = 0;
|
||||
int nDigitalBytes = 0;
|
||||
int nAnalogChans = 0, nDigitalChans = 0;
|
||||
nDigitalBytes = 0;
|
||||
nTransceiverBytes = 0;
|
||||
int nAnalogChans = 0, nDigitalChans = 0, nTransceiverChans = 0;
|
||||
|
||||
// analog channels (normal, analog/digital readout)
|
||||
if (readoutType == slsDetectorDefs::ANALOG_ONLY ||
|
||||
@ -577,17 +615,29 @@ class ChipTestBoardData : public GeneralData {
|
||||
}
|
||||
// digital channels
|
||||
if (readoutType == slsDetectorDefs::DIGITAL_ONLY ||
|
||||
readoutType == slsDetectorDefs::ANALOG_AND_DIGITAL) {
|
||||
readoutType == slsDetectorDefs::ANALOG_AND_DIGITAL ||
|
||||
readoutType == slsDetectorDefs::DIGITAL_AND_TRANSCEIVER) {
|
||||
nDigitalChans = NCHAN_DIGITAL;
|
||||
nDigitalBytes = (sizeof(uint64_t) * nDigitalSamples);
|
||||
LOG(logDEBUG1) << "Number of Digital Channels:" << nDigitalChans
|
||||
<< " Databytes: " << nDigitalBytes;
|
||||
}
|
||||
|
||||
nPixelsX = nAnalogChans + nDigitalChans;
|
||||
// transceiver channels
|
||||
if (readoutType == slsDetectorDefs::TRANSCEIVER_ONLY ||
|
||||
readoutType == slsDetectorDefs::DIGITAL_AND_TRANSCEIVER) {
|
||||
nTransceiverChans = __builtin_popcount(transceiverMask);
|
||||
;
|
||||
nTransceiverBytes = nTransceiverChans *
|
||||
NUM_BYTES_PER_TRANSCEIVER_CHANNEL *
|
||||
nTransceiverSamples;
|
||||
LOG(logDEBUG1) << "Number of Transceiver Channels:"
|
||||
<< nTransceiverChans
|
||||
<< " Databytes: " << nTransceiverBytes;
|
||||
}
|
||||
nPixelsX = nAnalogChans + nDigitalChans + nTransceiverChans;
|
||||
dataSize = tengigaEnable ? 8144 : UDP_PACKET_DATA_BYTES;
|
||||
packetSize = headerSizeinPacket + dataSize;
|
||||
imageSize = nAnalogBytes + nDigitalBytes;
|
||||
imageSize = nAnalogBytes + nDigitalBytes + nTransceiverBytes;
|
||||
packetsPerFrame = ceil((double)imageSize / (double)dataSize);
|
||||
|
||||
LOG(logDEBUG1) << "Total Number of Channels:" << nPixelsX
|
||||
|
Reference in New Issue
Block a user