FPGAAcquisitionDevice: Remove non-blocking mode
This commit is contained in:
@@ -250,10 +250,6 @@ JFJochProtoBuf::FPGAStatus FPGAAcquisitionDevice::GetStatus() const {
|
||||
return ret;
|
||||
}
|
||||
|
||||
void FPGAAcquisitionDevice::SetFPGANonBlockingMode(bool input) {
|
||||
fpga_non_blocking_mode = input;
|
||||
}
|
||||
|
||||
void FPGAAcquisitionDevice::SetCustomInternalGeneratorFrame(const std::vector<uint16_t> &v) {
|
||||
if (v.size() != RAW_MODULE_SIZE)
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
class FPGAAcquisitionDevice : public AcquisitionDevice {
|
||||
uint16_t data_collection_id = 0;
|
||||
bool fpga_non_blocking_mode = true;
|
||||
bool fpga_non_blocking_mode = false;
|
||||
|
||||
virtual void FPGA_StartAction(const DiffractionExperiment &experiment) = 0;
|
||||
virtual void FPGA_EndAction() = 0;
|
||||
@@ -44,7 +44,6 @@ public:
|
||||
JFJochProtoBuf::FPGAStatus GetStatus() const override;
|
||||
void InitializeCalibration(const DiffractionExperiment &experiment, const JFCalibration &calib) override;
|
||||
|
||||
void SetFPGANonBlockingMode(bool input);
|
||||
void SetCustomInternalGeneratorFrame(const std::vector<uint16_t> &v);
|
||||
std::vector<uint16_t> GetInternalGeneratorFrame() const override;
|
||||
};
|
||||
|
||||
@@ -12,7 +12,6 @@ void print_usage(Logger &logger) {
|
||||
logger.Info("Options:");
|
||||
logger.Info(" -C conversion on CPU");
|
||||
logger.Info(" -M use mock device");
|
||||
logger.Info(" -B blocking mode (FPGA)");
|
||||
logger.Info(" -R raw");
|
||||
logger.Info(" -v verbose");
|
||||
logger.Info(" -H mock aq. dev. with HBM (DL380 with Intel MAX only)");
|
||||
@@ -37,7 +36,6 @@ int main(int argc, char **argv) {
|
||||
uint16_t nthreads = 64;
|
||||
bool conversion_on_cpu = false;
|
||||
bool use_mock_device = false;
|
||||
bool nonblocking_mode = true;
|
||||
bool verbose = false;
|
||||
std::string numa_policy_name;
|
||||
bool use_hbm_for_aq_dev = false;
|
||||
@@ -50,7 +48,7 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
|
||||
int opt;
|
||||
while ((opt = getopt(argc, argv, "s:i:m:p:N:P:CMBvHDR")) != -1) {
|
||||
while ((opt = getopt(argc, argv, "s:i:m:p:N:P:CMvHDR")) != -1) {
|
||||
switch (opt) {
|
||||
case 'C':
|
||||
conversion_on_cpu = true;
|
||||
@@ -58,9 +56,6 @@ int main(int argc, char **argv) {
|
||||
case 'M':
|
||||
use_mock_device = true;
|
||||
break;
|
||||
case 'B':
|
||||
nonblocking_mode = false;
|
||||
break;
|
||||
case 'i':
|
||||
nimages = atol(optarg);
|
||||
break;
|
||||
@@ -164,15 +159,10 @@ int main(int argc, char **argv) {
|
||||
pcie_devices.push_back(std::make_unique<PCIExpressDevice>(dev_name[i], i));
|
||||
pcie_devices[i]->SetCustomInternalGeneratorFrame(input);
|
||||
pcie_devices[i]->EnableLogging(&logger);
|
||||
pcie_devices[i]->SetFPGANonBlockingMode(nonblocking_mode);
|
||||
pcie_devices[i]->SetDefaultMAC();
|
||||
pcie_devices[i]->SetIPv4Address((i << 24) + 0x010a0a0a);
|
||||
aq_devices.push_back(pcie_devices[i].get());
|
||||
}
|
||||
|
||||
if (!nonblocking_mode)
|
||||
logger.Warning(
|
||||
"FPGA uses blocking mode - in case data acquisition is aborted, it is necessary to cold reboot the machine");
|
||||
}
|
||||
|
||||
volatile bool done = false;
|
||||
|
||||
@@ -19,7 +19,6 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator", "[FPGA][Full]") {
|
||||
x.UseInternalPacketGenerator(true).ImagesPerTrigger(4).PedestalG0Frames(0);
|
||||
|
||||
HLSSimulatedDevice test(0, 64);
|
||||
test.SetFPGANonBlockingMode(false);
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
@@ -39,26 +38,6 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator", "[FPGA][Full]") {
|
||||
REQUIRE(test.GetCompletedDescriptors() == (4 + DELAY_FRAMES_STOP_AND_QUIT - 1) * nmodules);
|
||||
}
|
||||
|
||||
TEST_CASE("HLS_C_Simulation_internal_packet_generator_skip_packets", "[FPGA][Full]") {
|
||||
const uint16_t nmodules = 1;
|
||||
|
||||
DiffractionExperiment x((DetectorGeometry(nmodules)));
|
||||
|
||||
x.Mode(DetectorMode::Raw);
|
||||
x.UseInternalPacketGenerator(true).ImagesPerTrigger(1000).PedestalG0Frames(0);
|
||||
|
||||
HLSSimulatedDevice test(0, 64);
|
||||
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE(test.OutputStream().size() == 1);
|
||||
|
||||
JFJochProtoBuf::AcquisitionDeviceStatistics device_statistics;
|
||||
REQUIRE_NOTHROW(test.SaveStatistics(x, device_statistics));
|
||||
REQUIRE(device_statistics.efficiency() < 1.0);
|
||||
}
|
||||
|
||||
TEST_CASE("HLS_C_Simulation_internal_packet_generator_custom_frame", "[FPGA][Full]") {
|
||||
const uint16_t nmodules = 4;
|
||||
|
||||
@@ -77,7 +56,6 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_custom_frame", "[FPGA][Ful
|
||||
|
||||
HLSSimulatedDevice test(0, 64);
|
||||
test.SetCustomInternalGeneratorFrame(test_frame);
|
||||
test.SetFPGANonBlockingMode(false);
|
||||
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
@@ -117,7 +95,6 @@ TEST_CASE("HLS_C_Simulation_check_raw", "[FPGA][Full]") {
|
||||
HLSSimulatedDevice test(0, 64);
|
||||
test.CreatePackets(x, 1, 5, 0, raw_frames.data(), true);
|
||||
test.CreateFinalPacket(x);
|
||||
test.SetFPGANonBlockingMode(false);
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
@@ -251,7 +228,6 @@ TEST_CASE("HLS_C_Simulation_check_lost_frame_raw", "[FPGA][Full]") {
|
||||
|
||||
test.CreatePacketJF(x, 1, 0, 0, data, false);
|
||||
test.CreateFinalPacket(x);
|
||||
test.SetFPGANonBlockingMode(false);
|
||||
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
@@ -335,7 +311,6 @@ TEST_CASE("HLS_C_Simulation_check_single_packet", "[FPGA][Full]") {
|
||||
test.CreatePacketJF(x, 4, 1, 0, data, false);
|
||||
|
||||
test.CreateFinalPacket(x);
|
||||
test.SetFPGANonBlockingMode(false);
|
||||
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
@@ -961,7 +936,6 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_16_storage_cell_convert_G0
|
||||
REQUIRE(x.GetImageNum() == ntrigger * nstoragecells);
|
||||
|
||||
HLSSimulatedDevice test(0, ntrigger * nstoragecells);
|
||||
test.SetFPGANonBlockingMode(false);
|
||||
std::vector<double> tmp(3 * RAW_MODULE_SIZE, 50);
|
||||
JFModuleGainCalibration gain(tmp);
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ TEST_CASE("JFJochReceiverTest_Raw", "[JFJochReceiver]") {
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++) {
|
||||
HLSSimulatedDevice *test;
|
||||
test = new HLSSimulatedDevice(i, 64);
|
||||
test->SetFPGANonBlockingMode(false);
|
||||
aq_devices.emplace_back(test);
|
||||
}
|
||||
|
||||
@@ -54,7 +53,6 @@ TEST_CASE("JFJochReceiverTest_Conversion", "[JFJochReceiver]") {
|
||||
HLSSimulatedDevice *test;
|
||||
test = new HLSSimulatedDevice(i, 64);
|
||||
test->EnableLogging(&logger);
|
||||
test->SetFPGANonBlockingMode(false);
|
||||
aq_devices.emplace_back(test);
|
||||
}
|
||||
|
||||
@@ -65,7 +63,7 @@ TEST_CASE("JFJochReceiverTest_Conversion", "[JFJochReceiver]") {
|
||||
REQUIRE(output.efficiency() == 1.0);
|
||||
REQUIRE(output.images_sent() == x.GetImageNum());
|
||||
|
||||
REQUIRE(!output.cancelled());
|
||||
REQUIRE(!output.cancelled());
|
||||
}
|
||||
|
||||
TEST_CASE("JFJochReceiverTest_Conversion_Bin2x2", "[JFJochReceiver]") {
|
||||
@@ -82,7 +80,6 @@ TEST_CASE("JFJochReceiverTest_Conversion_Bin2x2", "[JFJochReceiver]") {
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++) {
|
||||
HLSSimulatedDevice *test;
|
||||
test = new HLSSimulatedDevice(i, 64);
|
||||
test->SetFPGANonBlockingMode(false);
|
||||
test->EnableLogging(&logger);
|
||||
aq_devices.emplace_back(test);
|
||||
}
|
||||
@@ -112,7 +109,6 @@ TEST_CASE("JFJochReceiverTest_ConversionOnCPU", "[JFJochReceiver]") {
|
||||
HLSSimulatedDevice *test;
|
||||
test = new HLSSimulatedDevice(i, 64);
|
||||
test->EnableLogging(&logger);
|
||||
test->SetFPGANonBlockingMode(false);
|
||||
aq_devices.emplace_back(test);
|
||||
}
|
||||
|
||||
@@ -123,7 +119,7 @@ TEST_CASE("JFJochReceiverTest_ConversionOnCPU", "[JFJochReceiver]") {
|
||||
REQUIRE(output.efficiency() == 1.0);
|
||||
REQUIRE(output.images_sent() == x.GetImageNum());
|
||||
|
||||
REQUIRE(!output.cancelled());
|
||||
REQUIRE(!output.cancelled());
|
||||
}
|
||||
|
||||
|
||||
@@ -142,7 +138,6 @@ TEST_CASE("JFJochReceiverTest_ConversionOnCPU_Bin2x2", "[JFJochReceiver]") {
|
||||
HLSSimulatedDevice *test;
|
||||
test = new HLSSimulatedDevice(i, 64);
|
||||
test->EnableLogging(&logger);
|
||||
test->SetFPGANonBlockingMode(false);
|
||||
aq_devices.emplace_back(test);
|
||||
}
|
||||
|
||||
@@ -174,7 +169,6 @@ TEST_CASE("JFJochReceiverTest_Conversion_StorageCell", "[JFJochReceiver]") {
|
||||
HLSSimulatedDevice *test;
|
||||
test = new HLSSimulatedDevice(i, 64);
|
||||
test->EnableLogging(&logger);
|
||||
test->SetFPGANonBlockingMode(false);
|
||||
aq_devices.emplace_back(test);
|
||||
}
|
||||
|
||||
@@ -219,7 +213,6 @@ TEST_CASE("JFJochReceiverTest_PedestalG1", "[JFJochReceiver]") {
|
||||
test = new HLSSimulatedDevice(i, 64);
|
||||
test->CreatePackets(x, 1, nframes, 0, pedestal_in.data(), false);
|
||||
test->CreateFinalPacket(x);
|
||||
test->SetFPGANonBlockingMode(false);
|
||||
aq_devices.emplace_back(test);
|
||||
}
|
||||
|
||||
@@ -288,7 +281,6 @@ TEST_CASE("JFJochReceiverTest_PedestalG2_storage_cell", "[JFJochReceiver]") {
|
||||
pedestal_in.data() + j * RAW_MODULE_SIZE, false);
|
||||
}
|
||||
test->CreateFinalPacket(x);
|
||||
test->SetFPGANonBlockingMode(false);
|
||||
aq_devices.emplace_back(test);
|
||||
}
|
||||
|
||||
@@ -343,7 +335,6 @@ TEST_CASE("JFJochReceiverTest_PedestalG0", "[JFJochReceiver]") {
|
||||
test = new HLSSimulatedDevice(i, 64);
|
||||
test->CreatePackets(x, 1, nframes, 0, pedestal_in.data(), false);
|
||||
test->CreateFinalPacket(x);
|
||||
test->SetFPGANonBlockingMode(false);
|
||||
aq_devices.emplace_back(test);
|
||||
}
|
||||
|
||||
@@ -396,7 +387,6 @@ TEST_CASE("JFJochReceiverTest_PedestalG0_StorageCell", "[JFJochReceiver]") {
|
||||
test->CreatePackets(x, i*4+4, 1, 0, pedestal_in_3.data(), false);
|
||||
}
|
||||
test->CreateFinalPacket(x);
|
||||
test->SetFPGANonBlockingMode(false);
|
||||
aq_devices.emplace_back(test);
|
||||
|
||||
Logger logger("JFJochReceiverTest_PedestalG0_StorageCell");
|
||||
@@ -478,7 +468,6 @@ TEST_CASE("JFJochReceiverTest_PacketLost_Raw", "[JFJochReceiver]") {
|
||||
test->CreatePackets(x, 4, 1, 1, frame_in.data(), false);
|
||||
test->CreateFinalPacket(x);
|
||||
|
||||
test->SetFPGANonBlockingMode(false);
|
||||
aq_devices.emplace_back(test);
|
||||
}
|
||||
Logger logger("JFJochReceiverTest_PacketLost_Raw");
|
||||
|
||||
@@ -31,7 +31,6 @@ TEST_CASE("StreamWriterTest_ZMQ","[JFJochWriter]") {
|
||||
std::vector<std::unique_ptr<AcquisitionDevice>> aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++) {
|
||||
auto test = new HLSSimulatedDevice(i, 64);
|
||||
test->SetFPGANonBlockingMode(false);
|
||||
aq_devices.emplace_back(test);
|
||||
}
|
||||
|
||||
@@ -99,7 +98,6 @@ TEST_CASE("JFJochWriterServiceTest_ZMQ","[JFJochWriter]") {
|
||||
std::vector<std::unique_ptr<AcquisitionDevice>> aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++) {
|
||||
auto test = new HLSSimulatedDevice(i, 64);
|
||||
test->SetFPGANonBlockingMode(false);
|
||||
aq_devices.emplace_back(test);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user