diff --git a/receiver/host/MakeAcquisitionDevice.cpp b/receiver/host/MakeAcquisitionDevice.cpp deleted file mode 100644 index 82b39645..00000000 --- a/receiver/host/MakeAcquisitionDevice.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (2019-2022) Paul Scherrer Institute -// SPDX-License-Identifier: GPL-3.0-or-later - -#include "MakeAcquisitionDevice.h" -#include "HLSSimulatedDevice.h" -#include "PCIExpressDevice.h" -#include "MockAcquisitionDevice.h" -#include "../../common/JFJochException.h" - -std::unique_ptr MakeAcquisitionDevice(AcquisitionDeviceType type, uint16_t data_stream, - size_t in_frame_buffer_size_modules, - uint16_t pci_slot_number, - int16_t numa_node) { - switch (type) { - case AcquisitionDeviceType::HLS: - if (data_stream != 0) - throw JFJochException(JFJochExceptionCategory::ArrayOutOfBounds, - "HLS simulation possible with a single data stream only"); - return std::make_unique(data_stream, in_frame_buffer_size_modules, numa_node); - case AcquisitionDeviceType::PCIe: - return std::make_unique(data_stream, pci_slot_number); - case AcquisitionDeviceType::Mock: - default: { - auto tmp = std::make_unique(data_stream, in_frame_buffer_size_modules); - tmp->Terminate(); - return tmp; - } - - } -} \ No newline at end of file diff --git a/receiver/host/MakeAcquisitionDevice.h b/receiver/host/MakeAcquisitionDevice.h deleted file mode 100644 index fce069ae..00000000 --- a/receiver/host/MakeAcquisitionDevice.h +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (2019-2022) Paul Scherrer Institute -// SPDX-License-Identifier: GPL-3.0-or-later - -#ifndef JUNGFRAUJOCH_MAKEACQUISITIONDEVICE_H -#define JUNGFRAUJOCH_MAKEACQUISITIONDEVICE_H - -#include "AcquisitionDevice.h" - -enum class AcquisitionDeviceType {PCIe, HLS, Mock}; - -std::unique_ptr MakeAcquisitionDevice(AcquisitionDeviceType type, uint16_t data_stream, - size_t in_frame_buffer_size_modules = 1024, - uint16_t pci_slot_number = 0, - int16_t numa_node = -1); -#endif //JUNGFRAUJOCH_MAKEACQUISITIONDEVICE_H diff --git a/receiver/jfjoch_action_test.cpp b/receiver/jfjoch_action_test.cpp index ecdaf490..2244a575 100644 --- a/receiver/jfjoch_action_test.cpp +++ b/receiver/jfjoch_action_test.cpp @@ -3,7 +3,7 @@ #include -#include "host/MakeAcquisitionDevice.h" +#include "host/PCIExpressDevice.h" #include "JFJochReceiverTest.h" #include "../tests/FPGAUnitTest.h" @@ -38,19 +38,22 @@ int main(int argc, char **argv) { x.SpotFindingPeriod(std::chrono::milliseconds(processing_period)).MaskModuleEdges(false).MaskChipEdges(false); x.Compression(JFJochProtoBuf::BSHUF_LZ4); - std::vector pci_slot_number = {0,2,1,3}; + std::vector dev_name = { + "/dev/jfjoch0", + "/dev/jfjoch2", + "/dev/jfjoch1", + "/dev/jfjoch3" + }; std::vector numa_node = {0,1,0,1}; bool verbose = false; bool print_status_updates = true; - size_t frame_buffer_size = 4096; uint16_t nthreads = 64; - AcquisitionDeviceType dev_type = AcquisitionDeviceType::PCIe; uint64_t clock_MHz = 200; logger.Verbose(verbose); - if (nstreams > pci_slot_number.size()) { - logger.Error("Only {} data streams allowed on this platform", pci_slot_number.size()); + if (nstreams > dev_name.size()) { + logger.Error("Only {} data streams allowed on this platform", dev_name.size()); exit(EXIT_FAILURE); } @@ -62,7 +65,7 @@ int main(int argc, char **argv) { LoadBinaryFile(image_path, input.data(), RAW_MODULE_SIZE); for (int i = 0; i < nstreams; i++) { - oc_devices.push_back(MakeAcquisitionDevice(dev_type, i, frame_buffer_size, pci_slot_number[i], numa_node[i])); + oc_devices.push_back(std::make_unique(dev_name[i], i)); oc_devices[i]->SetCustomInternalGeneratorFrame(input); oc_devices[i]->EnableLogging(&logger); aq_devices.push_back(oc_devices[i].get());