21a8ea51ee
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Failing after 8m56s
Build Packages / build:rpm (rocky8_nocuda) (push) Failing after 10m5s
Build Packages / build:rpm (rocky9_nocuda) (push) Failing after 11m41s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Failing after 11m39s
Build Packages / build:rpm (rocky9_sls9) (push) Failing after 11m42s
Build Packages / build:rpm (rocky8_sls9) (push) Failing after 11m45s
Build Packages / build:rpm (rocky8) (push) Failing after 11m47s
Build Packages / build:rpm (rocky9) (push) Failing after 10m21s
Build Packages / Generate python client (push) Successful in 14s
Build Packages / build:rpm (ubuntu2204) (push) Failing after 9m58s
Build Packages / Create release (push) Skipped
Build Packages / XDS test (neggia plugin) (push) Successful in 8m14s
Build Packages / Build documentation (push) Successful in 36s
Build Packages / XDS test (durin plugin) (push) Successful in 8m52s
Build Packages / build:rpm (ubuntu2404) (push) Failing after 9m4s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 9m7s
Build Packages / DIALS test (push) Successful in 11m49s
Build Packages / Unit tests (push) Successful in 1h8m58s
75 lines
2.3 KiB
C++
75 lines
2.3 KiB
C++
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#pragma once
|
|
|
|
#include <future>
|
|
#include <vector>
|
|
|
|
#include "../pcie_driver/jfjoch_fpga.h"
|
|
|
|
struct HLSDeviceImpl;
|
|
|
|
class HLSDevice {
|
|
// Hide all HLS simulation structures here
|
|
std::unique_ptr<HLSDeviceImpl> impl_;
|
|
|
|
std::mutex completion_mutex;
|
|
uint32_t completion_count;
|
|
|
|
std::thread action_thread;
|
|
std::future<void> frame_generator_future;
|
|
std::vector<uint64_t> dma_address_table;
|
|
uint64_t eth_packets = 0;
|
|
uint64_t icmp_packets = 0;
|
|
uint64_t udp_packets = 0;
|
|
uint64_t sls_packets = 0;
|
|
uint32_t udp_len_err = 0;
|
|
uint32_t udp_eth_err = 0;
|
|
|
|
uint64_t current_pulse_id = 0;
|
|
uint32_t run_counter = 0;
|
|
|
|
DataCollectionConfig cfg;
|
|
SpotFinderParameters spot_finder_parameters;
|
|
|
|
const uint64_t mac_addr = 0xCCAA11223344;
|
|
const uint32_t ipv4_addr = 0x0132010A;
|
|
volatile bool idle;
|
|
|
|
void FrameGeneratorFuture(FrameGeneratorConfig config);
|
|
void HLSMainThread();
|
|
public:
|
|
explicit HLSDevice(std::vector<DeviceOutput *> &device_buffer);
|
|
~HLSDevice();
|
|
void SendPacket(char *buffer, int len, uint8_t user = 0);
|
|
void CreateJFPacket(uint64_t frame_number, uint32_t eth_packet,
|
|
uint32_t module_number, const uint16_t *data, int8_t adjust_axis = 0, uint8_t user = 0);
|
|
void CreateEIGERPacket(uint64_t frame_number, uint32_t eth_packet,
|
|
uint32_t module_number, uint32_t col, uint32_t row,
|
|
const uint16_t *data);
|
|
void CreateFinalPacket();
|
|
void CreateXfelBunchIDPacket(double bunchid, uint32_t event_code);
|
|
|
|
DataCollectionStatus GetDataCollectionStatus() const ;
|
|
void Cancel() ;
|
|
|
|
void HW_ReadActionRegister(DataCollectionConfig *job);
|
|
void HW_WriteActionRegister(const DataCollectionConfig *job);
|
|
|
|
void FPGA_StartAction();
|
|
void FPGA_EndAction();
|
|
bool HW_IsIdle() const;
|
|
bool HW_ReadMailbox(uint32_t *values);
|
|
bool HW_SendWorkRequest(uint32_t handle);
|
|
void HW_LoadCalibration(const LoadCalibrationConfig &config);
|
|
void HW_SetSpotFinderParameters(const SpotFinderParameters ¶ms);
|
|
void HW_RunInternalGenerator(const FrameGeneratorConfig &config) ;
|
|
|
|
uint64_t GetSLSPackets();
|
|
uint64_t GetUDPPackets();
|
|
};
|
|
|
|
|
|
|