$treeview $search $mathjax $extrastylesheet
otsdaq_components
v2_03_00
$projectbrief
|
$projectbrief
|
$searchbox |
00001 //#include "otsdaq-components/DAQHardware/PSI46DigFirmware.h" 00002 //#include "otsdaq-components/DAQHardware/PSI46DigFirmwareDefinitions.h" 00003 //#include "otsdaq-core/BitManipulator/BitManipulator.h" 00004 //#include "otsdaq-components/DetectorHardware/PSI46DigROCDefinitions.h" 00005 //#include "otsdaq-core/MessageFacility/MessageFacility.h" 00006 //#include "otsdaq-core/Macros/CoutMacros.h" 00007 //#include <sys/socket.h> 00008 //#include <netinet/in.h> 00009 //#include <arpa/inet.h> 00010 //#include <iostream> 00011 //#include <cstdlib> 00012 // 00013 // using namespace ots; 00014 // 00015 // 00017 // PSI46DigFirmware::PSI46DigFirmware(unsigned int version, std::string type) : 00018 // FrontEndFirmwareBase(version), 00019 // stripCSRRegisterValue_(0) 00020 //{ 00021 // protocolInstance_ = FrontEndFirmwareBase::getInstance(type,version); 00022 // assert(protocolInstance_ != NULL); 00023 // //returns either new OtsUDPFirmware or new PurdueFirmwareCore, 00024 // //now we can call write/read etc with protocol->write, protocol->read, etc 00025 //} 00026 // 00028 // PSI46DigFirmware::~PSI46DigFirmware(void) 00029 //{ 00030 // delete protocolInstance_; 00031 // protocolInstance_= NULL; 00032 //} 00033 // 00035 // int PSI46DigFirmware::init(void) 00036 //{ 00037 // return 0; 00038 //} 00039 // 00041 // std::string PSI46DigFirmware::configureClocks(std::string source, double frequency) 00042 //{ 00043 // std::cout << __COUT_HDR_FL__ << "Writing Clock configuration!" << std::endl; 00044 // 00045 // std::string buffer; 00046 // //NoNeedNowwrite(buffer, ETHIO_DESTINATION_PORT, 0x0000b798); // Listen port for 00047 // ethio stuff 00048 // 00049 // setPacketSizeStripCSR(6); 00050 // setExternalBCOClockSourceStripCSR(source); //(source) 00051 // protocolInstance_->write(buffer, STRIP_CSR, stripCSRRegisterValue_); // Reset CSR - 00052 // reset trigger counter, external 27 MHz clock 00053 // 00054 // resetDCMStripCSR(true); 00055 // protocolInstance_->write(buffer, STRIP_CSR, stripCSRRegisterValue_); // Set reset 00056 // to DCM 00057 // 00058 // resetDCMStripCSR(false); 00059 // protocolInstance_->write(buffer, STRIP_CSR, stripCSRRegisterValue_); // Clear reset 00060 // to DCM 00061 // 00062 // ; 00063 // protocolInstance_->waitClear(buffer, STRIP_CSR, waitDCMResetStripCSR()); // Wait 00064 // for DCM to lock 00065 // 00066 // protocolInstance_->write(buffer, STRIP_TRIM_CSR, 0x00002000); // MCLKB edge for 00067 // channel 5 // was 0x00002000 00068 // 00069 // setFrequencyFromClockState(buffer, frequency); 00070 // protocolInstance_->write(buffer, STRIP_CSR, stripCSRRegisterValue_); 00071 // 00072 // resetDCMStripCSR(true); 00073 // protocolInstance_->write(buffer, STRIP_CSR, stripCSRRegisterValue_); 00074 // 00075 // resetDCMStripCSR(false); 00076 // protocolInstance_->write(buffer, STRIP_CSR, stripCSRRegisterValue_); 00077 // 00078 // protocolInstance_->waitClear(buffer, STRIP_CSR, waitDCMResetStripCSR()); // Wait 00079 // for DCM to lock std::cout << __COUT_HDR_FL__ << "stripCSRRegisterValue :" << 00080 // std::hex << stripCSRRegisterValue_ << std::dec << std::endl; 00081 // 00082 // return buffer; 00083 //} 00084 // 00086 // std::string PSI46DigFirmware::resetDetector(int channel) 00087 //{ 00088 // std::cout << __COUT_HDR_FL__ << "Resetting detector!" << std::endl; 00089 // std::string buffer; 00090 // if (channel == -1)//reset all channels 00091 // { 00092 // //protocolInstance_->write(buffer,STRIP_RESET,0xd000003f); // 00093 // Issue reset protocolInstance_->write(buffer, STRIP_RESET, 0xf000003f); // Issue 00094 // reset // was 0xf000003f protocolInstance_->waitClear(buffer, STRIP_RESET, 00095 // 0xf0000000); // Wait for reset to complete // was 0xf0000000 00096 // } else 00097 // { 00098 // protocolInstance_->write(buffer, STRIP_RESET, 0xf000003f); // Issue reset 00099 // protocolInstance_->waitClear(buffer, STRIP_RESET, 0xf0000000); // Wait for 00100 // reset to complete 00101 // } 00102 // 00103 // return buffer; 00104 //} 00105 // 00107 // std::string PSI46DigFirmware::enableTrigger(void) 00108 //{ 00109 // std::string buffer; 00110 // std::cout << __COUT_HDR_FL__ << "Enabling Trigger!!!" << std::endl; 00111 // std::cout << __COUT_HDR_FL__ << "stripCSRRegisterValue in :" << std::hex << 00112 // stripCSRRegisterValue_ << std::dec << std::endl; 00113 // 00114 // setHaltStripCSR(1);//WARNING THIS IS CLEARED BY THE MASTER BUT IF THERE IS NO MASTER 00115 // NOTHING WORKS UNLESS THE BIT IS UNSET 00116 // //setHaltStripCSR(0);//WARNING THIS IS CLEARED BY THE MASTER BUT IF THERE IS NO 00117 // MASTER NOTHING WORKS UNLESS THE BIT IS UNSET sendTriggerDataStripCSR(true); 00118 // sendTriggerNumberStripCSR(true); 00119 // sendBCOStripCSR(true); 00120 // protocolInstance_->write(buffer, STRIP_CSR, stripCSRRegisterValue_); 00121 // 00122 // stripTriggerCSRRegisterValue_ = 0; 00123 // BCOOffset(4); 00124 // protocolInstance_->write(buffer, STRIP_TRIG_CSR, stripTriggerCSRRegisterValue_); // 00125 // BCO offset // was 0x00000004 00126 // 00127 // // write(buffer,STRIP_TRIG_INPUT_0,0x1f060040); // PSI46Dig GOTHIT trigger input 00128 // - timed in for the 27 MHz external clock 00129 // // write(buffer,STRIP_TRIG_INPUT_3,0x3f874040); // Unbiased trigger input + 00130 // external trigger 00131 // 00132 // configureStripTriggerUnbiased(buffer); 00133 // 00134 // configureTriggerInputs(buffer); 00135 // 00136 // //FIXME for IP .36 the number to set is 0x20401000 00137 // 00138 // if (version_ == 1) 00139 // protocolInstance_->write(buffer, STRIP_TRIG_INPUT_3, 0x20401000); // Turn on 00140 // streaming hits along with BCO data 00141 // else if (version_ == 2) 00142 // protocolInstance_->write(buffer, STRIP_TRIG_INPUT_3, 0x20301000); // Turn on 00143 // streaming hits along with BCO data 00144 // else 00145 // { 00146 // std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << "what version is this?" << 00147 // version_ << std::endl; 00148 // assert(0); 00149 // } 00150 // std::cout << __COUT_HDR_FL__ << "stripCSRRegisterValue out:" << std::hex << 00151 // stripCSRRegisterValue_ << std::dec << std::endl; std::cout << __COUT_HDR_FL__ << 00152 // "Done enabling Trigger!!!" << std::endl; 00153 // 00154 // return buffer; 00155 //} 00156 // 00158 // std::string PSI46DigFirmware::resetBCO(void) 00159 //{ 00160 // std::cout << __COUT_HDR_FL__ << "Reset BCO!!!" << std::endl; 00161 // std::cout << __COUT_HDR_FL__ << "stripCSRRegisterValue in :" << std::hex << 00162 // stripCSRRegisterValue_ << std::dec << std::endl; std::string buffer; 00163 // 00164 // resetTriggerCounterStripCSR(buffer); 00165 // //write(buffer, STRIP_CSR, stripCSRRegisterValue_);//the write is done in the reset 00166 // std::cout << __COUT_HDR_FL__ << "stripCSRRegisterValue :" << std::hex << 00167 // stripCSRRegisterValue_ << std::dec << std::endl; 00168 // 00169 // //msg->Write(STRIP_SC_CSR,0x90000b95|(chmask<<16)); 00170 // //write(buffer,STRIP_SC_CSR,0x900f0b95);// This is the <SCR,set> command with the 00171 // bit set to sync SHIFT with BCO=0. 00172 // 00173 // 00174 // enableBCOStripCSR(true); 00175 // protocolInstance_->write(buffer, STRIP_CSR, stripCSRRegisterValue_); 00176 // std::cout << __COUT_HDR_FL__ << "stripCSRRegisterValue out:" << std::hex << 00177 // stripCSRRegisterValue_ << std::dec << std::endl; std::cout << __COUT_HDR_FL__ << 00178 // "Done reset BCO!!!" << std::endl; 00179 // 00180 // return buffer; 00181 //} 00182 // 00184 // std::string PSI46DigFirmware::startStream(bool channel0, bool channel1, bool channel2, 00185 // bool channel3, bool channel4, bool channel5) 00186 //{ 00187 // std::cout << __COUT_HDR_FL__ << "Start Stream!" << std::endl; 00188 // std::cout << __COUT_HDR_FL__ << "stripCSRRegisterValue in:" << std::hex << 00189 // stripCSRRegisterValue_ << std::dec << std::endl; std::string buffer; 00190 // 00191 // std::cout << __COUT_HDR_FL__ << " channel0 " << channel0 << " channel1 " << channel1 00192 // << " channel2 " << channel2 << " channel3 " << channel3 << " channel4 " << channel4 00193 // << " channel5 " << channel5 << std::endl; 00194 // 00195 // enableChannelsStripCSR(channel0, channel1, channel2, channel3, channel4, channel5); 00196 // // if (version_ == 1) 00197 // // enableChannelsStripCSR(true, true, true, true, false, false); 00198 // // else if (version_ == 2) 00199 // // enableChannelsStripCSR(true, true, true, true, true, true); 00200 // 00201 // enableStreamStripCSR(true); // Turn on streaming hits along with BCO data // was 00202 // 0x0f000f30 protocolInstance_->write(buffer, STRIP_CSR, stripCSRRegisterValue_); 00203 // 00204 // std::cout << __COUT_HDR_FL__ << "stripCSRRegisterValue out:" << std::hex << 00205 // stripCSRRegisterValue_ << std::dec << std::endl; std::cout << __COUT_HDR_FL__ << 00206 // "Done start Stream!" << std::endl; 00207 // 00208 // return buffer; 00209 //} 00210 // 00212 // std::string PSI46DigFirmware::stopStream(void) 00213 //{ 00214 // std::string buffer; 00215 // enableChannelsStripCSR(false, false, false, false, false, false); 00216 // enableStreamStripCSR(false); 00217 // protocolInstance_->write(buffer, STRIP_CSR, stripCSRRegisterValue_); 00218 // return buffer; 00219 //} 00220 // 00222 // void PSI46DigFirmware::makeDACSequence(FirmwareSequence<uint64_t>& sequence, 00223 // unsigned int channel, const ROCStream& rocStream) 00224 //{ 00225 // const ROCDACs& rocDACs = rocStream.getROCDACs(); 00226 // for (DACList::const_iterator it = rocDACs.getDACList().begin(); it 00227 // != rocDACs.getDACList().end(); it++) 00228 // { 00229 // //if(it->first != "SendData" && it->first != "RejectHits") continue; 00230 // uint64_t data = PSI46DigROCDefinitions::makeDACWriteCommand( 00231 // rocStream.getFEWROCAddress(), it->first, it->second.second); 00232 // sequence.pushBack(ChannelFIFOAddress[channel], data); 00233 // sequence.pushBack(ChannelFIFOAddress[channel], 00234 // BitManipulator::insertBits(data, (uint64_t) 0x48, 56, 8)); 00235 // //set WRITE 00236 // sequence.pushBack(ChannelFIFOAddress[channel], 00237 // BitManipulator::insertBits(data, (uint64_t) 1, 60, 1)); 00238 // //clr WRITE 00239 // sequence.pushBack(ChannelFIFOAddress[channel], 00240 // BitManipulator::insertBits(data, (uint64_t) 0, 60, 1)); 00241 // //clr TALK 00242 // sequence.pushBack(ChannelFIFOAddress[channel], 00243 // BitManipulator::insertBits(data, (uint64_t) 0, 62, 1)); 00244 // sequence.pushBack(ChannelFIFOAddress[channel], 00245 // BitManipulator::insertBits(data, (uint64_t) 0x40, 56, 8)); 00246 // //break; 00247 // } 00248 //} 00249 // 00251 // void PSI46DigFirmware::makeDACSequence(FirmwareSequence<uint32_t>& sequence, 00252 // unsigned int channel, const ROCStream& rocStream) 00253 //{ 00254 // const ROCDACs& rocDACs = rocStream.getROCDACs(); 00255 // for (DACList::const_iterator it = rocDACs.getDACList().begin(); it 00256 // != rocDACs.getDACList().end(); it++) 00257 // { 00258 // /*RYAN 00259 // //if(it->first != "SendData" && it->first != "RejectHits") continue; 00260 // uint64_t data = 00261 // PSI46DigROCDefinitions::makeDACWriteCommand(rocStream.getFEWROCAddress(), 00262 // it->first, it->second.second); sequence.pushBack(ChannelFIFOAddress[channel], 00263 // data); sequence.pushBack(ChannelFIFOAddress[channel], 00264 // BitManipulator::insertBits(data,(uint32_t)0x48,56,8)); 00265 // //set WRITE 00266 // sequence.pushBack(ChannelFIFOAddress[channel], 00267 // BitManipulator::insertBits(data,(uint32_t)1,60,1)); 00268 // //clr WRITE 00269 // sequence.pushBack(ChannelFIFOAddress[channel], 00270 // BitManipulator::insertBits(data,(uint32_t)0,60,1)); 00271 // //clr TALK 00272 // sequence.pushBack(ChannelFIFOAddress[channel], 00273 // BitManipulator::insertBits(data,(uint32_t)0,62,1)); 00274 // sequence.pushBack(ChannelFIFOAddress[channel], 00275 // BitManipulator::insertBits(data,(uint32_t)0x40,56,8)); 00276 // */ 00277 // 00278 // //if(it->first != "SendData" && it->first != "RejectHits") continue; 00279 // uint32_t data = PSI46DigROCDefinitions::makeDACWriteHeader( 00280 // rocStream.getFEWROCAddress(), it->first); 00281 // //Insert channel 00282 // BitManipulator::insertBits(data, 1, 16 + channel, 1); 00283 // sequence.pushBack(ChannelFIFOAddress[channel], it->second.second); 00284 // std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << "Register: " << it->first 00285 // << " value: " 00286 // << it->second.second << std::hex << " -> Data: " << data << std::dec 00287 // << std::endl; 00288 // sequence.pushBack(STRIP_SC_CSR, data); 00289 // } 00290 //} 00291 // 00293 // void PSI46DigFirmware::makeDACBuffer(std::string& buffer, 00294 // unsigned int channel, const ROCStream& rocStream) 00295 //{ 00296 // std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << "Channel: " << channel << 00297 // std::endl; const ROCDACs& rocDACs = rocStream.getROCDACs(); for 00298 // (DACList::const_iterator it = rocDACs.getDACList().begin(); it != 00299 // rocDACs.getDACList().end(); it++) 00300 // { 00301 // std::string bufferElement; 00302 // protocolInstance_->waitClear(bufferElement, STRIP_SC_CSR, 0x80000000); 00303 // uint32_t registerHeader = 0; 00304 // //FIXME This must go in the PSI46DigROCDefinitions stuff 00305 // if (it->first != "RejectHits" && it->first != "SendData") 00306 // { 00307 // protocolInstance_->write(bufferElement, ChannelFIFOAddress[channel], 00308 // it->second.second); registerHeader = 00309 // PSI46DigROCDefinitions::makeDACWriteHeader( 00310 // rocStream.getFEWROCAddress(), it->first); 00311 // //std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << "Register: " << 00312 // it->first << " value: " << it->second.second << hex << " -> Data: " << 00313 // registerHeader << dec << std::endl; 00314 // //Insert channel 00315 // BitManipulator::insertBits(registerHeader, 1, 16 + channel, 1); 00316 // } 00317 // else 00318 // { 00319 // if (it->second.second == 1 || it->second.second == 2) 00320 // { 00321 // registerHeader = PSI46DigROCDefinitions::makeDACSetHeader( 00322 // rocStream.getFEWROCAddress(), it->first); 00323 // //Insert channel 00324 // BitManipulator::insertBits(registerHeader, 1, 16 + channel, 1); 00325 // } 00326 // else if (it->second.second == 0 || it->second.second == 5) 00327 // { 00328 // registerHeader = PSI46DigROCDefinitions::makeDACResetHeader( 00329 // rocStream.getFEWROCAddress(), it->first); 00330 // //Insert channel 00331 // BitManipulator::insertBits(registerHeader, 1, 16 + channel, 1); 00332 // } 00333 // else 00334 // std::cout << __COUT_HDR_FL__ << "Register value for : " << it->first 00335 // << " doesn't have a value I expect -> value = " 00336 // << it->second.second << std::endl; 00337 // 00338 // } 00339 // //std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << "Register: " << 00340 // it->first << " value: " << it->second.second << hex << " -> Data: " << 00341 // registerHeader << dec << std::endl; protocolInstance_->write(bufferElement, 00342 // STRIP_SC_CSR, registerHeader); protocolInstance_->waitClear(bufferElement, 00343 // STRIP_SC_CSR, 0x80000000); 00344 // 00345 // //buffer.push_back(bufferElement); 00346 // buffer += bufferElement; 00347 // //break; 00348 // } 00349 //} 00350 // 00352 // void PSI46DigFirmware:: makeDACBuffer(std::vector<std::string>& buffer, unsigned int 00353 // channel, const ROCStream& rocStream) 00354 //{ 00355 // 00356 // std::cout << __COUT_HDR_FL__ << "\tMaking DAC Buffer" << std::endl; 00357 // 00358 // int limitCount = 0; 00359 // unsigned int singleVectorCount = 0; 00360 // 00361 // std::string alternateBuffer; 00362 // 00363 // std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << "Channel: " << channel << 00364 // std::endl; const ROCDACs& rocDACs = rocStream.getROCDACs(); 00365 // //std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << "Number of DACs: " << 00366 // rocDACs.getDACList().size() << std::endl; std::string bufferElement; for 00367 // (DACList::const_iterator it = rocDACs.getDACList().begin(); it != 00368 // rocDACs.getDACList().end(); it++) 00369 // { 00370 // protocolInstance_->waitClear(bufferElement, STRIP_SC_CSR, 0x80000000); 00371 // uint32_t registerHeader = 0; 00372 // //FIXME This must go in the PSI46DigROCDefinitions stuff 00373 // if (it->first != "RejectHits" && it->first != "SendData") 00374 // { 00375 // protocolInstance_->write(bufferElement, ChannelFIFOAddress[channel], 00376 // it->second.second); registerHeader = 00377 // PSI46DigROCDefinitions::makeDACWriteHeader( 00378 // rocStream.getFEWROCAddress(), it->first); 00379 // std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << "Register: " << 00380 // it->first << " value: " << it->second.second << std::hex << " -> Data: " << 00381 // registerHeader << std::dec << std::endl; 00382 // //Insert channel 00383 // BitManipulator::insertBits(registerHeader, 1, 16 + channel, 1); 00384 // } 00385 // else 00386 // { 00387 // if (it->second.second == 1 || it->second.second == 2) 00388 // { 00389 // registerHeader = PSI46DigROCDefinitions::makeDACSetHeader( 00390 // rocStream.getFEWROCAddress(), it->first); 00391 // //Insert channel 00392 // BitManipulator::insertBits(registerHeader, 1, 16 + channel, 1); 00393 // } 00394 // else if (it->second.second == 0 || it->second.second == 5) 00395 // { 00396 // registerHeader = PSI46DigROCDefinitions::makeDACResetHeader( 00397 // rocStream.getFEWROCAddress(), it->first); 00398 // //Insert channel 00399 // BitManipulator::insertBits(registerHeader, 1, 16 + channel, 1); 00400 // } 00401 // else 00402 // std::cout << __COUT_HDR_FL__ << "Register value for : " << it->first 00403 // << " doesn't have a value I expect -> value = " 00404 // << it->second.second << std::endl; 00405 // 00406 // } 00407 // //std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << "Register: " << 00408 // it->first << " value: " << it->second.second << hex << " -> Data: " << 00409 // registerHeader << dec << std::endl; protocolInstance_->write(bufferElement, 00410 // STRIP_SC_CSR, registerHeader); protocolInstance_->waitClear(bufferElement, 00411 // STRIP_SC_CSR, 0x80000000); 00412 // 00413 // //alternateBuffer += bufferElement; 00414 // limitCount++; 00415 // singleVectorCount++; 00416 // 00417 // if (limitCount == STIB_DAC_WRITE_MAX) 00418 // { 00419 // std::cout << __COUT_HDR_FL__ << "\tBuffer lenght:" << bufferElement.size() 00420 // << std::endl; buffer.push_back(bufferElement); limitCount = 0; 00421 // bufferElement.clear(); 00422 // } 00423 // else if (singleVectorCount == rocDACs.getDACList().size()) //case for imcomplete 00424 // packet 00425 // { 00426 // buffer.push_back(bufferElement); 00427 // } 00428 // 00429 // //buffer.push_back(bufferElement); 00430 // //break; 00431 // } 00432 // std::cout << __COUT_HDR_FL__ << "\tDone making DAC Buffer" << std::endl; 00433 // 00434 //} 00435 // 00437 // void PSI46DigFirmware::makeMaskBuffer(std::string& buffer, unsigned int channel, 00438 // const ROCStream& rocStream) 00439 //{ 00440 // std::cout << __COUT_HDR_FL__ << "Making mask! " << std::endl; 00441 // makeMaskBuffer(buffer, channel, rocStream, "Kill"); 00442 // // makeMaskSequence(buffer, channel, rocStream, "Inject"); 00443 //} 00444 // 00446 // void PSI46DigFirmware::makeMaskBuffer(std::string& buffer, unsigned int channel, const 00447 // ROCStream& rocStream, const std::string& registerName) 00448 //{ 00449 // std::cout << __COUT_HDR_FL__ << "\tMaking mask! " << std::endl; 00450 // int chipId = rocStream.getFEWROCAddress(); 00451 // std::string mask = rocStream.getROCMask(); 00452 // std::cout << __COUT_HDR_FL__ << "\tMask length: " << mask.length() << std::endl; 00453 // 00454 // unsigned int data[4] = { 0, 0, 0, 0 }; 00455 // 00456 // char val; 00457 // //int j = 0; 00458 // for (unsigned int d = 0; d < 4; d++) 00459 // { //d goes from 0 to 4. 4 bytes 00460 // //std::cout << __COUT_HDR_FL__ << "---------------------" << d << 00461 // "-------------------" << std::endl; for (unsigned int m = 0; m < 8 * 4; m++) { 00462 // //m goes from 0 to 31, since each byte has 8 bits, there are 32 bits 00463 // val = mask[(8 * 4 * d) + m]; //assigns to val the value of the corresponding 00464 // bit. 0-31, 32-63, 64-95, 96-127. it goes through each of the 128 bits 00465 // //std::cout << __COUT_HDR_FL__ << "---------------------" << j++ << 00466 // std::endl; 00467 // //std::cout << __COUT_HDR_FL__ << "data[" << d << "] before: " << hex << 00468 // data[d] << dec << std::endl; data[d] |= (unsigned int) atoi(&val) << (8 * 4 00469 // - 1 - m); 00470 // //std::cout << __COUT_HDR_FL__ << "(unsigned int) atoi(&val): " << (unsigned 00471 // int) atoi(&val) << std::endl; 00472 // //std::cout << __COUT_HDR_FL__ << "data[" << d << "] after: " << hex << 00473 // data[d] << dec << std::endl; 00474 // //std::cout << __COUT_HDR_FL__ << hex << "D: " << data[d] << " Val: " << 00475 // (unsigned int)atoi(&val) << " index: " << dec << (8*4-1-m) << " bit: " << 00476 // mask[(8*4*d)+m] << dec << std::endl; 00477 // } 00478 // // 00479 // } 00480 // 00481 // int i, ierr; 00482 // unsigned int w; 00483 // unsigned char len = 4; 00484 // unsigned char addr = 17;//Kill 00485 // unsigned char bitMask = 1 << channel; 00486 // unsigned char inst = WRITE; 00487 // 00488 // protocolInstance_->waitClear(buffer, STRIP_SC_CSR, 0x80000000); 00489 // 00490 // for (i = 0; i < 4; i++) 00491 // //write(buffer, STRIP_SCI + 4 * i, data[i]); 00492 // protocolInstance_->write(buffer, STRIP_SCI + 4 * (4 - i - 1), data[i]); 00493 // 00494 // w = 0x80000000 | (len << 24) | (bitMask << 16) | (inst << 10) | (addr << 5) | 00495 // chipId; 00496 // 00497 // ierr = protocolInstance_->write(buffer, STRIP_SC_CSR, w); 00498 // 00499 // protocolInstance_->waitClear(buffer, STRIP_SC_CSR, 0x80000000); 00500 //} 00501 // 00503 // void PSI46DigFirmware::makeMaskSequence(FirmwareSequence<uint64_t>& sequence, 00504 // unsigned int channel, const ROCStream& rocStream) 00505 //{ 00506 // std::cout << __COUT_HDR_FL__ << "Making mask! " << std::endl; 00507 // makeMaskSequence(sequence, channel, rocStream, "Kill"); 00508 // // makeMaskSequence(sequence, channel, rocStream, "Inject"); 00509 //} 00510 // 00512 // void PSI46DigFirmware::makeMaskSequence(FirmwareSequence<uint32_t>& sequence, 00513 // unsigned int channel, const ROCStream& rocStream) 00514 //{ 00515 // std::cout << __COUT_HDR_FL__ << "Making mask! " << std::endl; 00516 // makeMaskSequence(sequence, channel, rocStream, "Kill"); 00517 // // makeMaskSequence(channel,rocStream,sequence,"Inject"); 00518 //} 00519 // 00521 // void PSI46DigFirmware::makeMaskSequence(FirmwareSequence<uint64_t>& sequence, 00522 // unsigned int channel, const ROCStream& rocStream, 00523 // const std::string& registerName) 00524 //{ 00525 // int chipId = rocStream.getFEWROCAddress();//9, 14 or 21 bcast 00526 // std::string mask = rocStream.getROCMask(); 00527 // std::cout << __COUT_HDR_FL__ << "Mask length: " << mask.length() << std::endl; 00528 // 00529 // uint64_t uInt64Data = 0; 00530 // std::string stringData = ""; 00531 // 00532 // //have to manually set every bit for mask writes. 00533 // //reset fifo 00534 // //download every bit (shift_in and shift_ctrl) to fifo (setup muxes and control 00535 // lines) 00536 // //configure muxes for readout 00537 // //commence readout 00538 // 00539 // //FIFO Controls - byte 5 (7:0) 00540 // //7 - FIFO Clock 00541 // //6 - Shift Ctrl bit 00542 // //MASK_CELL_H - Shift In bit 00543 // //MUX Controls - byte 0 (7:0) 00544 // //7 - Read En/Output MUX sel (1 for masks) 00545 // //1 - Write En for mux 00546 // //0 - Reset Fifo 00547 // 00548 // //reset fifo 00549 // BitManipulator::insertBits(uInt64Data, 0x1, 56, 8); 00550 // sequence.pushBack(ChannelFIFOAddress[channel], uInt64Data); 00551 // 00552 // //configure fifo for write 00553 // BitManipulator::insertBits(uInt64Data, 0x2, 56, 8); 00554 // sequence.pushBack(ChannelFIFOAddress[channel], uInt64Data); 00555 // 00556 // //Download every bit (shift_in and shift_control) to fifo (setup muxes and control 00557 // lines) 00558 // //Bit 7 of data is FIFO clock, bit 6 is shift_control, bit 5 is shift_in 00559 // //start bits (ctrl 0, data 0 => ctrl 1, data 0) 00560 // 00561 // BitManipulator::insertBits(uInt64Data, 0x40, 16, 8);//(0<<7) | (1<<6) | (0<<5) 00562 // sequence.pushBack(ChannelFIFOAddress[channel], uInt64Data); 00563 // BitManipulator::insertBits(uInt64Data, 0xc0, 16, 8);//(1<<7) | (1<<6) | (0<<5) -> 00564 // clock the data in the fifo sequence.pushBack(ChannelFIFOAddress[channel], 00565 // uInt64Data); 00566 // 00567 // stringData = PSI46DigROCDefinitions::makeMaskWriteCommand(chipId, 00568 // registerName, mask); 00569 // 00570 // uint8_t data; 00571 // for (unsigned int s = 0; s < stringData.length(); s++) 00572 // for (int b = 8 - 1; b >= 0 && (s * 8 + 8 - b < 13 + 128); b--) 00573 // { 00574 // //std::cout << __COUT_HDR_FL__ << "S: " << s << " val: " << 00575 // std::stringData.data()[s] << " b: " << b << " bit: " << 00576 // ((stringData.data()[s]>>b)&1) << std::endl; data = 0x40 | 00577 // (((stringData.data()[s] >> b) & 1) << 5); 00578 // BitManipulator::insertBits(uInt64Data, (uint64_t) data, 16, 8); 00579 // sequence.pushBack(ChannelFIFOAddress[channel], uInt64Data); 00580 // data |= 0x80; 00581 // BitManipulator::insertBits(uInt64Data, (uint64_t) data, 16, 8); 00582 // sequence.pushBack(ChannelFIFOAddress[channel], uInt64Data); 00583 // } 00584 // 00585 // //reset Shift Control 00586 // BitManipulator::insertBits(uInt64Data, 0x0, 16, 8); 00587 // sequence.pushBack(ChannelFIFOAddress[channel], uInt64Data); 00588 // BitManipulator::insertBits(uInt64Data, 0x80, 16, 8); 00589 // sequence.pushBack(ChannelFIFOAddress[channel], uInt64Data); 00590 // 00591 // //configure muxes for readout 00592 // BitManipulator::insertBits(uInt64Data, 0x0, 56, 8); 00593 // sequence.pushBack(ChannelFIFOAddress[channel], uInt64Data); 00594 // 00595 // //commence readout 00596 // BitManipulator::insertBits(uInt64Data, 0x80, 56, 8); 00597 // sequence.pushBack(ChannelFIFOAddress[channel], uInt64Data); 00598 // 00599 //} 00600 // 00602 // void PSI46DigFirmware::makeMaskSequence(FirmwareSequence<uint32_t>& sequence, 00603 // unsigned int channel, const ROCStream& rocStream, 00604 // const std::string& registerName) 00605 //{} 00606 // 00608 // std::string PSI46DigFirmware::readCSRRegister() 00609 //{ 00610 // std::string buffer; 00611 // read(buffer,STRIP_CSR); 00612 // return buffer; 00613 //} 00614 // 00616 // void PSI46DigFirmware::setFrequencyFromClockState(std::string& buffer, double 00617 // frequency) 00618 //{ 00619 // std::cout << __COUT_HDR_FL__ << "Setting up clock frequency!!!" << std::endl; 00620 // 00621 // int quotient; 00622 // int numerator; 00623 // int denominator; 00624 // double realClockFrequency; 00625 // 00626 // if (BitManipulator::readBits(stripCSRRegisterValue_, 17, 1) == 1) //if fastBCO is 00627 // enabled 00628 // quotient = 4; 00629 // else //normal cases 00630 // quotient = 8; 00631 // 00632 // if (isClockStateExternal()) //base freq: 54MHz 00633 // { 00634 // realClockFrequency = EXTERNAL_CLOCK_FREQUENCY / quotient; //this is the REAL 00635 // frequency being used 00636 // } 00637 // else //base freq: 66.667MHz 00638 // { 00639 // realClockFrequency = INTERNAL_CLOCK_FREQUENCY / quotient; //this is the REAL 00640 // frequency being used 00641 // } 00642 // 00643 // double factor = frequency / realClockFrequency; 00644 // 00645 // //The device needs the denominator and the denominator to be load into a 5 bit 00646 // register 00647 // //It will take two initial numerator and denominator bigger than necessary (to do 00648 // not loose precision) 00649 // //and divide them for their gcd. If they still do not fit in 5 bit, they are trunked 00650 // (divided by 2) 00651 // //untill they are less than 32 00652 // numerator = factor * 100; //we will work with 2 digits precision after the decimal 00653 // point denominator = 100; 00654 // 00655 // do 00656 // { 00657 // //We will need the GCD at some point in order to simplify fractions //taken from 00658 // other sources int gcd = numerator; int rest = denominator; int tmp; 00659 // 00660 // while (rest != 0) 00661 // { 00662 // tmp = rest; 00663 // rest = gcd % tmp; 00664 // gcd = tmp; 00665 // } 00666 // //Done finding the GCD 00667 // 00668 // if (gcd == 1) //if there's no GCD, just divide by 2 to find the nearest 00669 // approssimation with less bits 00670 // { 00671 // numerator /= 2; 00672 // denominator /= 2; 00673 // } 00674 // else 00675 // { 00676 // numerator /= gcd; 00677 // denominator /= gcd; 00678 // } 00679 // 00680 // } 00681 // while (denominator >= 32 || numerator >= 32); 00682 // std::cout << __COUT_HDR_FL__ << "Numerator: " << numerator << std::endl; 00683 // std::cout << __COUT_HDR_FL__ << "Denominator: " << denominator << std::endl; 00684 // setFrequencyRatio(buffer, numerator, denominator); 00685 // std::cout << __COUT_HDR_FL__ << "Done with clock frequency setup!!!" << std::endl; 00686 //} 00688 // bool PSI46DigFirmware::isClockStateExternal() //returns true if the clock state is 00689 // External 00690 //{ 00691 // if (BitManipulator::readBits(stripCSRRegisterValue_, 16, 1) == 1) 00692 // return true; 00693 // else 00694 // return false; 00695 //} 00696 // 00698 // void PSI46DigFirmware::setCSRRegister(uint32_t total) 00699 //{ 00700 // stripCSRRegisterValue_ = total; 00701 //} 00702 // 00704 // void PSI46DigFirmware::setPacketSizeStripCSR(uint32_t size) 00705 //{ 00706 // if (size > 31) 00707 // std::cout << __COUT_HDR_FL__ 00708 // << "ERROR: Maximum packet size is 31 while here you are trying to set " 00709 // << size << " packets!" << std::endl; 00710 // BitManipulator::insertBits(stripCSRRegisterValue_, size, 3, 5); 00711 // //write(buffer,STRIP_CSR, stripSCRRegisterValue_); 00712 //} 00713 // 00715 // void PSI46DigFirmware::enableChannelsStripCSR(bool channel0, bool channel1, 00716 // bool channel2, bool channel3, bool channel4, bool channel5) 00717 //{ 00718 // BitManipulator::insertBits(stripCSRRegisterValue_, ((uint32_t) channel0) 00719 // + ((uint32_t) channel1 << 1) + ((uint32_t) channel2 << 00720 // 2) 00721 // + ((uint32_t) channel3 << 3) + ((uint32_t) channel4 << 00722 // 4) 00723 // + ((uint32_t) channel5 << 5), 8, 6); 00724 //} 00725 // 00727 // void PSI46DigFirmware::setExternalBCOClockSourceStripCSR(std::string clockSource) 00728 //{ 00729 // if (clockSource == "External") 00730 // BitManipulator::insertBits(stripCSRRegisterValue_, 1, 16, 1); 00731 // else if (clockSource == "Internal") 00732 // BitManipulator::insertBits(stripCSRRegisterValue_, 0, 16, 1); 00733 //} 00734 // 00736 // void PSI46DigFirmware::setHaltStripCSR(bool set) 00737 //{ 00738 // BitManipulator::insertBits(stripCSRRegisterValue_, (uint32_t) set, 17, 1); 00739 //} 00740 // 00742 // void PSI46DigFirmware::enableBCOStripCSR(bool enable) 00743 //{ 00744 // BitManipulator::insertBits(stripCSRRegisterValue_, (uint32_t) enable, 19, 1); 00745 //} 00746 // 00748 // void PSI46DigFirmware::flushBuffersStripCSR(void) 00749 //{ 00750 // BitManipulator::insertBits(stripCSRRegisterValue_, 1, 20, 1); 00751 //} 00752 // 00754 // void PSI46DigFirmware::resetTriggerCounterStripCSR(std::string& buffer) 00755 //{ 00756 // BitManipulator::insertBits(stripCSRRegisterValue_, 1, 21, 1); 00757 // protocolInstance_->write(buffer, STRIP_CSR, stripCSRRegisterValue_); 00758 // 00759 // BitManipulator::insertBits(stripCSRRegisterValue_, 0, 21, 1); 00760 // protocolInstance_->write(buffer, STRIP_CSR, stripCSRRegisterValue_); 00761 //} 00762 // 00764 // void PSI46DigFirmware::resetBCOCounterStripCSR(void) 00765 //{ 00766 // BitManipulator::insertBits(stripCSRRegisterValue_, 1, 22, 1); 00767 //} 00768 // 00770 // void PSI46DigFirmware::enableTriggerStripCSR(bool enable) 00771 //{ 00772 // BitManipulator::insertBits(stripCSRRegisterValue_, (uint32_t) enable, 23, 1); 00773 //} 00774 // 00776 // void PSI46DigFirmware::sendTriggerDataStripCSR(bool send) 00777 //{ 00778 // BitManipulator::insertBits(stripCSRRegisterValue_, (uint32_t) send, 24, 1); 00779 //} 00780 // 00782 // void PSI46DigFirmware::sendTriggerNumberStripCSR(bool send) 00783 //{ 00784 // BitManipulator::insertBits(stripCSRRegisterValue_, (uint32_t) send, 25, 1); 00785 //} 00786 // 00788 // void PSI46DigFirmware::sendBCOStripCSR(bool send) 00789 //{ 00790 // BitManipulator::insertBits(stripCSRRegisterValue_, (uint32_t) send, 26, 1); 00791 //} 00792 // 00794 // void PSI46DigFirmware::enableStreamStripCSR(bool enable) 00795 //{ 00796 // BitManipulator::insertBits(stripCSRRegisterValue_, (uint32_t) enable, 27, 1); 00797 //} 00798 // 00800 // void PSI46DigFirmware::resetDCMStripCSR(bool clear) 00801 //{ 00802 // BitManipulator::insertBits(stripCSRRegisterValue_, (uint32_t) clear, 31, 1); 00803 //} 00804 // 00806 // uint32_t PSI46DigFirmware::waitDCMResetStripCSR(void) 00807 //{ 00808 // uint32_t bitToCheck = 0; 00809 // BitManipulator::insertBits(bitToCheck, 1, 31, 2); 00810 // return bitToCheck; 00811 //} 00812 // 00814 // void PSI46DigFirmware::resetDAC(void) 00815 //{ 00816 // BitManipulator::insertBits(stripResetRegisterValue_, 1, 27, 1); 00817 //} 00818 // 00820 // void PSI46DigFirmware::resetLink(bool channel0, bool channel1, bool channel2, 00821 // bool channel3, bool channel4, bool channel5) 00822 //{ 00823 // stripResetRegisterValue_ = 0; 00824 // BitManipulator::insertBits(stripResetRegisterValue_, 00825 // ((uint32_t) channel0) + ((uint32_t) channel1 << 1) 00826 // + ((uint32_t) channel2 << 2) + ((uint32_t) channel3 << 00827 // 3) 00828 // + ((uint32_t) channel4 << 4) + ((uint32_t) channel5 << 00829 // 5), 0, 6); 00830 // BitManipulator::insertBits(stripResetRegisterValue_, 1, 29, 1); 00831 // /* 00832 // write(buffer, STRIP_RESET, (1<<28) + 00833 // ((uint32_t)channel0) + 00834 // ((uint32_t)channel1<<1) + 00835 // ((uint32_t)channel2<<2) + 00836 // ((uint32_t)channel3<<3) + 00837 // ((uint32_t)channel4<<4) + 00838 // ((uint32_t)channel5<<5) 00839 // ); 00840 // */ 00841 //} 00842 // 00844 // void PSI46DigFirmware::clearErrors(bool channel0, bool channel1, bool channel2, 00845 // bool channel3, bool channel4, bool channel5) 00846 //{ 00847 // stripResetRegisterValue_ = 0; 00848 // BitManipulator::insertBits(stripResetRegisterValue_, 00849 // ((uint32_t) channel0) + ((uint32_t) channel1 << 1) 00850 // + ((uint32_t) channel2 << 2) + ((uint32_t) channel3 << 00851 // 3) 00852 // + ((uint32_t) channel4 << 4) + ((uint32_t) channel5 << 00853 // 5), 0, 6); 00854 // BitManipulator::insertBits(stripResetRegisterValue_, 1, 29, 1); 00855 //} 00856 // 00858 // void PSI46DigFirmware::clearFIFO(bool channel0, bool channel1, bool channel2, 00859 // bool channel3, bool channel4, bool channel5) 00860 //{ 00861 // stripResetRegisterValue_ = 0; 00862 // BitManipulator::insertBits(stripResetRegisterValue_, 00863 // ((uint32_t) channel0) + ((uint32_t) channel1 << 1) 00864 // + ((uint32_t) channel2 << 2) + ((uint32_t) channel3 << 00865 // 3) 00866 // + ((uint32_t) channel4 << 4) + ((uint32_t) channel5 << 00867 // 5), 0, 6); 00868 // BitManipulator::insertBits(stripResetRegisterValue_, 1, 30, 1); 00869 //} 00870 // 00872 // void PSI46DigFirmware::resetChip(bool channel0, bool channel1, bool channel2, 00873 // bool channel3, bool channel4, bool channel5) 00874 //{ 00875 // stripResetRegisterValue_ = 0; 00876 // BitManipulator::insertBits(stripResetRegisterValue_, 00877 // ((uint32_t) channel0) + ((uint32_t) channel1 << 1) 00878 // + ((uint32_t) channel2 << 2) + ((uint32_t) channel3 << 00879 // 3) 00880 // + ((uint32_t) channel4 << 4) + ((uint32_t) channel5 << 00881 // 5), 0, 6); 00882 // BitManipulator::insertBits(stripResetRegisterValue_, 1, 31, 1); 00883 //} 00884 // 00886 // void PSI46DigFirmware::setFrequencyRatio(std::string& buffer, int numerator, int 00887 // denominator) 00888 //{ 00889 // //The device need to load numerator minus one and denominator minus one, with an 00890 // internal address of 0x50 and 052 respectively protocolInstance_->write(buffer, 00891 // STRIP_BCO_DCM, 0x80500000 + (numerator - 1)); // Set BCOCLK numerator // was 00892 // 0x80500003 protocolInstance_->waitClear(buffer, STRIP_BCO_DCM, 0xf0000000); // Wait 00893 // DCM write to finish // was 0x80000000 00894 // 00895 // protocolInstance_->write(buffer, STRIP_BCO_DCM, 0x80520000 + (denominator - 1)); // 00896 // Set BCOCLK denominator // was 0x80520001 protocolInstance_->waitClear(buffer, 00897 // STRIP_BCO_DCM, 0xf0000000); // Wait DCM write to finish - BCO frequency should 00898 // be 13.513 MHz // was 0x80000000 00899 //} 00900 // 00902 // void PSI46DigFirmware::BCOOffset(uint32_t offset) 00903 //{ 00904 // BitManipulator::insertBits(stripTriggerCSRRegisterValue_, offset, 0, 4); 00905 //} 00906 // 00908 // void PSI46DigFirmware::selectSpyFIFO(uint32_t input) 00909 //{ 00910 // BitManipulator::insertBits(stripTriggerCSRRegisterValue_, input, 4, 3); 00911 //} 00912 // 00914 // void PSI46DigFirmware::halt(bool halt) 00915 //{ 00916 // BitManipulator::insertBits(stripTriggerCSRRegisterValue_, (uint32_t) halt, 7, 1); 00917 //} 00918 // 00920 // void PSI46DigFirmware::configureStripTriggerUnbiased(std::string& buffer) 00921 //{ 00922 // protocolInstance_->write(buffer, STRIP_TRIG_UNBIASED, 0x002805c); // Configure 00923 // unbiased trigger 00924 //} 00925 // 00927 // void PSI46DigFirmware::configureTriggerInputs(std::string& buffer) 00928 //{ 00929 // protocolInstance_->write(buffer, STRIP_TRIG_INPUT_0, 0x3f440000); // PSI46Dig 00930 // GOTHIT trigger input channel 0,1 protocolInstance_->write(buffer, 00931 // STRIP_TRIG_INPUT_1, 0x3f440000); // PSI46Dig GOTHIT trigger input channel 2,3 00932 // protocolInstance_->write(buffer, STRIP_TRIG_INPUT_2, 0x0); // PSI46Dig GOTHIT 00933 // trigger input channel 4,5 00934 //} 00935 // 00937 // //======================================================================================================================== 00938 // void PSI46DigFirmware::chipID(uint32_t size) 00939 // { 00940 // BitManipulator::insertBits(stripSCRegisterValue_, size, 0, 5); 00941 // } 00942 // 00943 // //======================================================================================================================== 00944 // void PSI46DigFirmware::addressSlowControls(uint32_t size) 00945 // { 00946 // BitManipulator::insertBits(stripSCRegisterValue_, size, 5, 5); 00947 // } 00948 // 00949 // //======================================================================================================================== 00950 // void PSI46DigFirmware::instructionSlowControls(uint32_t size) 00951 // { 00952 // BitManipulator::insertBits(stripSCRegisterValue_, size, 10, 3); 00953 // } 00954 // 00955 // //======================================================================================================================== 00956 // void PSI46DigFirmware::channelreadSelect(uint32_t size) 00957 // { 00958 // BitManipulator::insertBits(stripSCRegisterValue_, size, 13, 3); 00959 // } 00960 // 00961 // //======================================================================================================================== 00962 // void PSI46DigFirmware::channelMask(uint32_t size) 00963 // { 00964 // BitManipulator::insertBits(stripSCRegisterValue_, size, 16, 8); 00965 // } 00966 // 00967 // //======================================================================================================================== 00968 // void PSI46DigFirmware::bitsLength(uint32_t length) 00969 // { 00970 // BitManipulator::insertBits(stripSCRegisterValue_, length, 26, 3); 00971 // } 00972 // 00973 // 00974 // //======================================================================================================================== 00975 // void PSI46DigFirmware::syncFallingBCO(bool sync) 00976 // { 00977 // BitManipulator::insertBits(stripSCRegisterValue_, (uint32_t)sync, 28, 1); 00978 // } 00979 // 00980 // //======================================================================================================================== 00981 // void PSI46DigFirmware::syncRisingBCO(bool sync) 00982 // { 00983 // BitManipulator::insertBits(stripSCRegisterValue_, (uint32_t)sync, 29, 1); 00984 // } 00985 // 00986 // //======================================================================================================================== 00987 // void PSI46DigFirmware::setRaw(bool set) 00988 // { 00989 // BitManipulator::insertBits(stripSCRegisterValue_, (uint32_t)set, 30, 1); 00990 // } 00991 // 00992 // //======================================================================================================================== 00993 // void PSI46DigFirmware::initSlowControls(bool init) 00994 // { 00995 // BitManipulator::insertBits(stripSCRegisterValue_, (uint32_t)init, 31, 1); 00996 // } 00997 // 00998 // //======================================================================================================================== 00999 // void PSI46DigFirmware::resetCount(bool reset) 01000 // { 01001 // BitManipulator::insertBits(stripAnalysisCSRRegisterValue_, (uint32_t)reset, 30, 1); 01002 // } 01003 // 01004 // //======================================================================================================================== 01005 // void PSI46DigFirmware::setBCO_0(uint32_t void PSI46DigFirmware::BCOOffset(uint32_t 01006 // offset) 01007 // { 01008 // BitManipulator::insertBits(stripTrigCSRRegisterValue_, offset, 0, 4); 01009 // }input) 01010 // { 01011 // BitManipulator::insertBits(trigInputRegisterValue_, input, 0, 8); 01012 // } 01013 // 01014 // //======================================================================================================================== 01015 // void PSI46DigFirmware::setBCO_1(uint32_t input) 01016 // { 01017 // BitManipulator::insertBits(trigInputRegisterValue_, input, 8, 8); 01018 // } 01019 // 01020 // //======================================================================================================================== 01021 // void PSI46DigFirmware::trimFracBCO_0(uint32_t input) 01022 // { 01023 // BitManipulator::insertBits(trigInputRegisterValue_, input, 16, 4); 01024 // } 01025 // 01026 // //======================================================================================================================== 01027 // void PSI46DigFirmware::trimFracBCO_1(uint32_t input) 01028 // { 01029 // BitManipulator::insertBits(trigInputRegisterValue_, input, 20, 4); 01030 // } 01031 // 01032 // //======================================================================================================================== 01033 // void PSI46DigFirmware::enable_0(bool enable) 01034 // { 01035 // BitManipulator::insertBits(trigInputRegisterValue_, (uint32_t)enable, 28, 1); 01036 // } 01037 // 01038 // //======================================================================================================================== 01039 // void PSI46DigFirmware::enable_1(bool enable) 01040 // { 01041 // BitManipulator::insertBits(trigInputRegisterValue_, (uint32_t)enable, 29, 1); 01042 // } 01043 // 01044 // */ 01045 // 01046 // 01047 // 01048 // 01054 //#include "otsdaq-core/Macros/CoutMacros.h" 02244 //