Add e-fuse reading and check for proper chip naming
What
This MR does two things:
- Adds functionality in the
Rd53b
front-end class for reading back the e-fuse data by including itkpix_efuse_codec (header-only) - Adds functionality for reading back a specific register to the
Rd53b
front-end class - Adds functionality in the YARR chip configuration file to specify whether or not to enforce that a front-end's
"Name"
field contains the proper serial number
Reading the E-fuses
There is a function added to the Rd53b
class that returns an instance of EfuseData
:
itkpix_efuse_codec::EfuseData readEfuses();
Which can be used as follows:
itkpix_efuse_codec::EfuseData efuse_data{fe->readEfuses()};
std::cout << "Raw, 32-bit e-fuse data (un-decoded) = " << efuse_data.raw() << std::endl;
std::cout << "Chip serial number from decoded e-fuse data = " << efuse_data.chip_sn() << std::endl;
The itkpix_efuse_codec::EfuseData
class holds the raw 32-bit data from the e-fuse readback, but provides functions for retrieving the various pieces of data contained in the read back e-fuse data.
Reading back a single Rd53b register
A new method Rd53b::readSingleRegister
is defined, and used as follows:
uint32_t e_fuse_0 = readSingleRegister(&Rd53b::EfuseReadData0);
Enforce that a chip's config specifies the correct serial number
This MR also adds a field to the "Parameter"
field for front-ends named EnforceNameIdCheck
that is a boolean
. If set to true, then in the case of the Rd53b
front-end class, the call to Rd53b::checkCom
will enforce that the user-provided JSON configuration for a chip has the serial number (hexadecimal) appearing in the "Name"
field, where the serial number is provided as a hexadecimal string. For example:
"Parameter" : {
"ChipId": 12,
"InjCap": 7.5,
"Name": "Q12_Chip1_0x16285",
"VcalPar": [
0.46000000834465027,
0.20069999992847443
],
"EnforceNameIdCheck" : true
}
The current behavior is to return a failure from checkCom
if the retrieved serial number from the e-fuses does not correctly appear in the "Name"
field.