FPGA: load calibration works as dedicated function of the card

This commit is contained in:
2023-09-12 14:34:42 +02:00
parent 7a635f1ee8
commit 9d01630cfc
17 changed files with 177 additions and 171 deletions

View File

@@ -31,7 +31,7 @@ PCIExpressDevice::PCIExpressDevice(const std::string &device_name, uint16_t data
uint32_t num_buf = GetNumKernelBuffers();
if (num_buf < max_modules * (3 + 3 * 16) + 2)
if (num_buf < max_modules * (3 + 3 * 16))
throw JFJochException(JFJochExceptionCategory::PCIeError,
"Need to increase number of host-device buffers");
@@ -211,3 +211,13 @@ void PCIExpressDevice::HW_ReadInternalPacketGen(uint16_t *tmp) const {
throw JFJochException(JFJochExceptionCategory::PCIeError,
"Failed getting internal packet generator frame", errno);
}
void PCIExpressDevice::HW_LoadCalibration(uint32_t in_modules, uint32_t in_storage_cells) {
ActionConfig config{
.nmodules = in_modules,
.nstorage_cells = in_storage_cells
};
if (ioctl(fd, IOCTL_JFJOCH_LOAD_CALIB, &config) != 0)
throw JFJochException(JFJochExceptionCategory::PCIeError,
"Failed writing config", errno);
}