49 lines
1.7 KiB
C++
49 lines
1.7 KiB
C++
// Copyright (2019-2022) Paul Scherrer Institute
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
#ifndef JUNGFRAUJOCH_PCIEXPRESSDEVICE_H
|
|
#define JUNGFRAUJOCH_PCIEXPRESSDEVICE_H
|
|
|
|
#include "FPGAAcquisitionDevice.h"
|
|
|
|
class PCIExpressDevice : public FPGAAcquisitionDevice {
|
|
int fd;
|
|
|
|
bool HW_ReadMailbox(uint32_t values[16]) override;
|
|
bool HW_SendWorkRequest(uint32_t handle) override;
|
|
void FPGA_StartAction(const DiffractionExperiment &experiment) override;
|
|
bool HW_IsIdle() const final;
|
|
void HW_WriteActionRegister(const ActionConfig *job) override;
|
|
void HW_ReadActionRegister(ActionConfig *job) override;
|
|
void HW_LoadCalibration(uint32_t modules, uint32_t storage_cells) override;
|
|
void FPGA_EndAction() override;
|
|
|
|
void Reset();
|
|
void GetStatus_Internal(ActionStatus *status) const;
|
|
|
|
uint16_t *MapKernelBuffer(uint32_t n_buf);
|
|
public:
|
|
explicit PCIExpressDevice(uint16_t data_stream);
|
|
PCIExpressDevice(uint16_t data_stream, uint16_t pci_slot);
|
|
PCIExpressDevice(const std::string &device_name, uint16_t data_stream);
|
|
~PCIExpressDevice() override;
|
|
|
|
void Cancel() override;
|
|
void HW_GetStatus(ActionStatus *status) const override;
|
|
void HW_GetEnvParams(ActionEnvParams *status) const override;
|
|
void HW_ReadInternalPacketGen(uint16_t *tmp) const;
|
|
uint32_t GetNumKernelBuffers() const;
|
|
|
|
int32_t GetNUMANode() const override;
|
|
void ClearNetworkCounters();
|
|
|
|
void SetMACAddress(uint64_t mac_addr_network_order);
|
|
void SetDefaultMAC() const;
|
|
void SetIPv4Address(uint32_t ipv4_addr_network_order);
|
|
|
|
std::string GetMACAddress() const override;
|
|
std::string GetIPv4Address() const override;
|
|
};
|
|
|
|
#endif //JUNGFRAUJOCH_PCIEXPRESSDEVICE_H
|