47 lines
1.5 KiB
C++
47 lines
1.5 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]);
|
|
bool HW_SendWorkRequest(uint32_t handle) override;
|
|
void FPGA_StartAction() override;
|
|
bool HW_IsIdle() const final;
|
|
void HW_WriteActionRegister(const ActionConfig *job) override;
|
|
void HW_ReadActionRegister(ActionConfig *job) override;
|
|
uint64_t HW_GetMACAddress() const override;
|
|
uint32_t HW_GetIPv4Address() const 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 HW_SetCancelDataCollectionBit() override;
|
|
void HW_GetStatus(ActionStatus *status) const override;
|
|
void HW_GetEnvParams(ActionEnvParams *status) const override;
|
|
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);
|
|
};
|
|
|
|
|
|
#endif //JUNGFRAUJOCH_PCIEXPRESSDEVICE_H
|