From 32baaef1e4bdde361e6e299de14f785137bbecea Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Sat, 15 Apr 2023 11:52:55 +0200 Subject: [PATCH] AcquisitionDevice: IPv4 address and UDP destination port is property of the device and not of a particular run --- common/DiffractionExperiment.cpp | 21 ++-- etc/recv.json | 12 +- grpc/JFJochReceiverClient.cpp | 11 +- grpc/jfjoch.proto | 8 +- python/jfjoch_pb2.py | 136 +++++++++++----------- receiver/JFJochReceiverService.cpp | 8 +- receiver/host/AcquisitionDevice.cpp | 34 +++--- receiver/host/AcquisitionDevice.h | 4 +- receiver/host/ActionConfig.h | 3 +- receiver/host/HLSSimulatedDevice.cpp | 19 +-- receiver/host/HLSSimulatedDevice.h | 9 +- receiver/host/MlxRawEthDevice.cpp | 13 ++- receiver/host/MlxRawEthDevice.h | 3 + receiver/host/MockAcquisitionDevice.cpp | 4 + receiver/host/MockAcquisitionDevice.h | 1 + receiver/host/PCIExpressDevice.cpp | 23 ++-- receiver/host/PCIExpressDevice.h | 6 +- receiver/host/jfjoch_pcie_set_network.cpp | 7 +- receiver/host/jfjoch_pcie_status.cpp | 4 +- receiver/jfjoch_receiver.cpp | 10 +- receiver/pcie_driver/jfjoch_function.c | 4 +- tests/ActionConfigTest.cpp | 22 ++-- tests/DiffractionExperimentTest.cpp | 12 +- tests/FPGAIntegrationTest.cpp | 18 +-- 24 files changed, 223 insertions(+), 169 deletions(-) diff --git a/common/DiffractionExperiment.cpp b/common/DiffractionExperiment.cpp index 7db6fbcf..3b99e090 100644 --- a/common/DiffractionExperiment.cpp +++ b/common/DiffractionExperiment.cpp @@ -912,7 +912,7 @@ DiffractionExperiment::operator JFJochProtoBuf::DetectorInput() const { JFJochProtoBuf::DetectorConfig DiffractionExperiment::DetectorConfig(const JFJochProtoBuf::ReceiverNetworkConfig &net_config) const { JFJochProtoBuf::DetectorConfig ret; - if (net_config.fpga_mac_addr_size() < GetDataStreamsNum()) + if (net_config.device_size() < GetDataStreamsNum()) throw JFJochException(JFJochExceptionCategory::ArrayOutOfBounds, "Number of FPGA boards in the receiver is less then necessary"); @@ -924,16 +924,17 @@ JFJochProtoBuf::DetectorConfig DiffractionExperiment::DetectorConfig(const JFJoc *ret.mutable_module_hostname() = internal.detector().module_hostname(); for (int d = 0; d < GetDataStreamsNum(); d++) { - for (int module = 0; module < GetModulesNum(d); module++) { + for (int m = 0; m < GetModulesNum(d); m++) { auto mod_cfg = ret.add_modules(); - mod_cfg->set_udp_dest_port_1(GetDestUDPPort(d, 2 * module)); - mod_cfg->set_udp_dest_port_2(GetDestUDPPort(d, 2 * module + 1)); - mod_cfg->set_ipv4_src_addr_1(IPv4AddressToStr(GetSrcIPv4Address(d, 2 * module))); - mod_cfg->set_ipv4_src_addr_2(IPv4AddressToStr(GetSrcIPv4Address(d, 2 * module + 1))); - mod_cfg->set_ipv4_dest_addr_1(IPv4AddressToStr(GetDestIPv4Address(d))); - mod_cfg->set_ipv4_dest_addr_2(IPv4AddressToStr(GetDestIPv4Address(d))); - mod_cfg->set_mac_addr_dest_1(net_config.fpga_mac_addr(d)); - mod_cfg->set_mac_addr_dest_2(net_config.fpga_mac_addr(d)); + mod_cfg->set_udp_dest_port_1(net_config.device(d).udp_port()); + mod_cfg->set_udp_dest_port_2(net_config.device(d).udp_port()); + mod_cfg->set_ipv4_src_addr_1(IPv4AddressToStr(GetSrcIPv4Address(d, 2 * m))); + mod_cfg->set_ipv4_src_addr_2(IPv4AddressToStr(GetSrcIPv4Address(d, 2 * m + 1))); + mod_cfg->set_ipv4_dest_addr_1(net_config.device(d).ipv4_addr()); + mod_cfg->set_ipv4_dest_addr_2(net_config.device(d).ipv4_addr()); + mod_cfg->set_mac_addr_dest_1(net_config.device(d).mac_addr()); + mod_cfg->set_mac_addr_dest_2(net_config.device(d).mac_addr()); + mod_cfg->set_module_id_in_data_stream(m); } } return ret; diff --git a/etc/recv.json b/etc/recv.json index cc7350f4..5f83d834 100644 --- a/etc/recv.json +++ b/etc/recv.json @@ -3,19 +3,23 @@ "device": [ { "id" : 1, - "type": "pcie" + "type": "pcie", + "ipv4_addr": "10.10.85.1" }, { "id" : 3, - "type": "pcie" + "type": "pcie", + "ipv4_addr": "10.10.85.2" }, { "id" : 0, - "type": "pcie" + "type": "pcie", + "ipv4_addr": "10.10.85.3" }, { "id" : 2, - "type": "pcie" + "type": "pcie", + "ipv4_addr": "10.10.85.4" } ], "tcp_send_buffer_size": 256000000, diff --git a/grpc/JFJochReceiverClient.cpp b/grpc/JFJochReceiverClient.cpp index f128c5f3..ba38dcad 100644 --- a/grpc/JFJochReceiverClient.cpp +++ b/grpc/JFJochReceiverClient.cpp @@ -118,8 +118,15 @@ JFJochProtoBuf::ReceiverNetworkConfig JFJochReceiverClient::GetNetworkConfig() { "JFJochReceiver: " + status.error_message()); } else { // For tests to work, dummy receiver needs to replay with nonsense MAC addresses - ret.add_fpga_mac_addr("00:00:00:00:00:00"); - ret.add_fpga_mac_addr("00:00:00:00:00:01"); + auto d1 = ret.add_device(); + d1->set_mac_addr("00:00:00:00:00:00"); + d1->set_ipv4_addr("10.10.50.1"); + d1->set_udp_port(1234); + + auto d2 = ret.add_device(); + d2->set_mac_addr("00:00:00:00:00:01"); + d2->set_ipv4_addr("10.10.50.2"); + d2->set_udp_port(1234); } return ret; } diff --git a/grpc/jfjoch.proto b/grpc/jfjoch.proto index b59d10c8..55e88c22 100644 --- a/grpc/jfjoch.proto +++ b/grpc/jfjoch.proto @@ -252,8 +252,14 @@ message ReceiverOutput { optional float indexing_rate = 13; } +message ReceiverNetworkConfigDevice { + string mac_addr = 1; + string ipv4_addr = 2; + uint64 udp_port = 3; +} + message ReceiverNetworkConfig { - repeated string fpga_mac_addr = 1; + repeated ReceiverNetworkConfigDevice device = 1; } message ReceiverStatus { diff --git a/python/jfjoch_pb2.py b/python/jfjoch_pb2.py index cc8546c5..5ef1e305 100644 --- a/python/jfjoch_pb2.py +++ b/python/jfjoch_pb2.py @@ -13,7 +13,7 @@ _sym_db = _symbol_database.Default() -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0cjfjoch.proto\x12\x0eJFJochProtoBuf\"\x07\n\x05\x45mpty\"W\n\x08UnitCell\x12\t\n\x01\x61\x18\x01 \x01(\x02\x12\t\n\x01\x62\x18\x02 \x01(\x02\x12\t\n\x01\x63\x18\x03 \x01(\x02\x12\r\n\x05\x61lpha\x18\x04 \x01(\x02\x12\x0c\n\x04\x62\x65ta\x18\x05 \x01(\x02\x12\r\n\x05gamma\x18\x06 \x01(\x02\")\n\x06Vector\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\x12\t\n\x01z\x18\x03 \x01(\x02\"|\n\x10RotationSettings\x12\x17\n\x0fstart_angle_deg\x18\x01 \x01(\x02\x12 \n\x18\x61ngle_incr_per_image_deg\x18\x02 \x01(\x02\x12-\n\rrotation_axis\x18\x03 \x01(\x0b\x32\x16.JFJochProtoBuf.Vector\"\x1c\n\x04Plot\x12\t\n\x01x\x18\x01 \x03(\x02\x12\t\n\x01y\x18\x02 \x03(\x02\"\xa5\x04\n\x0f\x44\x61tasetSettings\x12\x1a\n\x12images_per_trigger\x18\x01 \x01(\x03\x12\x10\n\x08ntrigger\x18\x02 \x01(\x03\x12\x13\n\tsummation\x18\x03 \x01(\x03H\x00\x12\x17\n\rimage_time_us\x18\x04 \x01(\x03H\x00\x12\x12\n\nbeam_x_pxl\x18\x05 \x01(\x02\x12\x12\n\nbeam_y_pxl\x18\x06 \x01(\x02\x12\x1c\n\x14\x64\x65tector_distance_mm\x18\x07 \x01(\x02\x12\x19\n\x11photon_energy_keV\x18\x08 \x01(\x02\x12\x13\n\x0b\x66ile_prefix\x18\t \x01(\t\x12\x17\n\x0f\x64\x61ta_file_count\x18\n \x01(\x03\x12\x30\n\x0b\x63ompression\x18\x0b \x01(\x0e\x32\x1b.JFJochProtoBuf.Compression\x12\x13\n\x0bsample_name\x18\x0c \x01(\t\x12\x30\n\tunit_cell\x18\r \x01(\x0b\x32\x18.JFJochProtoBuf.UnitCellH\x01\x88\x01\x01\x12\x1a\n\x12space_group_number\x18\x0e \x01(\x03\x12\x36\n\x11scattering_vector\x18\x0f \x01(\x0b\x32\x16.JFJochProtoBuf.VectorH\x02\x88\x01\x01\x12\x18\n\x10\x61pply_pixel_mask\x18\x10 \x01(\x08\x12\x12\n\nbinning2x2\x18\x11 \x01(\x08\x42\x08\n\x06timingB\x0c\n\n_unit_cellB\x14\n\x12_scattering_vector\"\xf6\x02\n\x10\x44\x65tectorSettings\x12\x15\n\rframe_time_us\x18\x01 \x01(\x03\x12\x1a\n\rcount_time_us\x18\x02 \x01(\x03H\x00\x88\x01\x01\x12\x19\n\x11use_storage_cells\x18\x03 \x01(\x08\x12%\n\x1duse_internal_packet_generator\x18\x04 \x01(\x08\x12\x18\n\x10\x63ollect_raw_data\x18\x05 \x01(\x08\x12\x1f\n\x12pedestal_g0_frames\x18\x06 \x01(\x03H\x01\x88\x01\x01\x12\x1f\n\x12pedestal_g1_frames\x18\x07 \x01(\x03H\x02\x88\x01\x01\x12\x1f\n\x12pedestal_g2_frames\x18\x08 \x01(\x03H\x03\x88\x01\x01\x12\x19\n\x11\x63onversion_on_cpu\x18\t \x01(\x08\x42\x10\n\x0e_count_time_usB\x15\n\x13_pedestal_g0_framesB\x15\n\x13_pedestal_g1_framesB\x15\n\x13_pedestal_g2_frames\"b\n\x16\x44\x65tectorModuleGeometry\x12\x0e\n\x06pixel0\x18\x01 \x01(\x03\x12\x1b\n\x13\x66\x61st_direction_step\x18\x02 \x01(\x03\x12\x1b\n\x13slow_direction_step\x18\x03 \x01(\x03\"z\n\x10\x44\x65tectorGeometry\x12\x11\n\twidth_pxl\x18\x01 \x01(\x03\x12\x12\n\nheight_pxl\x18\x02 \x01(\x03\x12?\n\x0fmodule_geometry\x18\x03 \x03(\x0b\x32&.JFJochProtoBuf.DetectorModuleGeometry\"\xc1\x01\n\x08\x44\x65tector\x12\x10\n\x08nmodules\x18\x01 \x01(\x03\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x15\n\rpixel_size_mm\x18\x03 \x01(\x02\x12\x17\n\x0fmodule_hostname\x18\x04 \x03(\t\x12\x32\n\x08geometry\x18\x05 \x01(\x0b\x32 .JFJochProtoBuf.DetectorGeometry\x12*\n\x04type\x18\x06 \x01(\x0e\x32\x1c.JFJochProtoBuf.DetectorType\"\xf5\x05\n\x10InternalSettings\x12\"\n\x1a\x66rame_time_pedestalG1G2_us\x18\x01 \x01(\x03\x12\x15\n\rframe_time_us\x18\x03 \x01(\x03\x12\x15\n\rcount_time_us\x18\x04 \x01(\x03\x12*\n\x08\x64\x65tector\x18\x05 \x01(\x0b\x32\x18.JFJochProtoBuf.Detector\x12\x14\n\x0cndatastreams\x18\x06 \x01(\x03\x12&\n\x1einternal_fpga_packet_generator\x18\t \x01(\x08\x12\x15\n\rstorage_cells\x18\n \x01(\x03\x12\x1a\n\x12storage_cell_start\x18\x0b \x01(\x03\x12\x1a\n\x12pedestal_g0_frames\x18\x0c \x01(\x03\x12\x1a\n\x12pedestal_g1_frames\x18\r \x01(\x03\x12\x1a\n\x12pedestal_g2_frames\x18\x0e \x01(\x03\x12\x19\n\x11preview_period_us\x18\x0f \x01(\x03\x12\x1e\n\x16spot_finding_period_us\x18\x10 \x01(\x03\x12*\n\x04mode\x18\x13 \x01(\x0e\x32\x1c.JFJochProtoBuf.DetectorMode\x12\x19\n\x11mask_module_edges\x18\x14 \x01(\x08\x12\x17\n\x0fmask_chip_edges\x18\x15 \x01(\x08\x12\x13\n\x0bipv4_subnet\x18\x16 \x01(\x03\x12\x15\n\rbase_udp_port\x18\x17 \x01(\x03\x12\r\n\x05low_q\x18\x1a \x01(\x02\x12\x0e\n\x06high_q\x18\x1b \x01(\x02\x12\x11\n\tq_spacing\x18\x1c \x01(\x02\x12\x10\n\x08git_sha1\x18\x1d \x01(\t\x12\x10\n\x08git_date\x18\x1e \x01(\t\x12\x19\n\x11\x63onversion_on_cpu\x18\x1f \x01(\x08\x12\x13\n\x0bsource_name\x18 \x01(\t\x12\x19\n\x11source_name_short\x18! \x01(\t\x12\x17\n\x0finstrument_name\x18\" \x01(\t\x12\x1d\n\x15instrument_name_short\x18# \x01(\t\"|\n\x14JungfraujochSettings\x12\x30\n\x07\x64\x61taset\x18\x01 \x01(\x0b\x32\x1f.JFJochProtoBuf.DatasetSettings\x12\x32\n\x08internal\x18\x02 \x01(\x0b\x32 .JFJochProtoBuf.InternalSettings\"\x1e\n\nJFPedestal\x12\x10\n\x08pedestal\x18\x01 \x01(\x0c\"-\n\x11JFGainCalibration\x12\x18\n\x10gain_calibration\x18\x01 \x01(\x0c\"\xb2\x01\n\rJFCalibration\x12\x10\n\x08nmodules\x18\x01 \x01(\x04\x12\x16\n\x0enstorage_cells\x18\x02 \x01(\x04\x12,\n\x08pedestal\x18\x03 \x03(\x0b\x32\x1a.JFJochProtoBuf.JFPedestal\x12\x0c\n\x04mask\x18\x04 \x01(\x0c\x12;\n\x10gain_calibration\x18\x05 \x03(\x0b\x32!.JFJochProtoBuf.JFGainCalibration\"V\n\x17JFCalibrationStatistics\x12;\n\x11module_statistics\x18\x01 \x03(\x0b\x32 .JFJochProtoBuf.ModuleStatistics\"\xe1\x03\n\x1b\x41\x63quisitionDeviceStatistics\x12\x14\n\x0cgood_packets\x18\x01 \x01(\x04\x12-\n%packets_expected_per_module_and_frame\x18\x02 \x01(\x04\x12-\n%packets_received_per_module_and_frame\x18\x03 \x03(\x04\x12\x12\n\nefficiency\x18\x04 \x01(\x02\x12\x16\n\x0e\x62ytes_received\x18\x05 \x01(\x04\x12\x17\n\x0fstart_timestamp\x18\x06 \x01(\x04\x12\x15\n\rend_timestamp\x18\x07 \x01(\x04\x12/\n\x0b\x66pga_status\x18\x08 \x01(\x0b\x32\x1a.JFJochProtoBuf.FPGAStatus\x12\x10\n\x08nmodules\x18\t \x01(\x04\x12\x13\n\x0bpacket_mask\x18\n \x03(\x04\x12\x1f\n\x17mask_entries_per_module\x18\x0b \x01(\x04\x12\x18\n\x10packets_expected\x18\x0c \x01(\x04\x12\x11\n\ttimestamp\x18\r \x03(\r\x12\x16\n\x0e\x64\x65tector_debug\x18\x0e \x03(\r\x12\x0f\n\x07\x62unchid\x18\x0f \x03(\x04\x12#\n\x1bpackets_received_per_module\x18\x10 \x03(\x04\"\x88\x01\n\rReceiverInput\x12\x43\n\x15jungfraujoch_settings\x18\x01 \x01(\x0b\x32$.JFJochProtoBuf.JungfraujochSettings\x12\x32\n\x0b\x63\x61libration\x18\x02 \x01(\x0b\x32\x1d.JFJochProtoBuf.JFCalibration\"\xaa\x03\n\x0eReceiverOutput\x12\x46\n\x11\x64\x65vice_statistics\x18\x01 \x03(\x0b\x32+.JFJochProtoBuf.AcquisitionDeviceStatistics\x12\x19\n\x11max_receive_delay\x18\x02 \x01(\x04\x12\x17\n\x0f\x63ompressed_size\x18\x03 \x01(\x04\x12\x18\n\x10\x63ompressed_ratio\x18\x04 \x01(\x02\x12\x13\n\x0bimages_sent\x18\x05 \x01(\x04\x12\x15\n\rstart_time_ms\x18\x06 \x01(\x04\x12\x13\n\x0b\x65nd_time_ms\x18\x07 \x01(\x04\x12\x12\n\nefficiency\x18\x08 \x01(\x02\x12\x1d\n\x15max_image_number_sent\x18\t \x01(\x04\x12\x11\n\tcancelled\x18\n \x01(\x08\x12\x18\n\x10master_file_name\x18\x0b \x01(\t\x12\x33\n\x0fpedestal_result\x18\x0c \x03(\x0b\x32\x1a.JFJochProtoBuf.JFPedestal\x12\x1a\n\rindexing_rate\x18\r \x01(\x02H\x00\x88\x01\x01\x42\x10\n\x0e_indexing_rate\".\n\x15ReceiverNetworkConfig\x12\x15\n\rfpga_mac_addr\x18\x01 \x03(\t\"\x93\x01\n\x0eReceiverStatus\x12\x15\n\x08progress\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12/\n\x0b\x66pga_status\x18\x02 \x03(\x0b\x32\x1a.JFJochProtoBuf.FPGAStatus\x12\x1a\n\rindexing_rate\x18\x03 \x01(\x02H\x01\x88\x01\x01\x42\x0b\n\t_progressB\x10\n\x0e_indexing_rate\"\xd2\x01\n\x1bReceiverDataProcessingPlots\x12*\n\x0c\x62kg_estimate\x18\x01 \x01(\x0b\x32\x14.JFJochProtoBuf.Plot\x12\x30\n\x12radial_int_profile\x18\x02 \x01(\x0b\x32\x14.JFJochProtoBuf.Plot\x12(\n\nspot_count\x18\x03 \x01(\x0b\x32\x14.JFJochProtoBuf.Plot\x12+\n\rindexing_rate\x18\x04 \x01(\x0b\x32\x14.JFJochProtoBuf.Plot\">\n\x0bWriterInput\x12\x1c\n\x14zmq_receiver_address\x18\x01 \x01(\t\x12\x11\n\tseries_id\x18\x02 \x01(\x03\"P\n\x0cWriterOutput\x12\x0f\n\x07nimages\x18\x01 \x01(\x03\x12\x17\n\x0fperformance_MBs\x18\x02 \x01(\x02\x12\x16\n\x0eperformance_Hz\x18\x03 \x01(\x02\"\x82\x02\n\x14\x44\x65tectorModuleConfig\x12\x17\n\x0fudp_dest_port_1\x18\x01 \x01(\x04\x12\x17\n\x0fudp_dest_port_2\x18\x02 \x01(\x04\x12\x17\n\x0fipv4_src_addr_1\x18\x03 \x01(\t\x12\x17\n\x0fipv4_src_addr_2\x18\x04 \x01(\t\x12\x18\n\x10ipv4_dest_addr_1\x18\x05 \x01(\t\x12\x18\n\x10ipv4_dest_addr_2\x18\x06 \x01(\t\x12\x17\n\x0fmac_addr_dest_1\x18\x07 \x01(\t\x12\x17\n\x0fmac_addr_dest_2\x18\x08 \x01(\t\x12 \n\x18module_id_in_data_stream\x18\t \x01(\x04\"`\n\x0e\x44\x65tectorConfig\x12\x35\n\x07modules\x18\x01 \x03(\x0b\x32$.JFJochProtoBuf.DetectorModuleConfig\x12\x17\n\x0fmodule_hostname\x18\x02 \x03(\t\"\xf9\x01\n\rDetectorInput\x12\x13\n\x0bmodules_num\x18\x01 \x01(\x03\x12*\n\x04mode\x18\x02 \x01(\x0e\x32\x1c.JFJochProtoBuf.DetectorMode\x12\x12\n\nnum_frames\x18\x03 \x01(\x03\x12\x14\n\x0cnum_triggers\x18\x04 \x01(\x03\x12\x1b\n\x13storage_cell_number\x18\x05 \x01(\x03\x12\x1a\n\x12storage_cell_start\x18\x06 \x01(\x03\x12\x1a\n\x12storage_cell_delay\x18\x07 \x01(\x03\x12\x11\n\tperiod_us\x18\t \x01(\x03\x12\x15\n\rcount_time_us\x18\n \x01(\x03\"\x10\n\x0e\x44\x65tectorOutput\"b\n\x0e\x44\x65tectorStatus\x12$\n\x05state\x18\x01 \x01(\x0e\x32\x15.JFJochProtoBuf.State\x12\x12\n\nfw_version\x18\x02 \x01(\x03\x12\x16\n\x0eserver_version\x18\x03 \x01(\t\"\xae\x08\n\nFPGAStatus\x12\x15\n\rpackets_ether\x18\x02 \x01(\x04\x12\x13\n\x0bpackets_udp\x18\x03 \x01(\x04\x12\x16\n\x0epackets_jfjoch\x18\x04 \x01(\x04\x12\x14\n\x0cpackets_icmp\x18\x05 \x01(\x04\x12\x11\n\tfpga_idle\x18\x06 \x01(\x08\x12\x17\n\x0fhbm_temp_0_degC\x18\x07 \x01(\x04\x12\x17\n\x0fhbm_temp_1_degC\x18\x08 \x01(\x04\x12\x12\n\nstalls_hbm\x18\t \x01(\x04\x12\x13\n\x0bstalls_host\x18\n \x01(\x04\x12\x1b\n\x13\x65thernet_rx_aligned\x18\x0b \x01(\x08\x12\x1c\n\x14\x66ull_status_register\x18\r \x01(\r\x12?\n\x0b\x66ifo_status\x18\x0e \x03(\x0b\x32*.JFJochProtoBuf.FPGAStatus.FifoStatusEntry\x12\x13\n\x0bmax_modules\x18\x0f \x01(\x04\x12\x10\n\x08git_sha1\x18\x10 \x01(\r\x12\x17\n\x0fmailbox_err_reg\x18\x11 \x01(\r\x12\x1a\n\x12mailbox_status_reg\x18\x12 \x01(\r\x12\x1c\n\x14\x64\x61tamover_mm2s_error\x18\x13 \x01(\x08\x12\x1c\n\x14\x64\x61tamover_s2mm_error\x18\x14 \x01(\x08\x12&\n\x1e\x66rame_statistics_alignment_err\x18\x15 \x01(\x08\x12\"\n\x1a\x66rame_statistics_tlast_err\x18\x16 \x01(\x08\x12%\n\x1d\x66rame_statistics_work_req_err\x18\x17 \x01(\x08\x12\x14\n\x0cslowest_head\x18\x18 \x01(\x04\x12\x16\n\x0e\x66pga_temp_degC\x18\x1a \x01(\x02\x12\x1a\n\x12\x63urrent_edge_12V_A\x18\x1b \x01(\x02\x12\x1a\n\x12voltage_edge_12V_V\x18\x1c \x01(\x02\x12\x1b\n\x13\x63urrent_edge_3p3V_A\x18\x1d \x01(\x02\x12\x1b\n\x13voltage_edge_3p3V_V\x18\x1e \x01(\x02\x12\x1c\n\x14pcie_h2c_descriptors\x18\x1f \x01(\x04\x12\x1c\n\x14pcie_c2h_descriptors\x18 \x01(\x04\x12\x16\n\x0epcie_h2c_beats\x18! \x01(\x04\x12\x16\n\x0epcie_c2h_beats\x18\" \x01(\x04\x12\x17\n\x0fpcie_h2c_status\x18# \x01(\x04\x12\x17\n\x0fpcie_c2h_status\x18$ \x01(\x04\x12\x13\n\x0bpackets_sls\x18% \x01(\x04\x12\x11\n\terror_eth\x18& \x01(\r\x12\x18\n\x10\x65rror_packet_len\x18\' \x01(\r\x1aQ\n\x0f\x46ifoStatusEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12-\n\x05value\x18\x02 \x01(\x0e\x32\x1e.JFJochProtoBuf.FPGAFIFOStatus:\x02\x38\x01\"I\n\x1aIndexerDataProcessingPlots\x12+\n\rindexing_rate\x18\x01 \x01(\x0b\x32\x14.JFJochProtoBuf.Plot\"\x8a\x03\n\x16\x44\x61taProcessingSettings\x12!\n\x19signal_to_noise_threshold\x18\x01 \x01(\x02\x12\x1e\n\x16photon_count_threshold\x18\x02 \x01(\x03\x12\x18\n\x10min_pix_per_spot\x18\x03 \x01(\x03\x12\x18\n\x10max_pix_per_spot\x18\x04 \x01(\x03\x12\x16\n\x0elocal_bkg_size\x18\x05 \x01(\x03\x12\"\n\x15high_resolution_limit\x18\x06 \x01(\x02H\x00\x88\x01\x01\x12!\n\x14low_resolution_limit\x18\x07 \x01(\x02H\x01\x88\x01\x01\x12\x1a\n\x12\x62kg_estimate_low_q\x18\x08 \x01(\x02\x12\x1b\n\x13\x62kg_estimate_high_q\x18\t \x01(\x02\x12\x1b\n\x0eresult_binning\x18\n \x01(\x03H\x02\x88\x01\x01\x42\x18\n\x16_high_resolution_limitB\x17\n\x15_low_resolution_limitB\x11\n\x0f_result_binning\"\x8d\x02\n\x0cPreviewFrame\x12\x14\n\x0cimage_number\x18\x01 \x01(\x03\x12\x14\n\x0ctotal_images\x18\x02 \x01(\x03\x12\x14\n\x0cwavelength_A\x18\x03 \x01(\x02\x12\x12\n\nbeam_x_pxl\x18\x04 \x01(\x02\x12\x12\n\nbeam_y_pxl\x18\x05 \x01(\x02\x12\x1c\n\x14\x64\x65tector_distance_mm\x18\x06 \x01(\x02\x12\x18\n\x10saturation_value\x18\x07 \x01(\x03\x12\x13\n\x0b\x66ile_prefix\x18\x08 \x01(\t\x12\r\n\x05width\x18\t \x01(\x03\x12\x0e\n\x06height\x18\n \x01(\x03\x12\x13\n\x0bpixel_depth\x18\x0b \x01(\x03\x12\x0c\n\x04\x64\x61ta\x18\r \x01(\x0cJ\x04\x08\x0c\x10\r\"\xed\x01\n\x10ModuleStatistics\x12\x15\n\rmodule_number\x18\x01 \x01(\x03\x12\x1b\n\x13storage_cell_number\x18\x02 \x01(\x03\x12\x18\n\x10pedestal_g0_mean\x18\x03 \x01(\x02\x12\x18\n\x10pedestal_g1_mean\x18\x04 \x01(\x02\x12\x18\n\x10pedestal_g2_mean\x18\x05 \x01(\x02\x12\x14\n\x0cgain_g0_mean\x18\x06 \x01(\x02\x12\x14\n\x0cgain_g1_mean\x18\x07 \x01(\x02\x12\x14\n\x0cgain_g2_mean\x18\x08 \x01(\x02\x12\x15\n\rmasked_pixels\x18\t \x01(\x04\"I\n\x05Image\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x12\r\n\x05width\x18\x02 \x01(\x03\x12\x0e\n\x06height\x18\x03 \x01(\x03\x12\x13\n\x0bpixel_depth\x18\x04 \x01(\x03\".\n\nMaskToLoad\x12\x0c\n\x04mask\x18\x01 \x03(\r\x12\x12\n\nbit_to_set\x18\x02 \x01(\x05\"\xfc\x03\n\x15MeasurementStatistics\x12\x13\n\x0b\x66ile_prefix\x18\x01 \x01(\t\x12\x18\n\x10images_collected\x18\x02 \x01(\x03\x12\x1d\n\x15max_image_number_sent\x18\x03 \x01(\x03\x12\x1d\n\x15\x63ollection_efficiency\x18\x04 \x01(\x02\x12\x19\n\x11\x63ompression_ratio\x18\x05 \x01(\x02\x12\x11\n\tcancelled\x18\x06 \x01(\x08\x12\x19\n\x11max_receive_delay\x18\x07 \x01(\x03\x12#\n\x16writer_performance_MBs\x18\x08 \x01(\x02H\x00\x88\x01\x01\x12\x1b\n\x0eimages_written\x18\t \x01(\x03H\x01\x88\x01\x01\x12\x1a\n\rindexing_rate\x18\n \x01(\x02H\x02\x88\x01\x01\x12$\n\x17indexing_performance_ms\x18\x0b \x01(\x02H\x03\x88\x01\x01\x12\x16\n\x0e\x64\x65tector_width\x18\x0c \x01(\x03\x12\x17\n\x0f\x64\x65tector_height\x18\r \x01(\x03\x12\x1c\n\x14\x64\x65tector_pixel_depth\x18\x0e \x01(\x03\x42\x19\n\x17_writer_performance_MBsB\x11\n\x0f_images_writtenB\x10\n\x0e_indexing_rateB\x1a\n\x18_indexing_performance_ms\"\x8d\x01\n\x0c\x42rokerStatus\x12+\n\x0c\x62roker_state\x18\x01 \x01(\x0e\x32\x15.JFJochProtoBuf.State\x12\x15\n\x08progress\x18\x02 \x01(\x02H\x00\x88\x01\x01\x12\x1a\n\rindexing_rate\x18\x03 \x01(\x02H\x01\x88\x01\x01\x42\x0b\n\t_progressB\x10\n\x0e_indexing_rate\"\xa4\x01\n\x10\x42rokerFullStatus\x12\x30\n\x08receiver\x18\x01 \x01(\x0b\x32\x1e.JFJochProtoBuf.ReceiverOutput\x12\x30\n\x08\x64\x65tector\x18\x02 \x01(\x0b\x32\x1e.JFJochProtoBuf.DetectorOutput\x12,\n\x06writer\x18\x03 \x03(\x0b\x32\x1c.JFJochProtoBuf.WriterOutput\"H\n\x13\x44\x65tectorListElement\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12\x10\n\x08nmodules\x18\x02 \x01(\x03\x12\n\n\x02id\x18\x03 \x01(\x03\"v\n\x0c\x44\x65tectorList\x12\x35\n\x08\x64\x65tector\x18\x01 \x03(\x0b\x32#.JFJochProtoBuf.DetectorListElement\x12\x12\n\ncurrent_id\x18\x02 \x01(\x03\x12\x1b\n\x13\x63urrent_description\x18\x03 \x01(\t\"\x1f\n\x11\x44\x65tectorSelection\x12\n\n\x02id\x18\x01 \x01(\x03*T\n\x0b\x43ompression\x12\r\n\tBSHUF_LZ4\x10\x00\x12\x0e\n\nBSHUF_ZSTD\x10\x01\x12\x12\n\x0e\x42SHUF_ZSTD_RLE\x10\x02\x12\x12\n\x0eNO_COMPRESSION\x10\x03*\'\n\x0c\x44\x65tectorType\x12\x0c\n\x08JUNGFRAU\x10\x00\x12\t\n\x05\x45IGER\x10\x01*Z\n\x0c\x44\x65tectorMode\x12\x0e\n\nCONVERSION\x10\x00\x12\x07\n\x03RAW\x10\x01\x12\x0f\n\x0bPEDESTAL_G0\x10\x02\x12\x0f\n\x0bPEDESTAL_G1\x10\x03\x12\x0f\n\x0bPEDESTAL_G2\x10\x04*2\n\x0e\x46PGAFIFOStatus\x12\t\n\x05\x45MPTY\x10\x00\x12\x08\n\x04\x46ULL\x10\x01\x12\x0b\n\x07PARTIAL\x10\x02*^\n\x05State\x12\x13\n\x0fNOT_INITIALIZED\x10\x00\x12\x08\n\x04IDLE\x10\x01\x12\x08\n\x04\x42USY\x10\x02\x12\x0c\n\x08PEDESTAL\x10\x03\x12\x13\n\x0f\x44\x41TA_COLLECTION\x10\x04\x12\t\n\x05\x45RROR\x10\x05\x32\xac\x05\n\x13gRPC_JFJochReceiver\x12?\n\x05Start\x12\x1d.JFJochProtoBuf.ReceiverInput\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x37\n\x05\x41\x62ort\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x38\n\x06\x43\x61ncel\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12?\n\x04Stop\x12\x15.JFJochProtoBuf.Empty\x1a\x1e.JFJochProtoBuf.ReceiverOutput\"\x00\x12\x44\n\tGetStatus\x12\x15.JFJochProtoBuf.Empty\x1a\x1e.JFJochProtoBuf.ReceiverStatus\"\x00\x12\\\n\x19SetDataProcessingSettings\x12&.JFJochProtoBuf.DataProcessingSettings\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12^\n\x16GetDataProcessingPlots\x12\x15.JFJochProtoBuf.Empty\x1a+.JFJochProtoBuf.ReceiverDataProcessingPlots\"\x00\x12H\n\x0fGetPreviewFrame\x12\x15.JFJochProtoBuf.Empty\x1a\x1c.JFJochProtoBuf.PreviewFrame\"\x00\x12R\n\x10GetNetworkConfig\x12\x15.JFJochProtoBuf.Empty\x1a%.JFJochProtoBuf.ReceiverNetworkConfig\"\x00\x32\xca\x01\n\x11gRPC_JFJochWriter\x12=\n\x05Start\x12\x1b.JFJochProtoBuf.WriterInput\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x37\n\x05\x41\x62ort\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12=\n\x04Stop\x12\x15.JFJochProtoBuf.Empty\x1a\x1c.JFJochProtoBuf.WriterOutput\"\x00\x32\x82\x03\n\x13gRPC_JFJochDetector\x12?\n\x05Start\x12\x1d.JFJochProtoBuf.DetectorInput\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x36\n\x04Stop\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x41\n\x06Status\x12\x15.JFJochProtoBuf.Empty\x1a\x1e.JFJochProtoBuf.DetectorStatus\"\x00\x12=\n\x02On\x12\x1e.JFJochProtoBuf.DetectorConfig\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x35\n\x03Off\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x39\n\x07Trigger\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x32\xc6\x0c\n\x11gRPC_JFJochBroker\x12\x41\n\x05Start\x12\x1f.JFJochProtoBuf.DatasetSettings\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x36\n\x04Stop\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12:\n\x08Pedestal\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12<\n\nInitialize\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x38\n\x06\x43\x61ncel\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12<\n\nDeactivate\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x39\n\x07Trigger\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x42\n\tGetStatus\x12\x15.JFJochProtoBuf.Empty\x1a\x1c.JFJochProtoBuf.BrokerStatus\"\x00\x12\\\n\x18GetCalibrationStatistics\x12\x15.JFJochProtoBuf.Empty\x1a\'.JFJochProtoBuf.JFCalibrationStatistics\"\x00\x12P\n\x13GetDetectorSettings\x12\x15.JFJochProtoBuf.Empty\x1a .JFJochProtoBuf.DetectorSettings\"\x00\x12P\n\x13PutDetectorSettings\x12 .JFJochProtoBuf.DetectorSettings\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12Z\n\x18GetMeasurementStatistics\x12\x15.JFJochProtoBuf.Empty\x1a%.JFJochProtoBuf.MeasurementStatistics\"\x00\x12\\\n\x19GetDataProcessingSettings\x12\x15.JFJochProtoBuf.Empty\x1a&.JFJochProtoBuf.DataProcessingSettings\"\x00\x12\\\n\x19PutDataProcessingSettings\x12&.JFJochProtoBuf.DataProcessingSettings\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12P\n\x08GetPlots\x12\x15.JFJochProtoBuf.Empty\x1a+.JFJochProtoBuf.ReceiverDataProcessingPlots\"\x00\x12\x43\n\nGetPreview\x12\x15.JFJochProtoBuf.Empty\x1a\x1c.JFJochProtoBuf.PreviewFrame\"\x00\x12?\n\rGetPedestalG0\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Image\"\x00\x12?\n\rGetPedestalG1\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Image\"\x00\x12?\n\rGetPedestalG2\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Image\"\x00\x12\x39\n\x07GetMask\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Image\"\x00\x12H\n\x0fGetDetectorList\x12\x15.JFJochProtoBuf.Empty\x1a\x1c.JFJochProtoBuf.DetectorList\"\x00\x12L\n\x0eSelectDetector\x12!.JFJochProtoBuf.DetectorSelection\x1a\x15.JFJochProtoBuf.Empty\"\x00\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0cjfjoch.proto\x12\x0eJFJochProtoBuf\"\x07\n\x05\x45mpty\"W\n\x08UnitCell\x12\t\n\x01\x61\x18\x01 \x01(\x02\x12\t\n\x01\x62\x18\x02 \x01(\x02\x12\t\n\x01\x63\x18\x03 \x01(\x02\x12\r\n\x05\x61lpha\x18\x04 \x01(\x02\x12\x0c\n\x04\x62\x65ta\x18\x05 \x01(\x02\x12\r\n\x05gamma\x18\x06 \x01(\x02\")\n\x06Vector\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\x12\t\n\x01z\x18\x03 \x01(\x02\"|\n\x10RotationSettings\x12\x17\n\x0fstart_angle_deg\x18\x01 \x01(\x02\x12 \n\x18\x61ngle_incr_per_image_deg\x18\x02 \x01(\x02\x12-\n\rrotation_axis\x18\x03 \x01(\x0b\x32\x16.JFJochProtoBuf.Vector\"\x1c\n\x04Plot\x12\t\n\x01x\x18\x01 \x03(\x02\x12\t\n\x01y\x18\x02 \x03(\x02\"\xa5\x04\n\x0f\x44\x61tasetSettings\x12\x1a\n\x12images_per_trigger\x18\x01 \x01(\x03\x12\x10\n\x08ntrigger\x18\x02 \x01(\x03\x12\x13\n\tsummation\x18\x03 \x01(\x03H\x00\x12\x17\n\rimage_time_us\x18\x04 \x01(\x03H\x00\x12\x12\n\nbeam_x_pxl\x18\x05 \x01(\x02\x12\x12\n\nbeam_y_pxl\x18\x06 \x01(\x02\x12\x1c\n\x14\x64\x65tector_distance_mm\x18\x07 \x01(\x02\x12\x19\n\x11photon_energy_keV\x18\x08 \x01(\x02\x12\x13\n\x0b\x66ile_prefix\x18\t \x01(\t\x12\x17\n\x0f\x64\x61ta_file_count\x18\n \x01(\x03\x12\x30\n\x0b\x63ompression\x18\x0b \x01(\x0e\x32\x1b.JFJochProtoBuf.Compression\x12\x13\n\x0bsample_name\x18\x0c \x01(\t\x12\x30\n\tunit_cell\x18\r \x01(\x0b\x32\x18.JFJochProtoBuf.UnitCellH\x01\x88\x01\x01\x12\x1a\n\x12space_group_number\x18\x0e \x01(\x03\x12\x36\n\x11scattering_vector\x18\x0f \x01(\x0b\x32\x16.JFJochProtoBuf.VectorH\x02\x88\x01\x01\x12\x18\n\x10\x61pply_pixel_mask\x18\x10 \x01(\x08\x12\x12\n\nbinning2x2\x18\x11 \x01(\x08\x42\x08\n\x06timingB\x0c\n\n_unit_cellB\x14\n\x12_scattering_vector\"\xf6\x02\n\x10\x44\x65tectorSettings\x12\x15\n\rframe_time_us\x18\x01 \x01(\x03\x12\x1a\n\rcount_time_us\x18\x02 \x01(\x03H\x00\x88\x01\x01\x12\x19\n\x11use_storage_cells\x18\x03 \x01(\x08\x12%\n\x1duse_internal_packet_generator\x18\x04 \x01(\x08\x12\x18\n\x10\x63ollect_raw_data\x18\x05 \x01(\x08\x12\x1f\n\x12pedestal_g0_frames\x18\x06 \x01(\x03H\x01\x88\x01\x01\x12\x1f\n\x12pedestal_g1_frames\x18\x07 \x01(\x03H\x02\x88\x01\x01\x12\x1f\n\x12pedestal_g2_frames\x18\x08 \x01(\x03H\x03\x88\x01\x01\x12\x19\n\x11\x63onversion_on_cpu\x18\t \x01(\x08\x42\x10\n\x0e_count_time_usB\x15\n\x13_pedestal_g0_framesB\x15\n\x13_pedestal_g1_framesB\x15\n\x13_pedestal_g2_frames\"b\n\x16\x44\x65tectorModuleGeometry\x12\x0e\n\x06pixel0\x18\x01 \x01(\x03\x12\x1b\n\x13\x66\x61st_direction_step\x18\x02 \x01(\x03\x12\x1b\n\x13slow_direction_step\x18\x03 \x01(\x03\"z\n\x10\x44\x65tectorGeometry\x12\x11\n\twidth_pxl\x18\x01 \x01(\x03\x12\x12\n\nheight_pxl\x18\x02 \x01(\x03\x12?\n\x0fmodule_geometry\x18\x03 \x03(\x0b\x32&.JFJochProtoBuf.DetectorModuleGeometry\"\xc1\x01\n\x08\x44\x65tector\x12\x10\n\x08nmodules\x18\x01 \x01(\x03\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x15\n\rpixel_size_mm\x18\x03 \x01(\x02\x12\x17\n\x0fmodule_hostname\x18\x04 \x03(\t\x12\x32\n\x08geometry\x18\x05 \x01(\x0b\x32 .JFJochProtoBuf.DetectorGeometry\x12*\n\x04type\x18\x06 \x01(\x0e\x32\x1c.JFJochProtoBuf.DetectorType\"\xf5\x05\n\x10InternalSettings\x12\"\n\x1a\x66rame_time_pedestalG1G2_us\x18\x01 \x01(\x03\x12\x15\n\rframe_time_us\x18\x03 \x01(\x03\x12\x15\n\rcount_time_us\x18\x04 \x01(\x03\x12*\n\x08\x64\x65tector\x18\x05 \x01(\x0b\x32\x18.JFJochProtoBuf.Detector\x12\x14\n\x0cndatastreams\x18\x06 \x01(\x03\x12&\n\x1einternal_fpga_packet_generator\x18\t \x01(\x08\x12\x15\n\rstorage_cells\x18\n \x01(\x03\x12\x1a\n\x12storage_cell_start\x18\x0b \x01(\x03\x12\x1a\n\x12pedestal_g0_frames\x18\x0c \x01(\x03\x12\x1a\n\x12pedestal_g1_frames\x18\r \x01(\x03\x12\x1a\n\x12pedestal_g2_frames\x18\x0e \x01(\x03\x12\x19\n\x11preview_period_us\x18\x0f \x01(\x03\x12\x1e\n\x16spot_finding_period_us\x18\x10 \x01(\x03\x12*\n\x04mode\x18\x13 \x01(\x0e\x32\x1c.JFJochProtoBuf.DetectorMode\x12\x19\n\x11mask_module_edges\x18\x14 \x01(\x08\x12\x17\n\x0fmask_chip_edges\x18\x15 \x01(\x08\x12\x13\n\x0bipv4_subnet\x18\x16 \x01(\x03\x12\x15\n\rbase_udp_port\x18\x17 \x01(\x03\x12\r\n\x05low_q\x18\x1a \x01(\x02\x12\x0e\n\x06high_q\x18\x1b \x01(\x02\x12\x11\n\tq_spacing\x18\x1c \x01(\x02\x12\x10\n\x08git_sha1\x18\x1d \x01(\t\x12\x10\n\x08git_date\x18\x1e \x01(\t\x12\x19\n\x11\x63onversion_on_cpu\x18\x1f \x01(\x08\x12\x13\n\x0bsource_name\x18 \x01(\t\x12\x19\n\x11source_name_short\x18! \x01(\t\x12\x17\n\x0finstrument_name\x18\" \x01(\t\x12\x1d\n\x15instrument_name_short\x18# \x01(\t\"|\n\x14JungfraujochSettings\x12\x30\n\x07\x64\x61taset\x18\x01 \x01(\x0b\x32\x1f.JFJochProtoBuf.DatasetSettings\x12\x32\n\x08internal\x18\x02 \x01(\x0b\x32 .JFJochProtoBuf.InternalSettings\"\x1e\n\nJFPedestal\x12\x10\n\x08pedestal\x18\x01 \x01(\x0c\"-\n\x11JFGainCalibration\x12\x18\n\x10gain_calibration\x18\x01 \x01(\x0c\"\xb2\x01\n\rJFCalibration\x12\x10\n\x08nmodules\x18\x01 \x01(\x04\x12\x16\n\x0enstorage_cells\x18\x02 \x01(\x04\x12,\n\x08pedestal\x18\x03 \x03(\x0b\x32\x1a.JFJochProtoBuf.JFPedestal\x12\x0c\n\x04mask\x18\x04 \x01(\x0c\x12;\n\x10gain_calibration\x18\x05 \x03(\x0b\x32!.JFJochProtoBuf.JFGainCalibration\"V\n\x17JFCalibrationStatistics\x12;\n\x11module_statistics\x18\x01 \x03(\x0b\x32 .JFJochProtoBuf.ModuleStatistics\"\xe1\x03\n\x1b\x41\x63quisitionDeviceStatistics\x12\x14\n\x0cgood_packets\x18\x01 \x01(\x04\x12-\n%packets_expected_per_module_and_frame\x18\x02 \x01(\x04\x12-\n%packets_received_per_module_and_frame\x18\x03 \x03(\x04\x12\x12\n\nefficiency\x18\x04 \x01(\x02\x12\x16\n\x0e\x62ytes_received\x18\x05 \x01(\x04\x12\x17\n\x0fstart_timestamp\x18\x06 \x01(\x04\x12\x15\n\rend_timestamp\x18\x07 \x01(\x04\x12/\n\x0b\x66pga_status\x18\x08 \x01(\x0b\x32\x1a.JFJochProtoBuf.FPGAStatus\x12\x10\n\x08nmodules\x18\t \x01(\x04\x12\x13\n\x0bpacket_mask\x18\n \x03(\x04\x12\x1f\n\x17mask_entries_per_module\x18\x0b \x01(\x04\x12\x18\n\x10packets_expected\x18\x0c \x01(\x04\x12\x11\n\ttimestamp\x18\r \x03(\r\x12\x16\n\x0e\x64\x65tector_debug\x18\x0e \x03(\r\x12\x0f\n\x07\x62unchid\x18\x0f \x03(\x04\x12#\n\x1bpackets_received_per_module\x18\x10 \x03(\x04\"\x88\x01\n\rReceiverInput\x12\x43\n\x15jungfraujoch_settings\x18\x01 \x01(\x0b\x32$.JFJochProtoBuf.JungfraujochSettings\x12\x32\n\x0b\x63\x61libration\x18\x02 \x01(\x0b\x32\x1d.JFJochProtoBuf.JFCalibration\"\xaa\x03\n\x0eReceiverOutput\x12\x46\n\x11\x64\x65vice_statistics\x18\x01 \x03(\x0b\x32+.JFJochProtoBuf.AcquisitionDeviceStatistics\x12\x19\n\x11max_receive_delay\x18\x02 \x01(\x04\x12\x17\n\x0f\x63ompressed_size\x18\x03 \x01(\x04\x12\x18\n\x10\x63ompressed_ratio\x18\x04 \x01(\x02\x12\x13\n\x0bimages_sent\x18\x05 \x01(\x04\x12\x15\n\rstart_time_ms\x18\x06 \x01(\x04\x12\x13\n\x0b\x65nd_time_ms\x18\x07 \x01(\x04\x12\x12\n\nefficiency\x18\x08 \x01(\x02\x12\x1d\n\x15max_image_number_sent\x18\t \x01(\x04\x12\x11\n\tcancelled\x18\n \x01(\x08\x12\x18\n\x10master_file_name\x18\x0b \x01(\t\x12\x33\n\x0fpedestal_result\x18\x0c \x03(\x0b\x32\x1a.JFJochProtoBuf.JFPedestal\x12\x1a\n\rindexing_rate\x18\r \x01(\x02H\x00\x88\x01\x01\x42\x10\n\x0e_indexing_rate\"T\n\x1bReceiverNetworkConfigDevice\x12\x10\n\x08mac_addr\x18\x01 \x01(\t\x12\x11\n\tipv4_addr\x18\x02 \x01(\t\x12\x10\n\x08udp_port\x18\x03 \x01(\x04\"T\n\x15ReceiverNetworkConfig\x12;\n\x06\x64\x65vice\x18\x01 \x03(\x0b\x32+.JFJochProtoBuf.ReceiverNetworkConfigDevice\"\x93\x01\n\x0eReceiverStatus\x12\x15\n\x08progress\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12/\n\x0b\x66pga_status\x18\x02 \x03(\x0b\x32\x1a.JFJochProtoBuf.FPGAStatus\x12\x1a\n\rindexing_rate\x18\x03 \x01(\x02H\x01\x88\x01\x01\x42\x0b\n\t_progressB\x10\n\x0e_indexing_rate\"\xd2\x01\n\x1bReceiverDataProcessingPlots\x12*\n\x0c\x62kg_estimate\x18\x01 \x01(\x0b\x32\x14.JFJochProtoBuf.Plot\x12\x30\n\x12radial_int_profile\x18\x02 \x01(\x0b\x32\x14.JFJochProtoBuf.Plot\x12(\n\nspot_count\x18\x03 \x01(\x0b\x32\x14.JFJochProtoBuf.Plot\x12+\n\rindexing_rate\x18\x04 \x01(\x0b\x32\x14.JFJochProtoBuf.Plot\">\n\x0bWriterInput\x12\x1c\n\x14zmq_receiver_address\x18\x01 \x01(\t\x12\x11\n\tseries_id\x18\x02 \x01(\x03\"P\n\x0cWriterOutput\x12\x0f\n\x07nimages\x18\x01 \x01(\x03\x12\x17\n\x0fperformance_MBs\x18\x02 \x01(\x02\x12\x16\n\x0eperformance_Hz\x18\x03 \x01(\x02\"\x82\x02\n\x14\x44\x65tectorModuleConfig\x12\x17\n\x0fudp_dest_port_1\x18\x01 \x01(\x04\x12\x17\n\x0fudp_dest_port_2\x18\x02 \x01(\x04\x12\x17\n\x0fipv4_src_addr_1\x18\x03 \x01(\t\x12\x17\n\x0fipv4_src_addr_2\x18\x04 \x01(\t\x12\x18\n\x10ipv4_dest_addr_1\x18\x05 \x01(\t\x12\x18\n\x10ipv4_dest_addr_2\x18\x06 \x01(\t\x12\x17\n\x0fmac_addr_dest_1\x18\x07 \x01(\t\x12\x17\n\x0fmac_addr_dest_2\x18\x08 \x01(\t\x12 \n\x18module_id_in_data_stream\x18\t \x01(\x04\"`\n\x0e\x44\x65tectorConfig\x12\x35\n\x07modules\x18\x01 \x03(\x0b\x32$.JFJochProtoBuf.DetectorModuleConfig\x12\x17\n\x0fmodule_hostname\x18\x02 \x03(\t\"\xf9\x01\n\rDetectorInput\x12\x13\n\x0bmodules_num\x18\x01 \x01(\x03\x12*\n\x04mode\x18\x02 \x01(\x0e\x32\x1c.JFJochProtoBuf.DetectorMode\x12\x12\n\nnum_frames\x18\x03 \x01(\x03\x12\x14\n\x0cnum_triggers\x18\x04 \x01(\x03\x12\x1b\n\x13storage_cell_number\x18\x05 \x01(\x03\x12\x1a\n\x12storage_cell_start\x18\x06 \x01(\x03\x12\x1a\n\x12storage_cell_delay\x18\x07 \x01(\x03\x12\x11\n\tperiod_us\x18\t \x01(\x03\x12\x15\n\rcount_time_us\x18\n \x01(\x03\"\x10\n\x0e\x44\x65tectorOutput\"b\n\x0e\x44\x65tectorStatus\x12$\n\x05state\x18\x01 \x01(\x0e\x32\x15.JFJochProtoBuf.State\x12\x12\n\nfw_version\x18\x02 \x01(\x03\x12\x16\n\x0eserver_version\x18\x03 \x01(\t\"\xae\x08\n\nFPGAStatus\x12\x15\n\rpackets_ether\x18\x02 \x01(\x04\x12\x13\n\x0bpackets_udp\x18\x03 \x01(\x04\x12\x16\n\x0epackets_jfjoch\x18\x04 \x01(\x04\x12\x14\n\x0cpackets_icmp\x18\x05 \x01(\x04\x12\x11\n\tfpga_idle\x18\x06 \x01(\x08\x12\x17\n\x0fhbm_temp_0_degC\x18\x07 \x01(\x04\x12\x17\n\x0fhbm_temp_1_degC\x18\x08 \x01(\x04\x12\x12\n\nstalls_hbm\x18\t \x01(\x04\x12\x13\n\x0bstalls_host\x18\n \x01(\x04\x12\x1b\n\x13\x65thernet_rx_aligned\x18\x0b \x01(\x08\x12\x1c\n\x14\x66ull_status_register\x18\r \x01(\r\x12?\n\x0b\x66ifo_status\x18\x0e \x03(\x0b\x32*.JFJochProtoBuf.FPGAStatus.FifoStatusEntry\x12\x13\n\x0bmax_modules\x18\x0f \x01(\x04\x12\x10\n\x08git_sha1\x18\x10 \x01(\r\x12\x17\n\x0fmailbox_err_reg\x18\x11 \x01(\r\x12\x1a\n\x12mailbox_status_reg\x18\x12 \x01(\r\x12\x1c\n\x14\x64\x61tamover_mm2s_error\x18\x13 \x01(\x08\x12\x1c\n\x14\x64\x61tamover_s2mm_error\x18\x14 \x01(\x08\x12&\n\x1e\x66rame_statistics_alignment_err\x18\x15 \x01(\x08\x12\"\n\x1a\x66rame_statistics_tlast_err\x18\x16 \x01(\x08\x12%\n\x1d\x66rame_statistics_work_req_err\x18\x17 \x01(\x08\x12\x14\n\x0cslowest_head\x18\x18 \x01(\x04\x12\x16\n\x0e\x66pga_temp_degC\x18\x1a \x01(\x02\x12\x1a\n\x12\x63urrent_edge_12V_A\x18\x1b \x01(\x02\x12\x1a\n\x12voltage_edge_12V_V\x18\x1c \x01(\x02\x12\x1b\n\x13\x63urrent_edge_3p3V_A\x18\x1d \x01(\x02\x12\x1b\n\x13voltage_edge_3p3V_V\x18\x1e \x01(\x02\x12\x1c\n\x14pcie_h2c_descriptors\x18\x1f \x01(\x04\x12\x1c\n\x14pcie_c2h_descriptors\x18 \x01(\x04\x12\x16\n\x0epcie_h2c_beats\x18! \x01(\x04\x12\x16\n\x0epcie_c2h_beats\x18\" \x01(\x04\x12\x17\n\x0fpcie_h2c_status\x18# \x01(\x04\x12\x17\n\x0fpcie_c2h_status\x18$ \x01(\x04\x12\x13\n\x0bpackets_sls\x18% \x01(\x04\x12\x11\n\terror_eth\x18& \x01(\r\x12\x18\n\x10\x65rror_packet_len\x18\' \x01(\r\x1aQ\n\x0f\x46ifoStatusEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12-\n\x05value\x18\x02 \x01(\x0e\x32\x1e.JFJochProtoBuf.FPGAFIFOStatus:\x02\x38\x01\"I\n\x1aIndexerDataProcessingPlots\x12+\n\rindexing_rate\x18\x01 \x01(\x0b\x32\x14.JFJochProtoBuf.Plot\"\x8a\x03\n\x16\x44\x61taProcessingSettings\x12!\n\x19signal_to_noise_threshold\x18\x01 \x01(\x02\x12\x1e\n\x16photon_count_threshold\x18\x02 \x01(\x03\x12\x18\n\x10min_pix_per_spot\x18\x03 \x01(\x03\x12\x18\n\x10max_pix_per_spot\x18\x04 \x01(\x03\x12\x16\n\x0elocal_bkg_size\x18\x05 \x01(\x03\x12\"\n\x15high_resolution_limit\x18\x06 \x01(\x02H\x00\x88\x01\x01\x12!\n\x14low_resolution_limit\x18\x07 \x01(\x02H\x01\x88\x01\x01\x12\x1a\n\x12\x62kg_estimate_low_q\x18\x08 \x01(\x02\x12\x1b\n\x13\x62kg_estimate_high_q\x18\t \x01(\x02\x12\x1b\n\x0eresult_binning\x18\n \x01(\x03H\x02\x88\x01\x01\x42\x18\n\x16_high_resolution_limitB\x17\n\x15_low_resolution_limitB\x11\n\x0f_result_binning\"\x8d\x02\n\x0cPreviewFrame\x12\x14\n\x0cimage_number\x18\x01 \x01(\x03\x12\x14\n\x0ctotal_images\x18\x02 \x01(\x03\x12\x14\n\x0cwavelength_A\x18\x03 \x01(\x02\x12\x12\n\nbeam_x_pxl\x18\x04 \x01(\x02\x12\x12\n\nbeam_y_pxl\x18\x05 \x01(\x02\x12\x1c\n\x14\x64\x65tector_distance_mm\x18\x06 \x01(\x02\x12\x18\n\x10saturation_value\x18\x07 \x01(\x03\x12\x13\n\x0b\x66ile_prefix\x18\x08 \x01(\t\x12\r\n\x05width\x18\t \x01(\x03\x12\x0e\n\x06height\x18\n \x01(\x03\x12\x13\n\x0bpixel_depth\x18\x0b \x01(\x03\x12\x0c\n\x04\x64\x61ta\x18\r \x01(\x0cJ\x04\x08\x0c\x10\r\"\xed\x01\n\x10ModuleStatistics\x12\x15\n\rmodule_number\x18\x01 \x01(\x03\x12\x1b\n\x13storage_cell_number\x18\x02 \x01(\x03\x12\x18\n\x10pedestal_g0_mean\x18\x03 \x01(\x02\x12\x18\n\x10pedestal_g1_mean\x18\x04 \x01(\x02\x12\x18\n\x10pedestal_g2_mean\x18\x05 \x01(\x02\x12\x14\n\x0cgain_g0_mean\x18\x06 \x01(\x02\x12\x14\n\x0cgain_g1_mean\x18\x07 \x01(\x02\x12\x14\n\x0cgain_g2_mean\x18\x08 \x01(\x02\x12\x15\n\rmasked_pixels\x18\t \x01(\x04\"I\n\x05Image\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x12\r\n\x05width\x18\x02 \x01(\x03\x12\x0e\n\x06height\x18\x03 \x01(\x03\x12\x13\n\x0bpixel_depth\x18\x04 \x01(\x03\".\n\nMaskToLoad\x12\x0c\n\x04mask\x18\x01 \x03(\r\x12\x12\n\nbit_to_set\x18\x02 \x01(\x05\"\xfc\x03\n\x15MeasurementStatistics\x12\x13\n\x0b\x66ile_prefix\x18\x01 \x01(\t\x12\x18\n\x10images_collected\x18\x02 \x01(\x03\x12\x1d\n\x15max_image_number_sent\x18\x03 \x01(\x03\x12\x1d\n\x15\x63ollection_efficiency\x18\x04 \x01(\x02\x12\x19\n\x11\x63ompression_ratio\x18\x05 \x01(\x02\x12\x11\n\tcancelled\x18\x06 \x01(\x08\x12\x19\n\x11max_receive_delay\x18\x07 \x01(\x03\x12#\n\x16writer_performance_MBs\x18\x08 \x01(\x02H\x00\x88\x01\x01\x12\x1b\n\x0eimages_written\x18\t \x01(\x03H\x01\x88\x01\x01\x12\x1a\n\rindexing_rate\x18\n \x01(\x02H\x02\x88\x01\x01\x12$\n\x17indexing_performance_ms\x18\x0b \x01(\x02H\x03\x88\x01\x01\x12\x16\n\x0e\x64\x65tector_width\x18\x0c \x01(\x03\x12\x17\n\x0f\x64\x65tector_height\x18\r \x01(\x03\x12\x1c\n\x14\x64\x65tector_pixel_depth\x18\x0e \x01(\x03\x42\x19\n\x17_writer_performance_MBsB\x11\n\x0f_images_writtenB\x10\n\x0e_indexing_rateB\x1a\n\x18_indexing_performance_ms\"\x8d\x01\n\x0c\x42rokerStatus\x12+\n\x0c\x62roker_state\x18\x01 \x01(\x0e\x32\x15.JFJochProtoBuf.State\x12\x15\n\x08progress\x18\x02 \x01(\x02H\x00\x88\x01\x01\x12\x1a\n\rindexing_rate\x18\x03 \x01(\x02H\x01\x88\x01\x01\x42\x0b\n\t_progressB\x10\n\x0e_indexing_rate\"\xa4\x01\n\x10\x42rokerFullStatus\x12\x30\n\x08receiver\x18\x01 \x01(\x0b\x32\x1e.JFJochProtoBuf.ReceiverOutput\x12\x30\n\x08\x64\x65tector\x18\x02 \x01(\x0b\x32\x1e.JFJochProtoBuf.DetectorOutput\x12,\n\x06writer\x18\x03 \x03(\x0b\x32\x1c.JFJochProtoBuf.WriterOutput\"H\n\x13\x44\x65tectorListElement\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12\x10\n\x08nmodules\x18\x02 \x01(\x03\x12\n\n\x02id\x18\x03 \x01(\x03\"v\n\x0c\x44\x65tectorList\x12\x35\n\x08\x64\x65tector\x18\x01 \x03(\x0b\x32#.JFJochProtoBuf.DetectorListElement\x12\x12\n\ncurrent_id\x18\x02 \x01(\x03\x12\x1b\n\x13\x63urrent_description\x18\x03 \x01(\t\"\x1f\n\x11\x44\x65tectorSelection\x12\n\n\x02id\x18\x01 \x01(\x03*T\n\x0b\x43ompression\x12\r\n\tBSHUF_LZ4\x10\x00\x12\x0e\n\nBSHUF_ZSTD\x10\x01\x12\x12\n\x0e\x42SHUF_ZSTD_RLE\x10\x02\x12\x12\n\x0eNO_COMPRESSION\x10\x03*\'\n\x0c\x44\x65tectorType\x12\x0c\n\x08JUNGFRAU\x10\x00\x12\t\n\x05\x45IGER\x10\x01*Z\n\x0c\x44\x65tectorMode\x12\x0e\n\nCONVERSION\x10\x00\x12\x07\n\x03RAW\x10\x01\x12\x0f\n\x0bPEDESTAL_G0\x10\x02\x12\x0f\n\x0bPEDESTAL_G1\x10\x03\x12\x0f\n\x0bPEDESTAL_G2\x10\x04*2\n\x0e\x46PGAFIFOStatus\x12\t\n\x05\x45MPTY\x10\x00\x12\x08\n\x04\x46ULL\x10\x01\x12\x0b\n\x07PARTIAL\x10\x02*^\n\x05State\x12\x13\n\x0fNOT_INITIALIZED\x10\x00\x12\x08\n\x04IDLE\x10\x01\x12\x08\n\x04\x42USY\x10\x02\x12\x0c\n\x08PEDESTAL\x10\x03\x12\x13\n\x0f\x44\x41TA_COLLECTION\x10\x04\x12\t\n\x05\x45RROR\x10\x05\x32\xac\x05\n\x13gRPC_JFJochReceiver\x12?\n\x05Start\x12\x1d.JFJochProtoBuf.ReceiverInput\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x37\n\x05\x41\x62ort\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x38\n\x06\x43\x61ncel\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12?\n\x04Stop\x12\x15.JFJochProtoBuf.Empty\x1a\x1e.JFJochProtoBuf.ReceiverOutput\"\x00\x12\x44\n\tGetStatus\x12\x15.JFJochProtoBuf.Empty\x1a\x1e.JFJochProtoBuf.ReceiverStatus\"\x00\x12\\\n\x19SetDataProcessingSettings\x12&.JFJochProtoBuf.DataProcessingSettings\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12^\n\x16GetDataProcessingPlots\x12\x15.JFJochProtoBuf.Empty\x1a+.JFJochProtoBuf.ReceiverDataProcessingPlots\"\x00\x12H\n\x0fGetPreviewFrame\x12\x15.JFJochProtoBuf.Empty\x1a\x1c.JFJochProtoBuf.PreviewFrame\"\x00\x12R\n\x10GetNetworkConfig\x12\x15.JFJochProtoBuf.Empty\x1a%.JFJochProtoBuf.ReceiverNetworkConfig\"\x00\x32\xca\x01\n\x11gRPC_JFJochWriter\x12=\n\x05Start\x12\x1b.JFJochProtoBuf.WriterInput\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x37\n\x05\x41\x62ort\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12=\n\x04Stop\x12\x15.JFJochProtoBuf.Empty\x1a\x1c.JFJochProtoBuf.WriterOutput\"\x00\x32\x82\x03\n\x13gRPC_JFJochDetector\x12?\n\x05Start\x12\x1d.JFJochProtoBuf.DetectorInput\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x36\n\x04Stop\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x41\n\x06Status\x12\x15.JFJochProtoBuf.Empty\x1a\x1e.JFJochProtoBuf.DetectorStatus\"\x00\x12=\n\x02On\x12\x1e.JFJochProtoBuf.DetectorConfig\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x35\n\x03Off\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x39\n\x07Trigger\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x32\xc6\x0c\n\x11gRPC_JFJochBroker\x12\x41\n\x05Start\x12\x1f.JFJochProtoBuf.DatasetSettings\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x36\n\x04Stop\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12:\n\x08Pedestal\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12<\n\nInitialize\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x38\n\x06\x43\x61ncel\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12<\n\nDeactivate\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x39\n\x07Trigger\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x42\n\tGetStatus\x12\x15.JFJochProtoBuf.Empty\x1a\x1c.JFJochProtoBuf.BrokerStatus\"\x00\x12\\\n\x18GetCalibrationStatistics\x12\x15.JFJochProtoBuf.Empty\x1a\'.JFJochProtoBuf.JFCalibrationStatistics\"\x00\x12P\n\x13GetDetectorSettings\x12\x15.JFJochProtoBuf.Empty\x1a .JFJochProtoBuf.DetectorSettings\"\x00\x12P\n\x13PutDetectorSettings\x12 .JFJochProtoBuf.DetectorSettings\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12Z\n\x18GetMeasurementStatistics\x12\x15.JFJochProtoBuf.Empty\x1a%.JFJochProtoBuf.MeasurementStatistics\"\x00\x12\\\n\x19GetDataProcessingSettings\x12\x15.JFJochProtoBuf.Empty\x1a&.JFJochProtoBuf.DataProcessingSettings\"\x00\x12\\\n\x19PutDataProcessingSettings\x12&.JFJochProtoBuf.DataProcessingSettings\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12P\n\x08GetPlots\x12\x15.JFJochProtoBuf.Empty\x1a+.JFJochProtoBuf.ReceiverDataProcessingPlots\"\x00\x12\x43\n\nGetPreview\x12\x15.JFJochProtoBuf.Empty\x1a\x1c.JFJochProtoBuf.PreviewFrame\"\x00\x12?\n\rGetPedestalG0\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Image\"\x00\x12?\n\rGetPedestalG1\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Image\"\x00\x12?\n\rGetPedestalG2\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Image\"\x00\x12\x39\n\x07GetMask\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Image\"\x00\x12H\n\x0fGetDetectorList\x12\x15.JFJochProtoBuf.Empty\x1a\x1c.JFJochProtoBuf.DetectorList\"\x00\x12L\n\x0eSelectDetector\x12!.JFJochProtoBuf.DetectorSelection\x1a\x15.JFJochProtoBuf.Empty\"\x00\x62\x06proto3') _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'jfjoch_pb2', globals()) @@ -22,16 +22,16 @@ if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None _FPGASTATUS_FIFOSTATUSENTRY._options = None _FPGASTATUS_FIFOSTATUSENTRY._serialized_options = b'8\001' - _COMPRESSION._serialized_start=8479 - _COMPRESSION._serialized_end=8563 - _DETECTORTYPE._serialized_start=8565 - _DETECTORTYPE._serialized_end=8604 - _DETECTORMODE._serialized_start=8606 - _DETECTORMODE._serialized_end=8696 - _FPGAFIFOSTATUS._serialized_start=8698 - _FPGAFIFOSTATUS._serialized_end=8748 - _STATE._serialized_start=8750 - _STATE._serialized_end=8844 + _COMPRESSION._serialized_start=8603 + _COMPRESSION._serialized_end=8687 + _DETECTORTYPE._serialized_start=8689 + _DETECTORTYPE._serialized_end=8728 + _DETECTORMODE._serialized_start=8730 + _DETECTORMODE._serialized_end=8820 + _FPGAFIFOSTATUS._serialized_start=8822 + _FPGAFIFOSTATUS._serialized_end=8872 + _STATE._serialized_start=8874 + _STATE._serialized_end=8968 _EMPTY._serialized_start=32 _EMPTY._serialized_end=39 _UNITCELL._serialized_start=41 @@ -70,60 +70,62 @@ if _descriptor._USE_C_DESCRIPTORS == False: _RECEIVERINPUT._serialized_end=3533 _RECEIVEROUTPUT._serialized_start=3536 _RECEIVEROUTPUT._serialized_end=3962 - _RECEIVERNETWORKCONFIG._serialized_start=3964 - _RECEIVERNETWORKCONFIG._serialized_end=4010 - _RECEIVERSTATUS._serialized_start=4013 - _RECEIVERSTATUS._serialized_end=4160 - _RECEIVERDATAPROCESSINGPLOTS._serialized_start=4163 - _RECEIVERDATAPROCESSINGPLOTS._serialized_end=4373 - _WRITERINPUT._serialized_start=4375 - _WRITERINPUT._serialized_end=4437 - _WRITEROUTPUT._serialized_start=4439 - _WRITEROUTPUT._serialized_end=4519 - _DETECTORMODULECONFIG._serialized_start=4522 - _DETECTORMODULECONFIG._serialized_end=4780 - _DETECTORCONFIG._serialized_start=4782 - _DETECTORCONFIG._serialized_end=4878 - _DETECTORINPUT._serialized_start=4881 - _DETECTORINPUT._serialized_end=5130 - _DETECTOROUTPUT._serialized_start=5132 - _DETECTOROUTPUT._serialized_end=5148 - _DETECTORSTATUS._serialized_start=5150 - _DETECTORSTATUS._serialized_end=5248 - _FPGASTATUS._serialized_start=5251 - _FPGASTATUS._serialized_end=6321 - _FPGASTATUS_FIFOSTATUSENTRY._serialized_start=6240 - _FPGASTATUS_FIFOSTATUSENTRY._serialized_end=6321 - _INDEXERDATAPROCESSINGPLOTS._serialized_start=6323 - _INDEXERDATAPROCESSINGPLOTS._serialized_end=6396 - _DATAPROCESSINGSETTINGS._serialized_start=6399 - _DATAPROCESSINGSETTINGS._serialized_end=6793 - _PREVIEWFRAME._serialized_start=6796 - _PREVIEWFRAME._serialized_end=7065 - _MODULESTATISTICS._serialized_start=7068 - _MODULESTATISTICS._serialized_end=7305 - _IMAGE._serialized_start=7307 - _IMAGE._serialized_end=7380 - _MASKTOLOAD._serialized_start=7382 - _MASKTOLOAD._serialized_end=7428 - _MEASUREMENTSTATISTICS._serialized_start=7431 - _MEASUREMENTSTATISTICS._serialized_end=7939 - _BROKERSTATUS._serialized_start=7942 - _BROKERSTATUS._serialized_end=8083 - _BROKERFULLSTATUS._serialized_start=8086 - _BROKERFULLSTATUS._serialized_end=8250 - _DETECTORLISTELEMENT._serialized_start=8252 - _DETECTORLISTELEMENT._serialized_end=8324 - _DETECTORLIST._serialized_start=8326 - _DETECTORLIST._serialized_end=8444 - _DETECTORSELECTION._serialized_start=8446 - _DETECTORSELECTION._serialized_end=8477 - _GRPC_JFJOCHRECEIVER._serialized_start=8847 - _GRPC_JFJOCHRECEIVER._serialized_end=9531 - _GRPC_JFJOCHWRITER._serialized_start=9534 - _GRPC_JFJOCHWRITER._serialized_end=9736 - _GRPC_JFJOCHDETECTOR._serialized_start=9739 - _GRPC_JFJOCHDETECTOR._serialized_end=10125 - _GRPC_JFJOCHBROKER._serialized_start=10128 - _GRPC_JFJOCHBROKER._serialized_end=11734 + _RECEIVERNETWORKCONFIGDEVICE._serialized_start=3964 + _RECEIVERNETWORKCONFIGDEVICE._serialized_end=4048 + _RECEIVERNETWORKCONFIG._serialized_start=4050 + _RECEIVERNETWORKCONFIG._serialized_end=4134 + _RECEIVERSTATUS._serialized_start=4137 + _RECEIVERSTATUS._serialized_end=4284 + _RECEIVERDATAPROCESSINGPLOTS._serialized_start=4287 + _RECEIVERDATAPROCESSINGPLOTS._serialized_end=4497 + _WRITERINPUT._serialized_start=4499 + _WRITERINPUT._serialized_end=4561 + _WRITEROUTPUT._serialized_start=4563 + _WRITEROUTPUT._serialized_end=4643 + _DETECTORMODULECONFIG._serialized_start=4646 + _DETECTORMODULECONFIG._serialized_end=4904 + _DETECTORCONFIG._serialized_start=4906 + _DETECTORCONFIG._serialized_end=5002 + _DETECTORINPUT._serialized_start=5005 + _DETECTORINPUT._serialized_end=5254 + _DETECTOROUTPUT._serialized_start=5256 + _DETECTOROUTPUT._serialized_end=5272 + _DETECTORSTATUS._serialized_start=5274 + _DETECTORSTATUS._serialized_end=5372 + _FPGASTATUS._serialized_start=5375 + _FPGASTATUS._serialized_end=6445 + _FPGASTATUS_FIFOSTATUSENTRY._serialized_start=6364 + _FPGASTATUS_FIFOSTATUSENTRY._serialized_end=6445 + _INDEXERDATAPROCESSINGPLOTS._serialized_start=6447 + _INDEXERDATAPROCESSINGPLOTS._serialized_end=6520 + _DATAPROCESSINGSETTINGS._serialized_start=6523 + _DATAPROCESSINGSETTINGS._serialized_end=6917 + _PREVIEWFRAME._serialized_start=6920 + _PREVIEWFRAME._serialized_end=7189 + _MODULESTATISTICS._serialized_start=7192 + _MODULESTATISTICS._serialized_end=7429 + _IMAGE._serialized_start=7431 + _IMAGE._serialized_end=7504 + _MASKTOLOAD._serialized_start=7506 + _MASKTOLOAD._serialized_end=7552 + _MEASUREMENTSTATISTICS._serialized_start=7555 + _MEASUREMENTSTATISTICS._serialized_end=8063 + _BROKERSTATUS._serialized_start=8066 + _BROKERSTATUS._serialized_end=8207 + _BROKERFULLSTATUS._serialized_start=8210 + _BROKERFULLSTATUS._serialized_end=8374 + _DETECTORLISTELEMENT._serialized_start=8376 + _DETECTORLISTELEMENT._serialized_end=8448 + _DETECTORLIST._serialized_start=8450 + _DETECTORLIST._serialized_end=8568 + _DETECTORSELECTION._serialized_start=8570 + _DETECTORSELECTION._serialized_end=8601 + _GRPC_JFJOCHRECEIVER._serialized_start=8971 + _GRPC_JFJOCHRECEIVER._serialized_end=9655 + _GRPC_JFJOCHWRITER._serialized_start=9658 + _GRPC_JFJOCHWRITER._serialized_end=9860 + _GRPC_JFJOCHDETECTOR._serialized_start=9863 + _GRPC_JFJOCHDETECTOR._serialized_end=10249 + _GRPC_JFJOCHBROKER._serialized_start=10252 + _GRPC_JFJOCHBROKER._serialized_end=11858 # @@protoc_insertion_point(module_scope) diff --git a/receiver/JFJochReceiverService.cpp b/receiver/JFJochReceiverService.cpp index 8fcdac32..951deb57 100644 --- a/receiver/JFJochReceiverService.cpp +++ b/receiver/JFJochReceiverService.cpp @@ -164,7 +164,11 @@ grpc::Status JFJochReceiverService::GetPreviewFrame(grpc::ServerContext *context grpc::Status JFJochReceiverService::GetNetworkConfig(grpc::ServerContext *context, const JFJochProtoBuf::Empty *request, JFJochProtoBuf::ReceiverNetworkConfig *response) { - for (const auto &aq: aq_devices) - response->add_fpga_mac_addr(aq->GetMACAddress()); + for (const auto &aq: aq_devices) { + auto dev_net_cfg = response->add_device(); + dev_net_cfg->set_mac_addr(aq->GetMACAddress()); + dev_net_cfg->set_ipv4_addr(aq->GetIPv4Address()); + dev_net_cfg->set_udp_port(aq->GetUDPPort()); + } return grpc::Status::OK; } \ No newline at end of file diff --git a/receiver/host/AcquisitionDevice.cpp b/receiver/host/AcquisitionDevice.cpp index d460ad4b..8dd1efca 100644 --- a/receiver/host/AcquisitionDevice.cpp +++ b/receiver/host/AcquisitionDevice.cpp @@ -15,7 +15,7 @@ #include "../../common/JFJochException.h" #include "AcquisitionDevice.h" - +#include "../../common/NetworkAddressConvert.h" void *mmap_acquisition_buffer(size_t size, int16_t numa_node) { void *ret = mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); @@ -54,12 +54,11 @@ uint64_t AcquisitionDevice::GetBufferHandle(size_t frame, uint8_t module_number) void AcquisitionDevice::FillActionRegister(const DiffractionExperiment& x, ActionConfig &job) { - job.fpga_ipv4_addr = x.GetDestIPv4Address(data_stream); - job.nmodules = x.GetModulesNum(data_stream); - job.frames_internal_packet_gen = x.GetFrameNum(); - job.one_over_energy = std::lround((1<<20)/ x.GetPhotonEnergy_keV()); - job.nstorage_cells = x.GetStorageCellNumber() - 1; - job.mode = 0; + job.nmodules = x.GetModulesNum(data_stream); + job.nframes = x.GetFrameNum(); + job.one_over_energy = std::lround((1<<20)/ x.GetPhotonEnergy_keV()); + job.nstorage_cells = x.GetStorageCellNumber() - 1; + job.mode = 0; if ((x.GetDetectorMode() == DetectorMode::Conversion) && x.GetConversionOnFPGA()) job.mode |= MODE_CONV; @@ -112,10 +111,7 @@ void AcquisitionDevice::StartAction(const DiffractionExperiment &experiment) { if (cfg_out.mode != cfg_in.mode) throw JFJochException(JFJochExceptionCategory::AcquisitionDeviceError, "Mismatch between expected and actual values of configuration registers (mode)"); - if (cfg_out.fpga_ipv4_addr != cfg_in.fpga_ipv4_addr) - throw JFJochException(JFJochExceptionCategory::AcquisitionDeviceError, - "Mismatch between expected and actual values of configuration registers (FPGA IPv4 Addr)"); - if (cfg_out.frames_internal_packet_gen != cfg_in.frames_internal_packet_gen) + if (cfg_out.nframes != cfg_in.nframes) throw JFJochException(JFJochExceptionCategory::AcquisitionDeviceError, "Mismatch between expected and actual values of configuration registers (Frames per trigger)"); if (cfg_out.nmodules != cfg_in.nmodules) @@ -433,13 +429,11 @@ JFJochProtoBuf::FPGAStatus AcquisitionDevice::GetStatus() const { } std::string AcquisitionDevice::GetMACAddress() const { - uint64_t mac_address_network_order = HW_GetMACAddress(); - std::ostringstream ss; - for (int i = 0; i < 6; i++) { - ss << std::setfill('0') << std::setw(2) << std::hex << ((mac_address_network_order >> (i * 8)) & 0xFF); - if (i != 5) ss << ":"; - } - return ss.str(); + return MacAddressToStr(HW_GetMACAddress()); +} + +std::string AcquisitionDevice::GetIPv4Address() const { + return IPv4AddressToStr(HW_GetIPv4Address()); } ActionConfig AcquisitionDevice::ReadActionRegister() { @@ -452,6 +446,10 @@ int32_t AcquisitionDevice::GetNUMANode() const { return -1; } +uint16_t AcquisitionDevice::GetUDPPort() const { + return 1234; +} + uint64_t AcquisitionDevice::GetBunchID(size_t curr_frame, uint16_t module_number) const { return counters.GetBunchID(curr_frame, module_number); } diff --git a/receiver/host/AcquisitionDevice.h b/receiver/host/AcquisitionDevice.h index 91e55788..82582079 100644 --- a/receiver/host/AcquisitionDevice.h +++ b/receiver/host/AcquisitionDevice.h @@ -64,6 +64,7 @@ class AcquisitionDevice { virtual void HW_GetEnvParams(ActionEnvParams *status) const { memset(status, 0, sizeof(ActionEnvParams)); } + virtual uint32_t HW_GetIPv4Address() const = 0; virtual uint64_t HW_GetMACAddress() const = 0; virtual void HW_EndAction() {}; // do clean-up after action is done virtual void CopyInternalPacketGenFrameToDeviceBuffer(); @@ -126,8 +127,9 @@ public: ActionConfig ReadActionRegister(); bool IsDone() const; + std::string GetIPv4Address() const; std::string GetMACAddress() const; - + virtual uint16_t GetUDPPort() const; virtual int32_t GetNUMANode() const; }; diff --git a/receiver/host/ActionConfig.h b/receiver/host/ActionConfig.h index 733beb95..422cb3ef 100644 --- a/receiver/host/ActionConfig.h +++ b/receiver/host/ActionConfig.h @@ -15,11 +15,10 @@ typedef __u64 uint64_t; #pragma pack(4) struct ActionConfig { - uint32_t fpga_ipv4_addr; uint32_t nmodules; uint32_t mode; uint32_t one_over_energy; - uint32_t frames_internal_packet_gen; + uint32_t nframes; uint32_t nstorage_cells; }; diff --git a/receiver/host/HLSSimulatedDevice.cpp b/receiver/host/HLSSimulatedDevice.cpp index 79d383ab..416658f0 100644 --- a/receiver/host/HLSSimulatedDevice.cpp +++ b/receiver/host/HLSSimulatedDevice.cpp @@ -87,7 +87,7 @@ void HLSSimulatedDevice::CreatePacketJF(const DiffractionExperiment& experiment, packet->ipv4_header_h = htons(0x4500); // Big endian in IP header! packet->ipv4_header_total_length = htons(8268); // Big endian in IP header! - packet->ipv4_header_dest_ip = experiment.GetDestIPv4Address(data_stream); + packet->ipv4_header_dest_ip = fpga_ipv4_addr; packet->ipv4_header_sour_ip = experiment.GetSrcIPv4Address(data_stream, half_module); packet->ipv4_header_ttl_protocol = htons(0x0011); @@ -158,7 +158,7 @@ void HLSSimulatedDevice::HW_StartAction() { (hbm256_t *) (hbm_memory[9].data()), (hbm256_t *) (hbm_memory[10].data()), (hbm256_t *) (hbm_memory[11].data()), - din_eth, dout_eth, fpga_mac_addr, cfg, + din_eth, dout_eth, fpga_mac_addr, fpga_ipv4_addr, cfg, work_request_stream, completion_stream, run_data_collection, @@ -219,6 +219,7 @@ void hls_action(hls::stream &in_datamover_cmd_stream, hbm256_t *d_hbm_p10, hbm256_t *d_hbm_p11, AXI_STREAM &din_eth, AXI_STREAM &dout_eth, uint64_t fpga_mac_addr, + uint32_t fpga_ipv4_addr, const ActionConfig &act_reg, hls::stream > &s_axis_work_request, hls::stream > &m_axis_completion, @@ -271,19 +272,19 @@ void hls_action(hls::stream &in_datamover_cmd_stream, ethernet(din_eth, ip1, arp1, fpga_mac_addr, eth_packets, clear_counters); while(!ip1.empty()) - ipv4(ip1, udp1, icmp1, act_reg.fpga_ipv4_addr); + ipv4(ip1, udp1, icmp1, fpga_ipv4_addr); arp(arp1, dout_eth, fpga_mac_addr, - act_reg.fpga_ipv4_addr, + fpga_ipv4_addr, 1, run_data_collection); while (!arp1.empty()) { arp(arp1, dout_eth, fpga_mac_addr, - act_reg.fpga_ipv4_addr, + fpga_ipv4_addr, 1, run_data_collection); } @@ -291,7 +292,7 @@ void hls_action(hls::stream &in_datamover_cmd_stream, arp(arp1, dout_eth, fpga_mac_addr, - act_reg.fpga_ipv4_addr, + fpga_ipv4_addr, 0, run_data_collection); while(!icmp1.empty()) @@ -314,7 +315,7 @@ void hls_action(hls::stream &in_datamover_cmd_stream, idle_data_collection, act_reg.mode, act_reg.one_over_energy, - act_reg.frames_internal_packet_gen, + act_reg.nframes, act_reg.nmodules, act_reg.nstorage_cells); run_data_collection = 0; @@ -398,6 +399,10 @@ void hls_action(hls::stream &in_datamover_cmd_stream, } +uint32_t HLSSimulatedDevice::HW_GetIPv4Address() const { + return fpga_ipv4_addr; +} + uint64_t HLSSimulatedDevice::HW_GetMACAddress() const { return fpga_mac_addr; } diff --git a/receiver/host/HLSSimulatedDevice.h b/receiver/host/HLSSimulatedDevice.h index 80eb45f6..e8b6ad8a 100644 --- a/receiver/host/HLSSimulatedDevice.h +++ b/receiver/host/HLSSimulatedDevice.h @@ -23,6 +23,7 @@ void hls_action(hls::stream &in_datamover_cmd_stream, hbm256_t *d_hbm_p10, hbm256_t *d_hbm_p11, AXI_STREAM &din_eth, AXI_STREAM &dout_eth, uint64_t fpga_mac_addr, + uint32_t fpga_ipv4_addr, const ActionConfig &act_reg, hls::stream > &s_axis_work_request, hls::stream > &m_axis_completion, @@ -51,6 +52,7 @@ class HLSSimulatedDevice : public AcquisitionDevice { ap_uint<1> cancel_data_collection; uint64_t in_mem_location[LOAD_CALIBRATION_BRAM_SIZE]; static const uint64_t fpga_mac_addr = 0xCCAA11223344; + static const uint32_t fpga_ipv4_addr = 0x0132010A; void HW_ReadActionRegister(ActionConfig *job) override; void HW_WriteActionRegister(const ActionConfig *job) override; @@ -62,17 +64,18 @@ class HLSSimulatedDevice : public AcquisitionDevice { void HW_SetCancelDataCollectionBit() override; bool HW_SendWorkRequest(uint32_t handle) override; uint64_t HW_GetMACAddress() const override; + uint32_t HW_GetIPv4Address() const override; void HW_GetStatus(ActionStatus *status) const override; public: HLSSimulatedDevice(uint16_t data_stream, size_t in_frame_buffer_size_modules, int16_t numa_node = -1); ~HLSSimulatedDevice(); void SendPacket(char *buffer, int len, uint8_t user = 0); void CreatePacketJF(const DiffractionExperiment& experiment, uint64_t frame_number, uint32_t eth_packet, - uint32_t module, const uint16_t *data, bool trigger, int8_t adjust_axis = 0, uint8_t user = 0); + uint32_t module_number, const uint16_t *data, bool trigger, int8_t adjust_axis = 0, uint8_t user = 0); void CreatePacketEIGER(const DiffractionExperiment& experiment, uint64_t frame_number, uint32_t eth_packet, - uint32_t module, const uint16_t *data, bool trigger, int8_t adjust_axis = 0, uint8_t user = 0); + uint32_t module_number, const uint16_t *data, bool trigger, int8_t adjust_axis = 0, uint8_t user = 0); void CreatePackets(const DiffractionExperiment& experiment, uint64_t frame_number_0, uint64_t frames, - uint32_t module, const uint16_t *data, bool trigger, int8_t adjust_axis = 0, + uint32_t module_number, const uint16_t *data, bool trigger, int8_t adjust_axis = 0, uint8_t user = 0); void CreateFinalPacket(const DiffractionExperiment& experiment); AXI_STREAM &OutputStream(); diff --git a/receiver/host/MlxRawEthDevice.cpp b/receiver/host/MlxRawEthDevice.cpp index e9d73907..101f9cdb 100644 --- a/receiver/host/MlxRawEthDevice.cpp +++ b/receiver/host/MlxRawEthDevice.cpp @@ -53,7 +53,7 @@ void MlxRawEthDevice::MeasureThread() { qp.ReadyToReceive(); qp.ReadyToSend(); - qp.FlowSteeringIPv4(cfg.fpga_ipv4_addr); + qp.FlowSteeringIPv4(ipv4_addr); for (int i = 0; i < BUFFER_COUNT-1; i++) qp.PostReceiveWR(*buffer.GetMemoryRegion(), i, buffer.GetLocation(i), BUFFER_SIZE); @@ -140,11 +140,18 @@ void MlxRawEthDevice::SetMACAddress(uint64_t mac_addr_network_order) { mac_addr = mac_addr_network_order; } +void MlxRawEthDevice::SetIPv4Address(uint32_t ipv4_addr_network_order) { + ipv4_addr = ipv4_addr_network_order; +} uint64_t MlxRawEthDevice::HW_GetMACAddress() const { return mac_addr; } +uint32_t MlxRawEthDevice::HW_GetIPv4Address() const { + return ipv4_addr; +} + uint64_t MlxRawEthDevice::PollCQ(IBRegBuffer &buffer, IBQueuePair &qp, IBCompletionQueue &cq, ProcessJFPacket &process) { #ifdef JFJOCH_USE_NUMA if (numa_available() != -1) @@ -208,9 +215,9 @@ void MlxRawEthDevice::SendARP(IBRegBuffer &buffer, IBQueuePair &qp) { .ar_pln = 0x4, // 4 bytes .ar_op = htons(1), // ARP request .ar_sha = {src_mac[0], src_mac[1], src_mac[2], src_mac[3], src_mac[4], src_mac[5]}, - .ar_sip = cfg.fpga_ipv4_addr, + .ar_sip = ipv4_addr, .ar_tha = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, - .ar_tip = cfg.fpga_ipv4_addr + .ar_tip = ipv4_addr }; memcpy(buffer.GetLocation(BUFFER_COUNT-1), &arp_packet, sizeof(RAW_ARP_Packet)); diff --git a/receiver/host/MlxRawEthDevice.h b/receiver/host/MlxRawEthDevice.h index de012266..2d40bcf7 100644 --- a/receiver/host/MlxRawEthDevice.h +++ b/receiver/host/MlxRawEthDevice.h @@ -22,6 +22,7 @@ class MlxRawEthDevice : public AcquisitionDevice { ThreadSafeFIFO completion_queue; ThreadSafeFIFO wr_queue; uint64_t mac_addr; + uint32_t ipv4_addr; ActionConfig cfg; const int16_t numa_node; @@ -47,6 +48,7 @@ class MlxRawEthDevice : public AcquisitionDevice { bool HW_SendWorkRequest(uint32_t handle) override; void HW_GetStatus(ActionStatus *status) const override; uint64_t HW_GetMACAddress() const override; + uint32_t HW_GetIPv4Address() const override; void HW_EndAction() override; void CopyInternalPacketGenFrameToDeviceBuffer() override; public: @@ -56,6 +58,7 @@ public: void InitializeCalibration(const DiffractionExperiment &experiment, const JFCalibration &calib) override; int32_t GetNUMANode() const override; void SetMACAddress(uint64_t mac_addr_network_order); + void SetIPv4Address(uint32_t ipv4_addr_network_order); }; #endif //JUNGFRAUJOCH_RAWETHDEVICE_H diff --git a/receiver/host/MockAcquisitionDevice.cpp b/receiver/host/MockAcquisitionDevice.cpp index 5df354f8..f1139f42 100644 --- a/receiver/host/MockAcquisitionDevice.cpp +++ b/receiver/host/MockAcquisitionDevice.cpp @@ -84,6 +84,10 @@ uint64_t MockAcquisitionDevice::HW_GetMACAddress() const { return 0; // Doesn't matter } +uint32_t MockAcquisitionDevice::HW_GetIPv4Address() const { + return 0; +} + void MockAcquisitionDevice::HW_GetStatus(ActionStatus *status) const { memset(status, 0, sizeof(ActionStatus)); status->max_modules = max_modules; diff --git a/receiver/host/MockAcquisitionDevice.h b/receiver/host/MockAcquisitionDevice.h index 5ffdc46a..76bf09c2 100644 --- a/receiver/host/MockAcquisitionDevice.h +++ b/receiver/host/MockAcquisitionDevice.h @@ -25,6 +25,7 @@ class MockAcquisitionDevice : public AcquisitionDevice { bool HW_SendWorkRequest(uint32_t handle) override; bool HW_IsIdle() const override; uint64_t HW_GetMACAddress() const override; + uint32_t HW_GetIPv4Address() const override; void HW_GetStatus(ActionStatus *status) const override; void CopyInternalPacketGenFrameToDeviceBuffer() override; public: diff --git a/receiver/host/PCIExpressDevice.cpp b/receiver/host/PCIExpressDevice.cpp index e10da731..0a2cb856 100644 --- a/receiver/host/PCIExpressDevice.cpp +++ b/receiver/host/PCIExpressDevice.cpp @@ -146,7 +146,6 @@ void PCIExpressDevice::SetMACAddress(uint64_t mac_addr_network_order) { if (ioctl(fd, IOCTL_JFJOCH_SET_MAC, &mac_addr_network_order) != 0) throw JFJochException(JFJochExceptionCategory::PCIeError, "Failed setting MAC address", errno); - } void PCIExpressDevice::HW_GetStatus(ActionStatus *status) const { @@ -199,14 +198,16 @@ void PCIExpressDevice::SetDefaultMAC() const { "Failed setting default MAC", errno); } -void PCIExpressDevice::SetIPv4Address(const std::string &ipv4_addr) { - ActionConfig config { - .fpga_ipv4_addr = IPv4AddressFromStr(ipv4_addr), - .nmodules = 1, - .one_over_energy = 1, - .frames_internal_packet_gen = 1, - .nstorage_cells = 1 - }; - - HW_WriteActionRegister(&config); +void PCIExpressDevice::SetIPv4Address(uint32_t ipv4_addr_network_order) { + if (ioctl(fd, IOCTL_JFJOCH_SET_IPV4, &ipv4_addr_network_order) != 0) + throw JFJochException(JFJochExceptionCategory::PCIeError, + "Failed setting IPv4 address", errno); +} + +uint32_t PCIExpressDevice::HW_GetIPv4Address() const { + uint32_t tmp; + if (ioctl(fd, IOCTL_JFJOCH_GET_IPV4, &tmp) != 0) + throw JFJochException(JFJochExceptionCategory::PCIeError, + "Failed getting MAC address", errno); + return tmp; } diff --git a/receiver/host/PCIExpressDevice.h b/receiver/host/PCIExpressDevice.h index c0613b45..b5f475b0 100644 --- a/receiver/host/PCIExpressDevice.h +++ b/receiver/host/PCIExpressDevice.h @@ -18,6 +18,7 @@ class PCIExpressDevice : public AcquisitionDevice { 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 HW_EndAction() override; void Reset(); @@ -30,15 +31,16 @@ public: PCIExpressDevice(const std::string &device_name, uint16_t data_stream); ~PCIExpressDevice() override; - void SetMACAddress(uint64_t mac_addr_network_order); 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(const std::string &ipv4_addr); + void SetIPv4Address(uint32_t ipv4_addr_network_order); }; diff --git a/receiver/host/jfjoch_pcie_set_network.cpp b/receiver/host/jfjoch_pcie_set_network.cpp index 2e146ce4..2534b95e 100644 --- a/receiver/host/jfjoch_pcie_set_network.cpp +++ b/receiver/host/jfjoch_pcie_set_network.cpp @@ -1,9 +1,10 @@ // Copyright (2019-2022) Paul Scherrer Institute // SPDX-License-Identifier: GPL-3.0-or-later -#include "../common/Logger.h" -#include "../common/JFJochException.h" +#include "../../common/Logger.h" +#include "../../common/JFJochException.h" #include "PCIExpressDevice.h" +#include "../../common/NetworkAddressConvert.h" int main(int argc, char **argv) { Logger logger("jfjoch_pcie_set_network"); @@ -18,7 +19,7 @@ int main(int argc, char **argv) { try { PCIExpressDevice test(argv[1], 0); test.SetDefaultMAC(); - test.SetIPv4Address(argv[2]); + test.SetIPv4Address(IPv4AddressFromStr(std::string(argv[2]))); logger.Info("Done"); } catch (const JFJochException &e) { logger.ErrorException(e); diff --git a/receiver/host/jfjoch_pcie_status.cpp b/receiver/host/jfjoch_pcie_status.cpp index b21beedc..6869963b 100644 --- a/receiver/host/jfjoch_pcie_status.cpp +++ b/receiver/host/jfjoch_pcie_status.cpp @@ -41,11 +41,11 @@ int main(int argc, char **argv) { std::cout << "Stalls host mem " << status.stalls_host() << std::endl; ActionConfig cfg = test.ReadActionRegister(); - std::cout << "IPv4 address " << IPv4AddressToStr(cfg.fpga_ipv4_addr) << std::endl; std::cout << "MAC address " << test.GetMACAddress() << std::endl; + std::cout << "IPv4 address " << test.GetIPv4Address() << std::endl; std::cout << "Mode " << std::hex << cfg.mode << std::dec << std::endl; std::cout << "Modules " << std::dec << cfg.nmodules << std::endl; - std::cout << "Frames int. pkt. gen. " << std::dec << cfg.frames_internal_packet_gen << std::endl; + std::cout << "Frames int. pkt. gen. " << std::dec << cfg.nframes << std::endl; std::cout << std::endl; std::cout << "FPGA FIFO status: " << std::endl; for (const auto &[x,y]: status.fifo_status()) { diff --git a/receiver/jfjoch_receiver.cpp b/receiver/jfjoch_receiver.cpp index ca5f3d2b..5935a4de 100644 --- a/receiver/jfjoch_receiver.cpp +++ b/receiver/jfjoch_receiver.cpp @@ -32,16 +32,18 @@ AcquisitionDevice *SetupAcquisitionDevice(const nlohmann::json &input, uint16_t ret = new HLSSimulatedDevice(data_stream, frame_buffer_size, numa_node); else if (input.contains("type") && (input["type"] == "pcie")) { auto pci_dev = new PCIExpressDevice(data_stream, pci_slot); - if (input.contains("fpga_mac_addr")) - pci_dev->SetMACAddress(MacAddressFromStr(input["fpga_mac_addr"].get())); + pci_dev->SetIPv4Address(IPv4AddressFromStr(input["ipv4_addr"].get())); + + if (input.contains("mac_addr")) + pci_dev->SetMACAddress(MacAddressFromStr(input["mac_addr"].get())); else pci_dev->SetDefaultMAC(); ret = pci_dev; #ifdef JFJOCH_USE_IBVERBS } else if (input.contains("type") && (input["type"] == "mlx_raw_eth")) { auto mlx_dev = new MlxRawEthDevice(pci_slot, data_stream, frame_buffer_size, numa_node); - if (input.contains("mac_addr")) - mlx_dev->SetMACAddress(MacAddressFromStr(input["mac_addr"].get())); + mlx_dev->SetIPv4Address(IPv4AddressFromStr(input["ipv4_addr"].get())); + mlx_dev->SetMACAddress(MacAddressFromStr(input["mac_addr"].get())); ret = mlx_dev; } #endif diff --git a/receiver/pcie_driver/jfjoch_function.c b/receiver/pcie_driver/jfjoch_function.c index 7a28382a..04237fed 100644 --- a/receiver/pcie_driver/jfjoch_function.c +++ b/receiver/pcie_driver/jfjoch_function.c @@ -109,12 +109,12 @@ int jfjoch_read_wc(struct jfjoch_drvdata *drvdata, u32 *output) { void jfjoch_set_config(struct jfjoch_drvdata *drvdata, const struct ActionConfig *config) { mutex_lock(&set_config_mutex); - memcpy_toio((drvdata->bar0) + ACTION_CONFIG_OFFSET + ADDR_IPV4_ADDR, config, sizeof(struct ActionConfig)); + memcpy_toio((drvdata->bar0) + ACTION_CONFIG_OFFSET + ADDR_NMODULES, config, sizeof(struct ActionConfig)); mutex_unlock(&set_config_mutex); } void jfjoch_get_config(struct jfjoch_drvdata *drvdata, struct ActionConfig *config) { - memcpy_fromio(config, (drvdata->bar0) + ACTION_CONFIG_OFFSET + ADDR_IPV4_ADDR, sizeof(struct ActionConfig)); + memcpy_fromio(config, (drvdata->bar0) + ACTION_CONFIG_OFFSET + ADDR_NMODULES, sizeof(struct ActionConfig)); } void jfjoch_get_status(struct jfjoch_drvdata *drvdata, struct ActionStatus *status) { diff --git a/tests/ActionConfigTest.cpp b/tests/ActionConfigTest.cpp index 0dc43020..47430f90 100644 --- a/tests/ActionConfigTest.cpp +++ b/tests/ActionConfigTest.cpp @@ -48,28 +48,22 @@ TEST_CASE("ActionStatus") { TEST_CASE("ActionConfigSize") { - REQUIRE(sizeof(ActionConfig) == 6 * sizeof(uint32_t)); + REQUIRE(sizeof(ActionConfig) == 5 * sizeof(uint32_t)); } TEST_CASE("ActionConfig") { ActionConfig config{}; auto config32 = (uint32_t *) &config; - config.fpga_ipv4_addr = 32; - CHECK(config32[(ADDR_IPV4_ADDR - ADDR_IPV4_ADDR)/4] == 32); - config.nmodules = 456; - CHECK(config32[(ADDR_NMODULES - ADDR_IPV4_ADDR)/4] == 456); - config.one_over_energy = 1<<17; - CHECK(config32[(ADDR_ONE_OVER_ENERGY - ADDR_IPV4_ADDR)/4] == 1<<17); - config.mode = 1<<5; - CHECK(config32[(ADDR_DATA_COL_MODE - ADDR_IPV4_ADDR)/4] == 1<<5); - - config.frames_internal_packet_gen = 1<<18; - CHECK(config32[(ADDR_NFRAMES - ADDR_IPV4_ADDR)/4] == 1 << 18 ); - + config.nframes = 1<<18; config.nstorage_cells = 16; - CHECK(config32[(ADDR_NSTORAGE_CELLS - ADDR_IPV4_ADDR)/4] == 16); + + CHECK(config32[(ADDR_NMODULES - ADDR_NMODULES)/4] == 456); + CHECK(config32[(ADDR_ONE_OVER_ENERGY - ADDR_NMODULES)/4] == 1<<17); + CHECK(config32[(ADDR_DATA_COL_MODE - ADDR_NMODULES)/4] == 1<<5); + CHECK(config32[(ADDR_NFRAMES - ADDR_NMODULES)/4] == 1 << 18 ); + CHECK(config32[(ADDR_NSTORAGE_CELLS - ADDR_NMODULES)/4] == 16); } \ No newline at end of file diff --git a/tests/DiffractionExperimentTest.cpp b/tests/DiffractionExperimentTest.cpp index 27e33b88..08682cf5 100644 --- a/tests/DiffractionExperimentTest.cpp +++ b/tests/DiffractionExperimentTest.cpp @@ -1006,8 +1006,16 @@ TEST_CASE("DiffractionExperiment_DetectorModuleHostname","[DiffractionExperiment JFJochProtoBuf::DetectorConfig det_cfg; JFJochProtoBuf::ReceiverNetworkConfig net_cfg; - net_cfg.add_fpga_mac_addr("AA:BB:CC:DD:EE:FF"); - net_cfg.add_fpga_mac_addr("AA:BB:CC:DD:EE:FE"); + + auto d1 = net_cfg.add_device(); + d1->set_mac_addr("00:00:00:00:00:00"); + d1->set_ipv4_addr("10.10.50.1"); + d1->set_udp_port(1234); + + auto d2 = net_cfg.add_device(); + d2->set_mac_addr("00:00:00:00:00:01"); + d2->set_ipv4_addr("10.10.50.2"); + d2->set_udp_port(1234); std::vector h_out; REQUIRE_NOTHROW(x.GetDetectorModuleHostname(h_out)); diff --git a/tests/FPGAIntegrationTest.cpp b/tests/FPGAIntegrationTest.cpp index 2df0062e..7aa76788 100644 --- a/tests/FPGAIntegrationTest.cpp +++ b/tests/FPGAIntegrationTest.cpp @@ -707,7 +707,7 @@ TEST_CASE("HLS_DataCollectionFSM","[OpenCAPI]") { idle_data_collection, act_reg.mode, act_reg.one_over_energy, - act_reg.frames_internal_packet_gen, + act_reg.nframes, act_reg.nmodules, act_reg.nstorage_cells); REQUIRE(idle_data_collection == 1); @@ -724,7 +724,7 @@ TEST_CASE("HLS_DataCollectionFSM","[OpenCAPI]") { idle_data_collection, act_reg.mode, act_reg.one_over_energy, - act_reg.frames_internal_packet_gen, + act_reg.nframes, act_reg.nmodules, act_reg.nstorage_cells); REQUIRE(idle_data_collection == 0); @@ -739,7 +739,7 @@ TEST_CASE("HLS_DataCollectionFSM","[OpenCAPI]") { idle_data_collection, act_reg.mode, act_reg.one_over_energy, - act_reg.frames_internal_packet_gen, + act_reg.nframes, act_reg.nmodules, act_reg.nstorage_cells); REQUIRE(idle_data_collection == 0); @@ -757,7 +757,7 @@ TEST_CASE("HLS_DataCollectionFSM","[OpenCAPI]") { idle_data_collection, act_reg.mode, act_reg.one_over_energy, - act_reg.frames_internal_packet_gen, + act_reg.nframes, act_reg.nmodules, act_reg.nstorage_cells); REQUIRE(idle_data_collection == 0); @@ -772,7 +772,7 @@ TEST_CASE("HLS_DataCollectionFSM","[OpenCAPI]") { idle_data_collection, act_reg.mode, act_reg.one_over_energy, - act_reg.frames_internal_packet_gen, + act_reg.nframes, act_reg.nmodules, act_reg.nstorage_cells); @@ -789,7 +789,7 @@ TEST_CASE("HLS_DataCollectionFSM","[OpenCAPI]") { idle_data_collection, act_reg.mode, act_reg.one_over_energy, - act_reg.frames_internal_packet_gen, + act_reg.nframes, act_reg.nmodules, act_reg.nstorage_cells); @@ -808,7 +808,7 @@ TEST_CASE("HLS_DataCollectionFSM","[OpenCAPI]") { idle_data_collection, act_reg.mode, act_reg.one_over_energy, - act_reg.frames_internal_packet_gen, + act_reg.nframes, act_reg.nmodules, act_reg.nstorage_cells); @@ -825,7 +825,7 @@ TEST_CASE("HLS_DataCollectionFSM","[OpenCAPI]") { idle_data_collection, act_reg.mode, act_reg.one_over_energy, - act_reg.frames_internal_packet_gen, + act_reg.nframes, act_reg.nmodules, act_reg.nstorage_cells); @@ -842,7 +842,7 @@ TEST_CASE("HLS_DataCollectionFSM","[OpenCAPI]") { idle_data_collection, act_reg.mode, act_reg.one_over_energy, - act_reg.frames_internal_packet_gen, + act_reg.nframes, act_reg.nmodules, act_reg.nstorage_cells);