#include <api.h>
Public Member Functions | |
pxarCore (std::string usbId="*", std::string logLevel="WARNING") | |
~pxarCore () | |
std::string | getVersion () |
bool | initTestboard (std::vector< std::pair< std::string, uint8_t > > sig_delays, std::vector< std::pair< std::string, double > > power_settings, std::vector< std::pair< std::string, uint8_t > > pg_setup) |
void | setTestboardPower (std::vector< std::pair< std::string, double > > power_settings) |
void | setTestboardDelays (std::vector< std::pair< std::string, uint8_t > > sig_delays) |
void | setPatternGenerator (std::vector< std::pair< std::string, uint8_t > > pg_setup) |
bool | initDUT (uint8_t hubId, std::string tbmtype, std::vector< std::vector< std::pair< std::string, uint8_t > > > tbmDACs, std::string roctype, std::vector< std::vector< std::pair< std::string, uint8_t > > > rocDACs, std::vector< std::vector< pixelConfig > > rocPixels, std::vector< uint8_t > rocI2Cs) |
bool | initDUT (uint8_t hubid, std::string tbmtype, std::vector< std::vector< std::pair< std::string, uint8_t > > > tbmDACs, std::string roctype, std::vector< std::vector< std::pair< std::string, uint8_t > > > rocDACs, std::vector< std::vector< pixelConfig > > rocPixels) |
bool | programDUT () |
bool | flashTB (std::string filename) |
double | getTBia () |
double | getTBva () |
double | getTBid () |
double | getTBvd () |
void | HVoff () |
void | HVon () |
void | Pon () |
void | Poff () |
bool | SignalProbe (std::string probe, std::string name) |
std::vector< uint16_t > | daqADC (std::string signal, uint8_t gain, uint16_t nSample, uint8_t source, uint8_t start) |
bool | setDAC (std::string dacName, uint8_t dacValue, uint8_t rocI2C) |
bool | setDAC (std::string dacName, uint8_t dacValue) |
uint8_t | getDACRange (std::string dacName) |
bool | setTbmReg (std::string regName, uint8_t regValue, uint8_t tbmid) |
bool | setTbmReg (std::string regName, uint8_t regValue) |
std::vector< std::pair < uint8_t, std::vector< pixel > > > | getPulseheightVsDAC (std::string dacName, uint8_t dacMin, uint8_t dacMax, uint16_t flags, uint16_t nTriggers) |
std::vector< std::pair < uint8_t, std::vector< pixel > > > | getPulseheightVsDAC (std::string dacName, uint8_t dacStep, uint8_t dacMin, uint8_t dacMax, uint16_t flags, uint16_t nTrigger) |
std::vector< std::pair < uint8_t, std::vector< pixel > > > | getEfficiencyVsDAC (std::string dacName, uint8_t dacMin, uint8_t dacMax, uint16_t flags, uint16_t nTriggers) |
std::vector< std::pair < uint8_t, std::vector< pixel > > > | getEfficiencyVsDAC (std::string dacName, uint8_t dacStep, uint8_t dacMin, uint8_t dacMax, uint16_t flags, uint16_t nTriggers) |
std::vector< std::pair < uint8_t, std::vector< pixel > > > | getThresholdVsDAC (std::string dacName, std::string dac2name, uint8_t dac2min, uint8_t dac2max, uint16_t flags, uint16_t nTriggers) |
std::vector< std::pair < uint8_t, std::vector< pixel > > > | getThresholdVsDAC (std::string dac1name, uint8_t dac1step, uint8_t dac1min, uint8_t dac1max, std::string dac2name, uint8_t dac2step, uint8_t dac2min, uint8_t dac2max, uint16_t flags, uint16_t nTriggers) |
std::vector< std::pair < uint8_t, std::vector< pixel > > > | getThresholdVsDAC (std::string dac1name, uint8_t dac1step, uint8_t dac1min, uint8_t dac1max, std::string dac2name, uint8_t dac2step, uint8_t dac2min, uint8_t dac2max, uint8_t threshold, uint16_t flags, uint16_t nTriggers) |
std::vector< std::pair < uint8_t, std::pair< uint8_t, std::vector< pixel > > > > | getPulseheightVsDACDAC (std::string dac1name, uint8_t dac1min, uint8_t dac1max, std::string dac2name, uint8_t dac2min, uint8_t dac2max, uint16_t flags, uint16_t nTriggers) |
std::vector< std::pair < uint8_t, std::pair< uint8_t, std::vector< pixel > > > > | getPulseheightVsDACDAC (std::string dac1name, uint8_t dac1step, uint8_t dac1min, uint8_t dac1max, std::string dac2name, uint8_t dac2step, uint8_t dac2min, uint8_t dac2max, uint16_t flags, uint16_t nTriggers) |
std::vector< std::pair < uint8_t, std::pair< uint8_t, std::vector< pixel > > > > | getEfficiencyVsDACDAC (std::string dac1name, uint8_t dac1min, uint8_t dac1max, std::string dac2name, uint8_t dac2min, uint8_t dac2max, uint16_t flags, uint16_t nTriggers) |
std::vector< std::pair < uint8_t, std::pair< uint8_t, std::vector< pixel > > > > | getEfficiencyVsDACDAC (std::string dac1name, uint8_t dac1step, uint8_t dac1min, uint8_t dac1max, std::string dac2name, uint8_t dac2step, uint8_t dac2min, uint8_t dac2max, uint16_t flags, uint16_t nTriggers) |
std::vector< pixel > | getPulseheightMap (uint16_t flags, uint16_t nTriggers) |
std::vector< pixel > | getEfficiencyMap (uint16_t flags, uint16_t nTriggers) |
std::vector< pixel > | getThresholdMap (std::string dacName, uint8_t dacStep, uint8_t dacMin, uint8_t dacMax, uint16_t flags, uint16_t nTriggers) |
std::vector< pixel > | getThresholdMap (std::string dacName, uint8_t dacStep, uint8_t dacMin, uint8_t dacMax, uint8_t threshold, uint16_t flags, uint16_t nTriggers) |
std::vector< pixel > | getThresholdMap (std::string dacName, uint16_t flags, uint16_t nTriggers) |
bool | setExternalClock (bool enable) |
void | setClockStretch (uint8_t src, uint16_t delay, uint16_t width) |
void | setSignalMode (std::string signal, uint8_t mode) |
bool | daqStart () |
bool | daqStart (const int bufsize, const bool init) |
bool | daqStatus () |
bool | daqStatus (uint8_t &perFull) |
Event | daqGetEvent () |
rawEvent | daqGetRawEvent () |
uint16_t | daqTrigger (uint32_t nTrig=1, uint16_t period=0) |
uint16_t | daqTriggerLoop (uint16_t period=1000) |
void | daqTriggerLoopHalt () |
bool | daqStop () |
bool | daqStop (const bool init) |
std::vector< rawEvent > | daqGetRawEventBuffer () |
std::vector< uint16_t > | daqGetBuffer () |
std::vector< Event > | daqGetEventBuffer () |
std::vector< std::vector < uint16_t > > | daqGetReadback () |
statistics | getStatistics () |
bool | status () |
uint16_t | GetADC (uint8_t rpc_par1) |
void | SetCalibrateBits (bool enable) |
Public Attributes | |
dut * | _dut |
pxar API class definition
this is the central API through which all calls from tests and user space functions have to be routed in order to interact with the hardware.
The API level aims to provide a set of high-level function from which the "user" (or test implementation) can choose. This approach allows to hide hardware specific functions and calls from the user space code and automatize e.g. startup procedures.
All input from user space is checked before programming it to the devices. Register addresses have an internal lookup mechanism so the user only hast to provide e.g. the DAC name to be programmed as a std::string.
Unless otherwise specified (some DAQ functions allow this) all data returned from API functions is fully decoded and stored in C++ structures using std::vectors and std::pairs to ease its handling. Most functions will return a std::vector containing pxar::pixel elements storing the readout data.
Another concept implemented is the Device Under Test (DUT) which is a class (pxar::dut) representing the attached hardware to be tested. In order to change its configuration the user space code interacts with the _dut object and alters its settings. This is programmed into the devices automatically before the next test is executed. This approach allows both the efficient execution of many RPC calls at once and reading back the actual device configuration at any time during the tests.
Calls to test functions are automatically expanded in a way that they cover the full device in the most efficient way available. Instead of scanning 4160 pixels after another the code will select the function to scan a full ROC in one go automatically.
pxarCore::pxarCore | ( | std::string | usbId = "*" , |
std::string | logLevel = "WARNING" |
||
) |
Default constructor for the libpxar API
Fetches a new pxar::hal instance and opens the connection to the testboard specified in the "usbId" parameter. An asterisk as "usbId" acts as wildcard. If only one DTB is connected the algorithm will automatically connect to this board, if several are connected it will give a warning.
On issues with the USB connection, a pxar::UsbConnectionError is thrown. If the firmware on the DTB does not match the expected version for pxar, a pxar::FirmwareVersionMismatch exception is thrown.
pxarCore::~pxarCore | ( | ) |
std::vector< uint16_t > pxarCore::daqGetBuffer | ( | ) |
Event pxarCore::daqGetEvent | ( | ) |
Function to read out the earliest pxar::Event in buffer from the current data acquisition session. If no Event is buffered, the function will wait for the next Event to arrive and then return it.
This function can throw a pxar::DataDecodingError exception in case severe problems were encountered during the readout.
std::vector< Event > pxarCore::daqGetEventBuffer | ( | ) |
Function to return the full currently available pxar::Event buffer from the testboard RAM. All data is decoded and the function returns decoded pixels separated in pxar::Events with additional header information available.
This function can throw a pxar::DataDecodingError exception in case severe problems were encountered during the readout.
rawEvent pxarCore::daqGetRawEvent | ( | ) |
std::vector< rawEvent > pxarCore::daqGetRawEventBuffer | ( | ) |
Function to return the full currently available raw event buffer from the testboard RAM. No decoding is performed, the data stream is just split into single pxar::rawEvent objects. This function returns the raw events from either of the deserializer modules.
std::vector< std::vector< uint16_t > > pxarCore::daqGetReadback | ( | ) |
Function to return the full currently available ROC slow readback value buffer. The data is stored until a new DAQ session or test is called and can be fetched once (deleted at read time). The return vector contains one vector of readback values for every ROC found in the readout chain.
bool pxarCore::daqStart | ( | ) |
Function to set up and initialize a new data acquisition session (DAQ). This function also programs all attached devices. Pixel configurations which are changed after calling this function will not be written to the devices, so make sure to mask/unmask and set test bits for all pixels in question before calling pxar::daqStart()!
bool pxarCore::daqStatus | ( | ) |
bool pxarCore::daqStatus | ( | uint8_t & | perFull | ) |
bool pxarCore::daqStop | ( | ) |
uint16_t pxarCore::daqTrigger | ( | uint32_t | nTrig = 1 , |
uint16_t | period = 0 |
||
) |
uint16_t pxarCore::daqTriggerLoop | ( | uint16_t | period = 1000 | ) |
void pxarCore::daqTriggerLoopHalt | ( | ) |
Function to halt the pattern generator loop which has been started using daqTriggerLoop(). This stops triggering the devices.
bool pxarCore::flashTB | ( | std::string | filename | ) |
uint8_t pxarCore::getDACRange | ( | std::string | dacName | ) |
std::vector< pixel > pxarCore::getEfficiencyMap | ( | uint16_t | flags, |
uint16_t | nTriggers | ||
) |
Method to get a map of the efficiency
Returns a vector of pixels, with the value of the pxar::pixel struct being the number of hits in that pixel. Efficiency == 1 for nhits == nTriggers
If the readout of the DTB is corrupt, a pxar::DataMissingEvent is thrown.
std::vector< std::pair< uint8_t, std::vector< pixel > > > pxarCore::getEfficiencyVsDAC | ( | std::string | dacName, |
uint8_t | dacMin, | ||
uint8_t | dacMax, | ||
uint16_t | flags, | ||
uint16_t | nTriggers | ||
) |
Method to scan a DAC range and measure the efficiency
Returns a vector of pairs containing set dac value and pixels, with the value of the pxar::pixel struct being the number of hits in that pixel. Efficiency == 1 for nhits == nTriggers
If the readout of the DTB is corrupt, a pxar::DataMissingEvent is thrown.
std::vector< std::pair< uint8_t, std::vector< pixel > > > pxarCore::getEfficiencyVsDAC | ( | std::string | dacName, |
uint8_t | dacStep, | ||
uint8_t | dacMin, | ||
uint8_t | dacMax, | ||
uint16_t | flags, | ||
uint16_t | nTriggers | ||
) |
Method to scan a DAC range and measure the efficiency
Returns a vector of pairs containing set dac value and pixels, with the value of the pxar::pixel struct being the number of hits in that pixel. Efficiency == 1 for nhits == nTriggers The dacStep parameter can be used to set the increment of the DAC scan, i.e. only sparsely scanning every nth DAC.
If the readout of the DTB is corrupt, a pxar::DataMissingEvent is thrown.
std::vector< std::pair< uint8_t, std::pair< uint8_t, std::vector< pixel > > > > pxarCore::getEfficiencyVsDACDAC | ( | std::string | dac1name, |
uint8_t | dac1min, | ||
uint8_t | dac1max, | ||
std::string | dac2name, | ||
uint8_t | dac2min, | ||
uint8_t | dac2max, | ||
uint16_t | flags, | ||
uint16_t | nTriggers | ||
) |
Method to scan a 2D DAC-Range (DAC1 vs. DAC2) and measure the efficiency
Returns a vector containing pairs of DAC1 values and pais of DAC2 values with a pxar::pixel vector. The value of the pxar::pixel struct is the number of hits in that pixel. Efficiency == 1 for nhits == nTriggers
If the readout of the DTB is corrupt, a pxar::DataMissingEvent is thrown.
std::vector< std::pair< uint8_t, std::pair< uint8_t, std::vector< pixel > > > > pxarCore::getEfficiencyVsDACDAC | ( | std::string | dac1name, |
uint8_t | dac1step, | ||
uint8_t | dac1min, | ||
uint8_t | dac1max, | ||
std::string | dac2name, | ||
uint8_t | dac2step, | ||
uint8_t | dac2min, | ||
uint8_t | dac2max, | ||
uint16_t | flags, | ||
uint16_t | nTriggers | ||
) |
Method to scan a 2D DAC-Range (DAC1 vs. DAC2) and measure the efficiency
Returns a vector containing pairs of DAC1 values and pais of DAC2 values with a pxar::pixel vector. The value of the pxar::pixel struct is the number of hits in that pixel. Efficiency == 1 for nhits == nTriggers The dacStep parameters can be used to set the increment of the DAC scan, i.e. only sparsely scanning every nth DAC. Increment can be set independently for both scanning dimensions.
If the readout of the DTB is corrupt, a pxar::DataMissingEvent is thrown.
std::vector< pixel > pxarCore::getPulseheightMap | ( | uint16_t | flags, |
uint16_t | nTriggers | ||
) |
Method to get a map of the pulse height
Returns a vector of pixels, with the value of the pxar::pixel struct being the averaged pulse height over "nTriggers" triggers
If the readout of the DTB is corrupt, a pxar::DataMissingEvent is thrown.
std::vector< std::pair< uint8_t, std::vector< pixel > > > pxarCore::getPulseheightVsDAC | ( | std::string | dacName, |
uint8_t | dacMin, | ||
uint8_t | dacMax, | ||
uint16_t | flags, | ||
uint16_t | nTriggers | ||
) |
Method to scan a DAC range and measure the pulse height
Returns a vector of pairs containing set dac value and a pxar::pixel vector, with the value of the pxar::pixel struct being the averaged pulse height over "nTriggers" triggers.
If the readout of the DTB is corrupt, a pxar::DataMissingEvent is thrown.
std::vector< std::pair< uint8_t, std::vector< pixel > > > pxarCore::getPulseheightVsDAC | ( | std::string | dacName, |
uint8_t | dacStep, | ||
uint8_t | dacMin, | ||
uint8_t | dacMax, | ||
uint16_t | flags, | ||
uint16_t | nTrigger | ||
) |
Method to scan a DAC range and measure the pulse height
Returns a vector of pairs containing set dac value and a pxar::pixel vector, with the value of the pxar::pixel struct being the averaged pulse height over "nTriggers" triggers. The dacStep parameter can be used to set the increment of the DAC scan, i.e. only sparsely scanning every nth DAC.
If the readout of the DTB is corrupt, a pxar::DataMissingEvent is thrown.
std::vector< std::pair< uint8_t, std::pair< uint8_t, std::vector< pixel > > > > pxarCore::getPulseheightVsDACDAC | ( | std::string | dac1name, |
uint8_t | dac1min, | ||
uint8_t | dac1max, | ||
std::string | dac2name, | ||
uint8_t | dac2min, | ||
uint8_t | dac2max, | ||
uint16_t | flags, | ||
uint16_t | nTriggers | ||
) |
Method to scan a 2D DAC-Range (DAC1 vs. DAC2) and measure the pulse height
Returns a vector containing pairs of DAC1 values and pais of DAC2 values with a pxar::pixel vector. The value of the pxar::pixel struct is the averaged pulse height over "nTriggers" triggers.
If the readout of the DTB is corrupt, a pxar::DataMissingEvent is thrown.
std::vector< std::pair< uint8_t, std::pair< uint8_t, std::vector< pixel > > > > pxarCore::getPulseheightVsDACDAC | ( | std::string | dac1name, |
uint8_t | dac1step, | ||
uint8_t | dac1min, | ||
uint8_t | dac1max, | ||
std::string | dac2name, | ||
uint8_t | dac2step, | ||
uint8_t | dac2min, | ||
uint8_t | dac2max, | ||
uint16_t | flags, | ||
uint16_t | nTriggers | ||
) |
Method to scan a 2D DAC-Range (DAC1 vs. DAC2) and measure the pulse height
Returns a vector containing pairs of DAC1 values and pais of DAC2 values with a pxar::pixel vector. The value of the pxar::pixel struct is the averaged pulse height over "nTriggers" triggers. The dacStep parameters can be used to set the increment of the DAC scan, i.e. only sparsely scanning every nth DAC. Increment can be set independently for both scanning dimensions.
If the readout of the DTB is corrupt, a pxar::DataMissingEvent is thrown.
statistics pxarCore::getStatistics | ( | ) |
Function that returns a class object of the type pxar::statistics containing all collected error statistics from the last (non-raw) DAQ readout or API test call. Statistics can be fetched once and are then reset.
double pxarCore::getTBia | ( | ) |
double pxarCore::getTBid | ( | ) |
double pxarCore::getTBva | ( | ) |
double pxarCore::getTBvd | ( | ) |
std::vector< pixel > pxarCore::getThresholdMap | ( | std::string | dacName, |
uint8_t | dacStep, | ||
uint8_t | dacMin, | ||
uint8_t | dacMax, | ||
uint16_t | flags, | ||
uint16_t | nTriggers | ||
) |
Method to get a map of the pixel threshold
Returns a vector of pixels, with the value of the pxar::pixel struct being the threshold value of that pixel.
This function allows to specify a range for the threshold DAC to be searched, this can be used to speed up the procedure by limiting the range. The dacStep parameter can be used to set the increment of the DAC scan, i.e. only sparsely scanning every nth DAC. The threshold value returned is the lower bound (upper bound for FLAG_RISING_EDGE) of the interval in which the true threshold is found.
The threshold is calculated as the 0.5 value of the s-curve of the pixel.
If the readout of the DTB is corrupt, a pxar::DataMissingEvent is thrown.
std::vector< pixel > pxarCore::getThresholdMap | ( | std::string | dacName, |
uint8_t | dacStep, | ||
uint8_t | dacMin, | ||
uint8_t | dacMax, | ||
uint8_t | threshold, | ||
uint16_t | flags, | ||
uint16_t | nTriggers | ||
) |
Method to get a map of the pixel threshold
Returns a vector of pixels, with the value of the pxar::pixel struct being the threshold value of that pixel.
This function allows to specify a range for the threshold DAC to be searched, this can be used to speed up the procedure by limiting the range. The dacStep parameter can be used to set the increment of the DAC scan, i.e. only sparsely scanning every nth DAC. The threshold value returned is the lower bound (upper bound for FLAG_RISING_EDGE) of the interval in which the true threshold is found.
The threshold can be adjusted to a percentage of efficienciy (i.e. threshold = 50 is the 50% efficiency niveau of the pixel).
If the readout of the DTB is corrupt, a pxar::DataMissingEvent is thrown.
std::vector< pixel > pxarCore::getThresholdMap | ( | std::string | dacName, |
uint16_t | flags, | ||
uint16_t | nTriggers | ||
) |
Method to get a map of the pixel threshold
Returns a vector of pixels, with the value of the pxar::pixel struct being the threshold value of that pixel.
The threshold is calculated as the 0.5 value of the s-curve of the pixel.
If the readout of the DTB is corrupt, a pxar::DataMissingEvent is thrown.
std::vector< std::pair< uint8_t, std::vector< pixel > > > pxarCore::getThresholdVsDAC | ( | std::string | dacName, |
std::string | dac2name, | ||
uint8_t | dac2min, | ||
uint8_t | dac2max, | ||
uint16_t | flags, | ||
uint16_t | nTriggers | ||
) |
Method to scan a DAC range and measure the pixel threshold
Returns a vector of pairs containing set dac value and pixels, with the value of the pxar::pixel struct being the threshold value of that pixel.
The threshold is calculated as the 0.5 value of the s-curve of the pixel.
If the readout of the DTB is corrupt, a pxar::DataMissingEvent is thrown.
std::vector< std::pair< uint8_t, std::vector< pixel > > > pxarCore::getThresholdVsDAC | ( | std::string | dac1name, |
uint8_t | dac1step, | ||
uint8_t | dac1min, | ||
uint8_t | dac1max, | ||
std::string | dac2name, | ||
uint8_t | dac2step, | ||
uint8_t | dac2min, | ||
uint8_t | dac2max, | ||
uint16_t | flags, | ||
uint16_t | nTriggers | ||
) |
Method to scan a DAC range and measure the pixel threshold
Returns a vector of pairs containing set dac value and pixels, with the value of the pxar::pixel struct being the threshold value of that pixel.
This function allows to specify a range for the threshold DAC to be searched, this can be used to speed up the procedure by limiting the range. The dacstep parameters can be used to set the increments of the 2D DAC scan, i.e. only sparsely scanning every nth DAC. The threshold value returned is the lower bound (upper bound for FLAG_RISING_EDGE) of the interval in which the true threshold is found. The increment can be set independently for both scanning dimensions.
The threshold is calculated as the 0.5 value of the s-curve of the pixel.
If the readout of the DTB is corrupt, a pxar::DataMissingEvent is thrown.
std::vector< std::pair< uint8_t, std::vector< pixel > > > pxarCore::getThresholdVsDAC | ( | std::string | dac1name, |
uint8_t | dac1step, | ||
uint8_t | dac1min, | ||
uint8_t | dac1max, | ||
std::string | dac2name, | ||
uint8_t | dac2step, | ||
uint8_t | dac2min, | ||
uint8_t | dac2max, | ||
uint8_t | threshold, | ||
uint16_t | flags, | ||
uint16_t | nTriggers | ||
) |
Method to scan a DAC range and measure the pixel threshold
Returns a vector of pairs containing set dac value and pixels, with the value of the pxar::pixel struct being the threshold value of that pixel.
This function allows to specify a range for the threshold DAC to be searched, this can be used to speed up the procedure by limiting the range. The dacstep parameters can be used to set the increments of the 2D DAC scan, i.e. only sparsely scanning every nth DAC. The threshold value returned is the lower bound (upper bound for FLAG_RISING_EDGE) of the interval in which the true threshold is found. The increment can be set independently for both scanning dimensions.
The threshold can be adjusted to a percentage of efficienciy (i.e. threshold = 50 is the 50% efficiency niveau of the pixel).
If the readout of the DTB is corrupt, a pxar::DataMissingEvent is thrown.
std::string pxarCore::getVersion | ( | ) |
Returns the version string for the pxar API.
When using a git checkout the version number will be calculated at compile time from the latest tagged version plus the number of commits on top of that. In this case the version number also contains the commit hash of the latest commit for reference.
In case of a tarball install the version number is hardcoded in the CMakeLists.txt file.
bool pxarCore::initDUT | ( | uint8_t | hubId, |
std::string | tbmtype, | ||
std::vector< std::vector< std::pair< std::string, uint8_t > > > | tbmDACs, | ||
std::string | roctype, | ||
std::vector< std::vector< std::pair< std::string, uint8_t > > > | rocDACs, | ||
std::vector< std::vector< pixelConfig > > | rocPixels, | ||
std::vector< uint8_t > | rocI2Cs | ||
) |
Initializer method for the DUT (attached devices)
This function requires the types and DAC settings for all TBMs and ROCs contained in the setup. All values will be checked for validity (DAC ranges, position and number of pixels, etc.) and an pxar::InvalidConfig exception is thrown if any errors are encountered.
All parameters are supplied via vectors, the size of the vector represents the number of devices. DAC names and device types should be provided as strings. The respective register addresses will be looked up internally. Strings are checked case-insensitive, old and new DAC names are both supported.
In case of USB communication problems, pxar::UsbConnectionError is thrown.
bool pxarCore::initDUT | ( | uint8_t | hubid, |
std::string | tbmtype, | ||
std::vector< std::vector< std::pair< std::string, uint8_t > > > | tbmDACs, | ||
std::string | roctype, | ||
std::vector< std::vector< std::pair< std::string, uint8_t > > > | rocDACs, | ||
std::vector< std::vector< pixelConfig > > | rocPixels | ||
) |
bool pxarCore::initTestboard | ( | std::vector< std::pair< std::string, uint8_t > > | sig_delays, |
std::vector< std::pair< std::string, double > > | power_settings, | ||
std::vector< std::pair< std::string, uint8_t > > | pg_setup | ||
) |
Initializer method for the testboard
Initializes the testboard with signal delay settings, and voltage/current limit settings (power_settings) and the initial pattern generator setup (pg_setup), all provided via vectors of pairs with descriptive name. The name lookup is performed via the central API dictionaries. Multiple pattern generator signals at once can be sent by separating their names with a semicolon.
All user inputs are checked for sanity. This includes range checks on the current limits set, a sanity check for the pattern generator command list (including a check for delay = 0 at the end of the list). If the settings are found to be out-of-range, a pxar::InvalidConfig exception is thrown.
In case of USB communication problems, pxar::UsbConnectionError is thrown.
bool pxarCore::programDUT | ( | ) |
Programming method for the DUT (attached devices)
This function requires the DUT structure to be filled (initialized).
All parameters are taken from the DUT struct, the enabled devices are programmed. This function needs to be called after power cycling the testboard output (using Poff, Pon).
A DUT flag is set which prevents test functions to be executed if not programmed.
void pxarCore::SetCalibrateBits | ( | bool | enable | ) |
Helper function to setup the attached devices for operation using calibrate pulses.
It sets the Pixel Unit Cell (PUC) Calibrate bit for every pixels enabled in the test range (those for which the "enable" flag has been set using the dut::testPixel() functions)
Disclaimer: use at your own risk, don't rely on this method staying public
void pxarCore::setClockStretch | ( | uint8_t | src, |
uint16_t | delay, | ||
uint16_t | width | ||
) |
bool pxarCore::setDAC | ( | std::string | dacName, |
uint8_t | dacValue, | ||
uint8_t | rocI2C | ||
) |
Set a DAC value on the DUT for one specific ROC
The "rocID" parameter can be used to select a specific ROC to program. The ROC is identified by its ID (counting all ROCs up from 0).
This function will both update the bookkeeping value in the pxar::dut struct and program the actual device.
bool pxarCore::setDAC | ( | std::string | dacName, |
uint8_t | dacValue | ||
) |
bool pxarCore::setExternalClock | ( | bool | enable | ) |
void pxarCore::setPatternGenerator | ( | std::vector< std::pair< std::string, uint8_t > > | pg_setup | ) |
Update method for testboard pattern generator. This method requires the testboard to be initialized once using pxar::initTestboard All user inputs are checked for sanity. This includes a full sanity check for the pattern generator command list, including a check for the total pattern length supplied as well as the delay = 0 at the end of the list. If the settings are found to be out-of-range, a pxar::InvalidConfig exception is thrown. The new settings are stored in the pxar::dut object for later reference. Multiple pattern generator signals at once can be sent by separating their names with a semicolon, e.g. "token;sync".
void pxarCore::setSignalMode | ( | std::string | signal, |
uint8_t | mode | ||
) |
bool pxarCore::setTbmReg | ( | std::string | regName, |
uint8_t | regValue, | ||
uint8_t | tbmid | ||
) |
Set a register value on a specific TBM of the DUT
The "tbmid" parameter can be used to select a specific TBM to program. This function will both update the bookkeeping value in the pxar::dut struct and program the actual device.
This function will set the respective register in the TBM core specified by the "tbmid". Be aware of the fact that TBM Alpha cores are numbered with even IDs (0,2,...) and TBM Beta cores with odd IDs (1,3,...).
bool pxarCore::setTbmReg | ( | std::string | regName, |
uint8_t | regValue | ||
) |
Set a register value on all TBMs of the DUT
This function will both update the bookkeeping value in the pxar::dut struct and program the actual device.
This function will set the respective register in the TBM core specified by the "tbmid". Be aware of the fact that TBM Alpha cores are numbered with even IDs (0,2,...) and TBM Beta cores with odd IDs (1,3,...).
void pxarCore::setTestboardDelays | ( | std::vector< std::pair< std::string, uint8_t > > | sig_delays | ) |
Update method for testboard signal delay settings. This method requires the testboard to be initialized once using pxar::initTestboard All user inputs are checked for sanity. This includes a register name lookup and range checks on the register values. If the settings are found to be out-of-range, a pxar::InvalidConfig exception is thrown. The new settings are stored in the pxar::dut object for later reference.
void pxarCore::setTestboardPower | ( | std::vector< std::pair< std::string, double > > | power_settings | ) |
Update method for testboard voltages and current limits. This method requires the testboard to be initialized once using pxar::initTestboard All user inputs are checked for sanity. This includes range checks on the current limits set. If the settings are found to be out-of-range, a pxar::InvalidConfig exception is thrown. The new settings are stored in the pxar::dut object for later reference.
bool pxarCore::SignalProbe | ( | std::string | probe, |
std::string | name | ||
) |
Selects "signal" as output for the DTB probe channel "probe" (digital or analog). Valid probe values are the names written on the case of the DTB, next to the respective outputs.
The signal identifier is checked against a dictionary to be valid. In case of an invalid signal identifier the output is turned off.
bool pxarCore::status | ( | ) |
dut* pxar::pxarCore::_dut |