FPGA: frame generator reads from HBM (work in progress)

This commit is contained in:
2023-09-26 13:14:43 +02:00
parent 0f7c14c267
commit 84bf69b8a6
21 changed files with 188 additions and 141 deletions
+9 -12
View File
@@ -92,12 +92,6 @@ bool PCIExpressDevice::HW_SendWorkRequest(uint32_t handle) {
}
void PCIExpressDevice::FPGA_StartAction(const DiffractionExperiment &experiment) {
if (experiment.IsUsingInternalPacketGen()) {
if (ioctl(fd, IOCTL_JFJOCH_SET_INT_PKT, internal_pkt_gen_frame.data()) != 0)
throw JFJochException(JFJochExceptionCategory::PCIeError,
"Failed loading internal packet generator frame", errno);
}
if (ioctl(fd, IOCTL_JFJOCH_START) != 0)
throw JFJochException(JFJochExceptionCategory::PCIeError, "Failed starting action", errno);
@@ -222,12 +216,6 @@ std::string PCIExpressDevice::GetIPv4Address() const {
return IPv4AddressToStr(tmp);
}
void PCIExpressDevice::HW_ReadInternalPacketGen(uint16_t *tmp) const {
if (ioctl(fd, IOCTL_JFJOCH_GET_INT_PKT, tmp) != 0)
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,
@@ -266,3 +254,12 @@ void PCIExpressDevice::WriteRegister(uint32_t addr, uint32_t val) {
throw JFJochException(JFJochExceptionCategory::PCIeError, "Failed writing to register", errno);
}
void PCIExpressDevice::HW_LoadInternalGeneratorFrame(uint32_t in_modules) {
ActionConfig config{
.nmodules = in_modules
};
if (ioctl(fd, IOCTL_JFJOCH_LOAD_INT_GEN, &config) != 0)
throw JFJochException(JFJochExceptionCategory::PCIeError, "Failed uploading internal generator frame", errno);
}