Adapt PCIe driver and tests for the new frame generator
This commit is contained in:
@@ -127,13 +127,26 @@ void HLSSimulatedDevice::HW_WriteActionRegister(const ActionConfig *job) {
|
||||
memcpy(&cfg, job, sizeof(ActionConfig));
|
||||
}
|
||||
|
||||
void HLSSimulatedDevice::FPGA_StartAction() {
|
||||
void HLSSimulatedDevice::FPGA_StartAction(const DiffractionExperiment &experiment) {
|
||||
if (action_thread.joinable())
|
||||
action_thread.join();
|
||||
|
||||
run_data_collection = 1;
|
||||
cancel_data_collection = 0;
|
||||
idle = false;
|
||||
if (experiment.IsUsingInternalPacketGen()) {
|
||||
frame_generator(din_eth,
|
||||
reinterpret_cast<ap_uint<512> *>(internal_pkt_gen_frame.data()),
|
||||
experiment.GetFrameNum() + DELAY_FRAMES_STOP_AND_QUIT + 1,
|
||||
experiment.GetModulesNum(data_stream),
|
||||
mac_addr,
|
||||
mac_addr,
|
||||
ipv4_addr,
|
||||
ipv4_addr,
|
||||
INT_PKT_GEN_BUNCHID,
|
||||
INT_PKT_GEN_EXPTTIME,
|
||||
INT_PKT_GEN_DEBUG);
|
||||
}
|
||||
action_thread = std::thread(&HLSSimulatedDevice::HLSMainThread, this );
|
||||
}
|
||||
|
||||
@@ -213,22 +226,6 @@ void HLSSimulatedDevice::HLSMainThread() {
|
||||
|
||||
ap_uint<8> err_reg;
|
||||
|
||||
if (cfg.mode & MODE_INTERNAL_PACKET_GEN) {
|
||||
frame_generator(din_eth,
|
||||
reinterpret_cast<ap_uint<512> *>(internal_pkt_gen_frame.data()),
|
||||
cfg.nframes + DELAY_FRAMES_STOP_AND_QUIT + 1,
|
||||
cfg.nmodules,
|
||||
mac_addr,
|
||||
mac_addr,
|
||||
ipv4_addr,
|
||||
ipv4_addr,
|
||||
INT_PKT_GEN_BUNCHID,
|
||||
INT_PKT_GEN_EXPTTIME,
|
||||
INT_PKT_GEN_DEBUG);
|
||||
if (logger)
|
||||
logger->Info("Packets ready {}", din_eth.size());
|
||||
}
|
||||
|
||||
while(!din_eth.empty())
|
||||
ethernet(din_eth, ip1, arp1, mac_addr, eth_packets, clear_counters);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user