86 lines
2.0 KiB
C++
86 lines
2.0 KiB
C++
// Copyright (2019-2022) Paul Scherrer Institute
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
#include "RawEthDevice.h"
|
|
|
|
RawEthDevice::RawEthDevice(const std::string &device_name, uint16_t data_stream, size_t in_frame_buffer_size_modules,
|
|
int16_t in_numa_node)
|
|
: AcquisitionDevice(data_stream),
|
|
context(device_name),
|
|
numa_node(in_numa_node) {
|
|
max_modules = 32;
|
|
MapBuffersStandard(in_frame_buffer_size_modules, (3 + 3 * 16) * max_modules + 1, numa_node);
|
|
}
|
|
|
|
RawEthDevice::~RawEthDevice() {
|
|
|
|
}
|
|
|
|
void RawEthDevice::InitializeCalibration(const DiffractionExperiment &experiment, const JFCalibration &calib) {
|
|
AcquisitionDevice::InitializeCalibration(experiment, calib);
|
|
}
|
|
|
|
int32_t RawEthDevice::GetNUMANode() const {
|
|
return AcquisitionDevice::GetNUMANode();
|
|
}
|
|
|
|
Completion RawEthDevice::ReadCompletion() {
|
|
return completion_queue.GetBlocking();
|
|
}
|
|
|
|
void RawEthDevice::HW_WriteActionRegister(const ActionConfig *job) {
|
|
memcpy(&cfg, job, sizeof(ActionConfig));
|
|
}
|
|
|
|
void RawEthDevice::HW_ReadActionRegister(ActionConfig *job) {
|
|
memcpy(job, &cfg, sizeof(ActionConfig));
|
|
}
|
|
|
|
void RawEthDevice::HW_StartAction() {
|
|
|
|
}
|
|
|
|
bool RawEthDevice::HW_IsIdle() const {
|
|
return false;
|
|
}
|
|
|
|
void RawEthDevice::HW_SetCancelDataCollectionBit() {
|
|
|
|
}
|
|
|
|
bool RawEthDevice::HW_SendWorkRequest(uint32_t handle) {
|
|
if (handle == UINT32_MAX)
|
|
HW_SetCancelDataCollectionBit();
|
|
else
|
|
wr_queue.Put(ProcessWorkRequest{
|
|
.ptr = buffer_device.at(handle),
|
|
.handle = handle
|
|
});
|
|
|
|
return true;
|
|
}
|
|
|
|
void RawEthDevice::HW_GetStatus(ActionStatus *status) const {
|
|
|
|
}
|
|
|
|
void RawEthDevice::HW_GetEnvParams(ActionEnvParams *status) const {
|
|
|
|
}
|
|
|
|
void RawEthDevice::HW_EndAction() {
|
|
|
|
}
|
|
|
|
void RawEthDevice::CopyInternalPacketGenFrameToDeviceBuffer() {
|
|
// Do nothing
|
|
}
|
|
|
|
void RawEthDevice::SetMACAddress(uint64_t mac_addr_network_order) {
|
|
mac_addr = mac_addr_network_order;
|
|
}
|
|
|
|
|
|
uint64_t RawEthDevice::HW_GetMACAddress() const {
|
|
return mac_addr;
|
|
} |