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:
2023-07-14 16:29:21 +02:00
committed by GitHub
parent a56be25500
commit c628ae2192
30 changed files with 1118 additions and 238 deletions

View File

@@ -220,6 +220,8 @@ int ClientInterface::functionTable(){
flist[F_RECEIVER_GET_RECEIVER_ROI] = &ClientInterface::get_receiver_roi;
flist[F_RECEIVER_SET_RECEIVER_ROI] = &ClientInterface::set_receiver_roi;
flist[F_RECEIVER_SET_RECEIVER_ROI_METADATA] = &ClientInterface::set_receiver_roi_metadata;
flist[F_RECEIVER_SET_NUM_TRANSCEIVER_SAMPLES] = &ClientInterface::set_num_transceiver_samples;
flist[F_RECEIVER_SET_TRANSCEIVER_MASK] = &ClientInterface::set_transceiver_mask;
for (int i = NUM_DET_FUNCTIONS + 1; i < NUM_REC_FUNCTIONS ; i++) {
LOG(logDEBUG1) << "function fnum: " << i << " (" <<
@@ -370,9 +372,8 @@ int ClientInterface::setup_receiver(Interface &socket) {
if (detType == CHIPTESTBOARD) {
impl()->setNumberofAnalogSamples(arg.analogSamples);
}
if (detType == CHIPTESTBOARD) {
impl()->setNumberofDigitalSamples(arg.digitalSamples);
impl()->setNumberofTransceiverSamples(arg.transceiverSamples);
}
if (detType != MYTHEN3) {
impl()->setAcquisitionTime(std::chrono::nanoseconds(arg.expTimeNs));
@@ -410,6 +411,7 @@ int ClientInterface::setup_receiver(Interface &socket) {
impl()->setReadoutMode(arg.roMode);
impl()->setADCEnableMask(arg.adcMask);
impl()->setTenGigaADCEnableMask(arg.adc10gMask);
impl()->setTransceiverEnableMask(arg.transceiverMask);
}
if (detType == GOTTHARD) {
impl()->setDetectorROI(arg.roi);
@@ -1758,4 +1760,43 @@ int ClientInterface::set_receiver_roi_metadata(Interface &socket) {
return socket.Send(OK);
}
int ClientInterface::set_num_transceiver_samples(Interface &socket) {
auto value = socket.Receive<int>();
LOG(logDEBUG1) << "Setting num transceiver samples to " << value;
if (detType != CHIPTESTBOARD) {
functionNotImplemented();
}
try {
impl()->setNumberofTransceiverSamples(value);
} catch (const std::exception &e) {
throw RuntimeError("Could not set number of transceiver samples to " +
std::to_string(value) + " [" +
std::string(e.what()) + ']');
}
return socket.Send(OK);
}
int ClientInterface::set_transceiver_mask(Interface &socket) {
auto arg = socket.Receive<uint32_t>();
verifyIdle(socket);
LOG(logDEBUG1) << "Setting Transceiver enable mask: " << arg;
try {
impl()->setTransceiverEnableMask(arg);
} catch (const std::exception &e) {
throw RuntimeError("Could not set transceiver enable mask [" +
std::string(e.what()) + ']');
}
auto retval = impl()->getTransceiverEnableMask();
if (retval != arg) {
std::ostringstream os;
os << "Could not set Transceiver enable mask. Set 0x" << std::hex << arg
<< " but read 0x" << std::hex << retval;
throw RuntimeError(os.str());
}
LOG(logDEBUG1) << "Transceiver enable mask retval: " << retval;
return socket.sendResult(retval);
}
} // namespace sls