Adapt PCIe driver and tests for the new frame generator
This commit is contained in:
@@ -92,14 +92,25 @@ bool PCIExpressDevice::HW_SendWorkRequest(uint32_t handle) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void PCIExpressDevice::FPGA_StartAction() {
|
||||
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);
|
||||
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);
|
||||
throw JFJochException(JFJochExceptionCategory::PCIeError, "Failed starting action", errno);
|
||||
|
||||
if (experiment.IsUsingInternalPacketGen()) {
|
||||
FrameGeneratorConfig config{};
|
||||
config.frames = experiment.GetFrameNum() + DELAY_FRAMES_STOP_AND_QUIT + 1;
|
||||
config.modules = experiment.GetModulesNum(data_stream);
|
||||
config.dest_ipv4_addr = ipv4_addr;
|
||||
config.dest_mac_addr = mac_addr;
|
||||
if (ioctl(fd, IOCTL_JFJOCH_RUN_FRAME_GEN) != 0)
|
||||
throw JFJochException(JFJochExceptionCategory::PCIeError, "Failed starting frame generator", errno);
|
||||
}
|
||||
}
|
||||
|
||||
void PCIExpressDevice::FPGA_EndAction() {
|
||||
|
||||
Reference in New Issue
Block a user