Fixes after MAX IV experiment

This commit is contained in:
2024-02-05 17:18:16 +01:00
parent 91a0960303
commit babb1a5c8d
151 changed files with 4395 additions and 1477 deletions

4
.gitmodules vendored
View File

@@ -9,8 +9,8 @@
url = https://github.com/facebook/zstd
[submodule "detector_control/slsDetectorPackage"]
path = detector_control/slsDetectorPackage
url = https://github.com/slsdetectorgroup/slsDetectorPackage
branch = "developer"
url = https://github.com/fleon-psi/slsDetectorPackage
branch = "jfjoch-shmem"
[submodule "compression/bitshuffle_hperf"]
path = compression/bitshuffle_hperf
url = https://github.com/kalcutter/bitshuffle

View File

@@ -32,7 +32,7 @@ CHECK_INCLUDE_FILE(numaif.h HAS_NUMAIF)
CHECK_INCLUDE_FILE(numa.h HAS_NUMA_H)
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
FIND_PACKAGE(ZeroMQ 4 REQUIRED)
#FIND_PACKAGE(ZeroMQ 4 REQUIRED)
ADD_SUBDIRECTORY(jungfrau)
ADD_SUBDIRECTORY(compression)
@@ -41,7 +41,7 @@ ADD_SUBDIRECTORY(writer)
ADD_SUBDIRECTORY(frame_serialize)
ADD_SUBDIRECTORY(broker/pistache)
ADD_SUBDIRECTORY(detector_control)
IF (JFJOCH_WRITER_ONLY)
MESSAGE(STATUS "Compiling HDF5 writer only")
SET(jfjoch_executables jfjoch_writer)
@@ -51,10 +51,9 @@ ELSE()
ADD_SUBDIRECTORY(acquisition_device)
ADD_SUBDIRECTORY(receiver)
ADD_SUBDIRECTORY(image_analysis)
ADD_SUBDIRECTORY(detector_control)
ADD_SUBDIRECTORY(tests)
ADD_SUBDIRECTORY(tools)
# ADD_SUBDIRECTORY(export_images)
ADD_SUBDIRECTORY(export_images)
SET(jfjoch_executables jfjoch_broker jfjoch_writer CatchTest CompressionBenchmark HDF5DatasetWriteTest jfjoch_udp_simulator sls_detector_put sls_detector_get)
ENDIF()

View File

@@ -30,10 +30,9 @@ Required:
* C++20 compiler and C++20 standard library; recommended GCC 11+ or clang 14+ (Intel OneAPI, AMD AOCC)
* CMake version 3.21 or newer + GNU make tool
* HDF5 library version 1.10 or newer
* ZeroMQ library
* OpenSSL library
* TIFF library + C++ binding (optional)
* JPEG library (optional)
* TIFF library (with C++ headers)
* JPEG library (turbo-jpeg is also OK)
Optional:
* CUDA compiler version 11 or newer - image analysis features won't work without it
@@ -49,6 +48,7 @@ Directly included in the repository:
* Bitshuffle filter from K. Masui - see [github.com/kiyo-masui/bitshuffle](https://github.com/kiyo-masui/bitshuffle)
* LZ4 compression by Y.Collet - see [github.com/lz4/lz4](https://github.com/lz4/lz4)
* Spdlog logging library - see [github.com/gabime/spdlog](https://github.com/gabime/spdlog)
* ZeroMQ library (through slsDetectorPackage)
For license check LICENSE file in respective directory
### Software components

View File

@@ -183,6 +183,9 @@ void AcquisitionDevice::InitializeIntegrationMap(const DiffractionExperiment &ex
const std::vector<uint16_t> &v,
const std::vector<float> &weights) {}
void AcquisitionDevice::InitializeSpotFinderResolutionMap(const DiffractionExperiment &experiment,
const std::vector<float> &v) {}
void AcquisitionDevice::MapBuffersStandard(size_t c2h_buffer_count, int16_t numa_node) {
try {
for (int i = 0; i < c2h_buffer_count; i++)
@@ -289,4 +292,15 @@ void AcquisitionDevice::RunInternalGenerator(const DiffractionExperiment &experi
config.dest_mac_addr = MacAddressFromStr(GetMACAddress());
config.dest_ipv4_addr = IPv4AddressFromStr(GetIPv4Address());
HW_RunInternalGenerator(config);
}
}
void AcquisitionDevice::SetSpotFinderParameters(const SpotFindingSettings &settings) {
SpotFinderParameters fpga_parameters{};
fpga_parameters.snr_threshold = settings.signal_to_noise_threshold;
fpga_parameters.count_threshold = settings.photon_count_threshold;
fpga_parameters.max_d = settings.low_resolution_limit;
fpga_parameters.min_d = settings.high_resolution_limit;
fpga_parameters.min_pix_per_spot = settings.min_pix_per_spot;
HW_SetSpotFinderParameters(fpga_parameters);
}

View File

@@ -63,6 +63,7 @@ protected:
const DeviceOutput *GetDeviceOutput(size_t handle) const;
DeviceOutput *GetDeviceOutput(size_t handle);
virtual void HW_RunInternalGenerator(const FrameGeneratorConfig& config) = 0;
virtual void HW_SetSpotFinderParameters(const SpotFinderParameters &params) = 0;
public:
AcquisitionDevice(const AcquisitionDevice &other) = delete;
AcquisitionDevice &operator=(const AcquisitionDevice &other) = delete;
@@ -94,9 +95,10 @@ public:
virtual void InitializeIntegrationMap(const DiffractionExperiment &experiment, const std::vector<uint16_t> &v);
virtual void InitializeIntegrationMap(const DiffractionExperiment &experiment, const std::vector<uint16_t> &v,
const std::vector<float> &weights);
virtual void InitializeSpotFinderResolutionMap(const DiffractionExperiment &experiment, const std::vector<float>& v);
const AcquisitionCounters& Counters() const;
virtual void SetSpotFinderParameters(int32_t count_threshold, float snr_threshold) {};
void SetSpotFinderParameters(const SpotFindingSettings &settings);
virtual std::string GetIPv4Address() const;
virtual void SetIPv4Address(uint32_t ipv4_addr_network_order);
virtual void SetMACAddress(uint64_t mac_addr_network_order);

View File

@@ -82,6 +82,23 @@ void FPGAAcquisitionDevice::SendWorkRequestThread() {
}
}
void FPGAAcquisitionDevice::InitializeSpotFinderResolutionMap(const DiffractionExperiment &experiment, const std::vector<float> &v) {
auto offset = experiment.GetFirstModuleOfDataStream(data_stream);
size_t modules = experiment.GetModulesNum(data_stream);
if (v.size() != experiment.GetModulesNum() * RAW_MODULE_SIZE)
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"Mismatch regarding integration map array");
for (uint32_t m = 0; m < modules; m++) {
memcpy(buffer_device[0]->pixels, v.data() + (offset + m) * RAW_MODULE_SIZE, RAW_MODULE_SIZE * sizeof(float));
buffer_device[0]->module_statistics.module_number = m;
buffer_device[0]->module_statistics.load_calibration_destination
= LOAD_CALIBRATION_DEST_SPOT_FINDER_RESOLUTION_MAP;
LoadCalibration(0);
}
}
void FPGAAcquisitionDevice::InitializeIntegrationMap(const DiffractionExperiment &experiment,
const std::vector<uint16_t> &v) {
std::vector<float> weights(experiment.GetModulesNum() * RAW_MODULE_SIZE, 1.0);
@@ -139,7 +156,6 @@ void FPGAAcquisitionDevice::SetInternalGeneratorFrameForAllModules(const std::ve
}
}
void FPGAAcquisitionDevice::SetInternalGeneratorFrame(const std::vector<uint16_t> &v) {
if (v.empty() || (v.size() % RAW_MODULE_SIZE != 0)) {
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
@@ -167,6 +183,32 @@ void FPGAAcquisitionDevice::SetInternalGeneratorFrame(const std::vector<uint16_t
}
}
void FPGAAcquisitionDevice::SetInternalGeneratorFrame(const std::vector<int16_t> &v) {
if (v.empty() || (v.size() % RAW_MODULE_SIZE != 0)) {
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"Error in size of custom internal generator frame");
}
size_t nmodules = v.size() / RAW_MODULE_SIZE;
if (nmodules > max_modules) {
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"Max number of modules exceeded");
}
memcpy(internal_pkt_gen_frame.data(), v.data(), nmodules * RAW_MODULE_SIZE * sizeof(int16_t));
if (nmodules > buffer_device.size())
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"Not enough host/FPGA buffers to load all integration map values");
for (uint32_t m = 0; m < nmodules; m++) {
memcpy(buffer_device[0], internal_pkt_gen_frame.data() + m * RAW_MODULE_SIZE, RAW_MODULE_SIZE * sizeof(int16_t));
buffer_device[0]->module_statistics.module_number = m;
buffer_device[0]->module_statistics.load_calibration_destination = LOAD_CALIBRATION_DEST_FRAME_GEN;
LoadCalibration(0);
}
}
void FPGAAcquisitionDevice::InitializeCalibration(const DiffractionExperiment &experiment, const JFCalibration &calib) {
auto offset = experiment.GetFirstModuleOfDataStream(data_stream);
@@ -270,8 +312,6 @@ void FPGAAcquisitionDevice::FillActionRegister(const DiffractionExperiment& x, D
switch (x.GetDetectorMode()) {
case DetectorMode::Conversion:
job.mode |= MODE_CONV;
break;
case DetectorMode::Raw:
break;
case DetectorMode::PedestalG0:
@@ -285,11 +325,15 @@ void FPGAAcquisitionDevice::FillActionRegister(const DiffractionExperiment& x, D
break;
}
if (x.IsConversionOnFPGA())
job.mode |= MODE_CONV;
if (x.IsFixedGainG1())
job.mode |= MODE_FIXG1;
if (!x.IsPixelSigned())
job.mode |= MODE_UNSIGNED;
if (x.GetPixelDepth() == 4)
job.mode |= MODE_32BIT;
}
@@ -343,20 +387,6 @@ FPGAAcquisitionDevice::FPGAAcquisitionDevice(uint16_t data_stream)
internal_pkt_gen_frame(RAW_MODULE_SIZE * MAX_MODULES_FPGA) {
}
void FPGAAcquisitionDevice::SetSpotFinderParameters(int32_t count_threshold, float snr_threshold) {
if (snr_threshold < 0) {
if (logger)
logger->Warning("Trying to set SNR threshold below zero: {}", snr_threshold );
snr_threshold = 0;
} else if (snr_threshold > 16) {
if (logger)
logger->Warning("Trying to set SNR threshold too high: {}", snr_threshold );
snr_threshold = 16;
}
SpotFinderParameters params{.count_threshold = count_threshold, .snr_threshold = snr_threshold};
HW_SetSpotFinderParameters(params);
}
AcquisitionDeviceSource FPGAAcquisitionDevice::GetDataSource() {
switch (HW_GetDataSource()) {
case STREAM_MERGE_SRC_100G:

View File

@@ -33,7 +33,6 @@ class FPGAAcquisitionDevice : public AcquisitionDevice {
void LoadCalibration(uint32_t handle);
virtual bool HW_ReadMailbox(uint32_t *values) = 0;
virtual bool HW_SendWorkRequest(uint32_t handle) = 0;
virtual void HW_SetSpotFinderParameters(const SpotFinderParameters &params) = 0;
virtual void HW_SetDataSource(uint32_t val) = 0;
virtual uint32_t HW_GetDataSource() = 0;
void StartSendingWorkRequests() override;
@@ -51,12 +50,13 @@ public:
void InitializeIntegrationMap(const DiffractionExperiment &experiment, const std::vector<uint16_t> &v) override;
void InitializeIntegrationMap(const DiffractionExperiment &experiment, const std::vector<uint16_t> &v,
const std::vector<float> &weights) override;
void InitializeSpotFinderResolutionMap(const DiffractionExperiment &experiment, const std::vector<float>& v);
void SetInternalGeneratorFrame(const std::vector<uint16_t> &v);
void SetInternalGeneratorFrame(const std::vector<int16_t> &v);
void SetInternalGeneratorFrameForAllModules(const std::vector<uint16_t> &v);
void SetInternalGeneratorFrame();
std::vector<uint16_t> GetInternalGeneratorFrame() const override;
void SetSpotFinderParameters(int32_t count_threshold, float snr_threshold) override;
AcquisitionDeviceSource GetDataSource() override;
void SetDefaultDataSource(AcquisitionDeviceSource id) override;
uint32_t GetExpectedDescriptorsPerModule() const override;

View File

@@ -254,6 +254,7 @@ void HLSSimulatedDevice::HLSMainThread() {
STREAM_768 stream_768_0;
STREAM_768 stream_768_1;
STREAM_768 stream_768_2;
STREAM_768 stream_768_3;
STREAM_512 converted_0;
STREAM_512 converted_1;
@@ -272,7 +273,7 @@ void HLSSimulatedDevice::HLSMainThread() {
hls::stream<axis_addr> addr2;
hls::stream<axis_addr> addr3;
hls::stream<axis_completion> compl0, compl1, compl2, compl2a, compl3, compl4, compl5, compl6, compl7;
hls::stream<axis_completion> compl0, compl1, compl2, compl2a, compl3, compl4, compl5, compl6, compl7, compl8;
hls::stream<ap_uint<16>> hbm_handles;
hls::stream<ap_uint<512>> adu_histo_result;
@@ -281,7 +282,10 @@ void HLSSimulatedDevice::HLSMainThread() {
hls::stream<ap_uint<512>> integration_result_1;
hls::stream<ap_axiu<32,1,1,1>> spot_finder_result_0;
hls::stream<ap_uint<512>> spot_finder_result_1;
hls::stream<ap_axiu<32,1,1,1>> spot_finder_result_1;
hls::stream<ap_uint<256>> spot_finder_conn_0;
hls::stream<ap_uint<512>> spot_finder_result_2;
hls::stream<ap_uint<32>> spot_finder_mask_0;
hls::stream<ap_uint<UDP_METADATA_STREAM_WIDTH> > udp_metadata;
volatile ap_uint<1> idle_data_collection = 1;
@@ -462,19 +466,54 @@ void HLSSimulatedDevice::HLSMainThread() {
hls_cores.emplace_back([&] { axis_64_to_512(integration_result_0, integration_result_1);});
// 8. Spot finding
ap_uint<32> tmp_snr_threshold = float2uint(snr_threshold);
hls_cores.emplace_back([&] { spot_finder(stream_768_1, stream_768_2, spot_finder_result_0,
count_threshold,tmp_snr_threshold);});
hls_cores.emplace_back([&] { axis_32_to_512(spot_finder_result_0, spot_finder_result_1);});
ap_uint<32> tmp_snr_threshold = float2uint(spot_finder_parameters.snr_threshold);
ap_uint<32> min_d = float2uint(spot_finder_parameters.min_d);
ap_uint<32> max_d = float2uint(spot_finder_parameters.max_d);
ap_int<32> tmp_count_threshold = spot_finder_parameters.count_threshold;
ap_uint<32> min_pix_per_spot = spot_finder_parameters.min_pix_per_spot;
hls_cores.emplace_back([&] {
spot_finder_mask(stream_768_1,
stream_768_2,
spot_finder_mask_0,
compl7,
compl8,
hbm.data(),
hbm.data(),
min_d,
max_d,
hbm_if_size);
logger_hls.Info("spot_finder_mask done");
});
hls_cores.emplace_back([&] {
spot_finder(stream_768_2, spot_finder_mask_0, stream_768_3, spot_finder_result_0, tmp_count_threshold, tmp_snr_threshold);
logger_hls.Info("spot_finder done");
});
hls_cores.emplace_back([&] {
spot_finder_connectivity(spot_finder_result_0,
spot_finder_result_1,
spot_finder_conn_0);
logger_hls.Info("spot_finder_connectivity done");
});
hls_cores.emplace_back([&] {
spot_finder_merge(spot_finder_result_1,
spot_finder_conn_0,
spot_finder_result_2,
min_pix_per_spot);
logger_hls.Info("spot_finder_merge done");
});
// 9. Reduce/extend 24-bit stream
hls_cores.emplace_back([&] { stream_24bit_conv(stream_768_2, converted_7, stream_conv_idle);});
hls_cores.emplace_back([&] { stream_24bit_conv(stream_768_3, converted_7, stream_conv_idle);});
// 10. Prepare data to write to host memory
hls_cores.emplace_back([&] {
ap_uint<3> state;
host_writer(converted_7, adu_histo_result, integration_result_1, spot_finder_result_1,
compl7, datamover_out.GetDataStream(),
host_writer(converted_7, adu_histo_result, integration_result_1, spot_finder_result_2,
compl8, datamover_out.GetDataStream(),
datamover_out.GetCtrlStream(), work_request_stream, completion_stream,
dma_address_table.data(), packets_processed, host_writer_idle, cancel_data_collection, state);});
@@ -618,8 +657,7 @@ void HLSSimulatedDevice::HW_LoadCalibration(const LoadCalibrationConfig &config)
}
void HLSSimulatedDevice::HW_SetSpotFinderParameters(const SpotFinderParameters &params) {
count_threshold = params.count_threshold;
snr_threshold = params.snr_threshold;
spot_finder_parameters = params;
}
void HLSSimulatedDevice::HW_SetDataSource(uint32_t val) {

View File

@@ -22,14 +22,13 @@ class HLSSimulatedDevice : public FPGAAcquisitionDevice {
uint32_t run_counter = 0;
ap_uint<2> data_source = STREAM_MERGE_SRC_100G;
ap_int<32> count_threshold = -1;
float snr_threshold = 0;
SpotFinderParameters spot_finder_parameters;
DataCollectionConfig cfg;
volatile bool idle;
constexpr static const size_t hbm_if_count = 28;
constexpr static const size_t hbm_if_count = 30;
constexpr static const size_t hbm_if_size = 32*1024*1024LU;
std::vector<ap_uint<256>> hbm;

View File

@@ -87,6 +87,8 @@ inline DetectorSettings Convert(const org::openapitools::server::model::Detector
ret.pedestal_g2_frames = input.getPedestalG2Frames();
if (input.storageCellDelayNsIsSet())
ret.storage_cell_delay_ns = input.getStorageCellDelayNs();
if (input.detectorTriggerDelayNsIsSet())
ret.detector_delay_ns = input.getDetectorTriggerDelayNs();
return ret;
}
@@ -107,6 +109,8 @@ inline org::openapitools::server::model::Detector_settings Convert(const Detecto
ret.setPedestalG2Frames(input.pedestal_g2_frames.value());
ret.setStorageCellDelayNs(input.storage_cell_delay_ns.value());
ret.setDetectorTriggerDelayNs(input.detector_delay_ns.value());
return ret;
}
@@ -156,6 +160,40 @@ inline org::openapitools::server::model::Calibration_statistics_inner Convert(co
return output;
}
inline org::openapitools::server::model::Detector_status Convert(const DetectorStatus &input) {
org::openapitools::server::model::Detector_status output;
output.setServerVersion(input.detector_server_version);
output.setNumberOfTriggersLeft(input.remaining_triggers);
output.setFpgaTempDegC(input.temperature_fpga_degC);
switch (input.power_state) {
case DetectorPowerState::ON:
output.setPowerchip("On");
break;
case DetectorPowerState::OFF:
output.setPowerchip("Off");
break;
case DetectorPowerState::PARTIAL:
output.setPowerchip("Partial");
break;
}
switch (input.detector_state) {
case DetectorState::IDLE:
output.setState("Idle");
break;
case DetectorState::ERROR:
output.setState("Error");
break;
case DetectorState::BUSY:
output.setState("Busy");
break;
case DetectorState::WAITING:
output.setState("Waiting");
break;
}
return output;
}
inline org::openapitools::server::model::Detector_list Convert(const DetectorList &input) {
org::openapitools::server::model::Detector_list ret;
std::vector<org::openapitools::server::model::Detector_list_detectors_inner> dets;
@@ -218,6 +256,22 @@ inline org::openapitools::server::model::Rad_int_settings Convert(const RadialIn
return ret;
}
inline PreviewJPEGSettings Convert(const org::openapitools::server::model::Preview_settings& input) {
PreviewJPEGSettings ret{};
ret.show_spots = input.isShowSpots();
ret.jpeg_quality = input.getJpegQuality();
ret.saturation_value = input.getSaturation();
return ret;
}
inline org::openapitools::server::model::Preview_settings Convert(const PreviewJPEGSettings& settings) {
org::openapitools::server::model::Preview_settings ret{};
ret.setJpegQuality(settings.jpeg_quality);
ret.setSaturation(settings.saturation_value);
ret.setShowSpots(settings.show_spots);
return ret;
}
inline DatasetSettings Convert(const org::openapitools::server::model::Dataset_settings& input) {
DatasetSettings ret;
@@ -401,7 +455,7 @@ void JFJochBrokerHttp::config_rad_int_get(Pistache::Http::ResponseWriter &respon
void JFJochBrokerHttp::config_rad_int_put(const org::openapitools::server::model::Rad_int_settings &radIntSettings,
Pistache::Http::ResponseWriter &response) {
state_machine.LoadRadialIntegrationSettings(Convert(radIntSettings));
state_machine.SetRadialIntegrationSettings(Convert(radIntSettings));
response.send(Pistache::Http::Code::Ok);
}
@@ -606,4 +660,46 @@ void JFJochBrokerHttp::plot_roi_sum_post(const org::openapitools::server::model:
req.binning = plotRequest.getBinning();
auto plot = state_machine.GetPlots(req);
ProcessOutput(Convert(plot), response);
}
}
void JFJochBrokerHttp::detector_status_get(Pistache::Http::ResponseWriter &response) {
auto out = state_machine.GetDetectorStatus();
if (out)
ProcessOutput(Convert(out.value()), response);
else
response.send(Pistache::Http::Code::Not_Found);
}
void JFJochBrokerHttp::preview_calibration_tiff_get(Pistache::Http::ResponseWriter &response) {
std::string s = state_machine.GetPreviewTIFF(true);
if (!s.empty())
response.send(Pistache::Http::Code::Ok, s, Pistache::Http::Mime::MediaType::fromString("image/tiff"));
else
response.send(Pistache::Http::Code::Not_Found);
}
void JFJochBrokerHttp::preview_image_jpeg_get(Pistache::Http::ResponseWriter &response) {
std::string s = state_machine.GetPreviewJPEG();
if (!s.empty())
response.send(Pistache::Http::Code::Ok, s, Pistache::Http::Mime::MediaType::fromString("image/jpeg"));
else
response.send(Pistache::Http::Code::Not_Found);
}
void JFJochBrokerHttp::preview_image_tiff_get(Pistache::Http::ResponseWriter &response) {
std::string s = state_machine.GetPreviewTIFF(false);
if (!s.empty())
response.send(Pistache::Http::Code::Ok, s, Pistache::Http::Mime::MediaType::fromString("image/tiff"));
else
response.send(Pistache::Http::Code::Not_Found);
}
void JFJochBrokerHttp::preview_jpeg_settings_get(Pistache::Http::ResponseWriter &response) {
ProcessOutput(Convert(state_machine.GetPreviewJPEGSettings()), response);
}
void JFJochBrokerHttp::preview_jpeg_settings_put(const org::openapitools::server::model::Preview_settings &previewSettings,
Pistache::Http::ResponseWriter &response) {
state_machine.SetPreviewJPEGSettings(Convert(previewSettings));
response.send(Pistache::Http::Code::Ok);
}

View File

@@ -33,6 +33,8 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
void config_select_detector_put(const org::openapitools::server::model::Detector_selection &detectorSelection,
Pistache::Http::ResponseWriter &response) override;
void detector_status_get(Pistache::Http::ResponseWriter &response) override;
void config_spot_finding_get(Pistache::Http::ResponseWriter &response) override;
void config_spot_finding_put(const org::openapitools::server::model::Spot_finding_settings &spotFindingSettings,
@@ -88,6 +90,18 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
void trigger_post(Pistache::Http::ResponseWriter &response) override;
void pedestal_post(Pistache::Http::ResponseWriter &response) override;
void preview_calibration_tiff_get(Pistache::Http::ResponseWriter &response) override;
void preview_image_jpeg_get(Pistache::Http::ResponseWriter &response) override;
void preview_image_tiff_get(Pistache::Http::ResponseWriter &response) override;
void preview_jpeg_settings_get(Pistache::Http::ResponseWriter &response) override;
void preview_jpeg_settings_put(const org::openapitools::server::model::Preview_settings &previewSettings,
Pistache::Http::ResponseWriter &response) override;
void GetStaticFile(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
std::pair<Pistache::Http::Code, std::string> handleOperationException(const std::exception &ex) const noexcept override;

View File

@@ -113,6 +113,20 @@ inline std::vector<std::string> GET_STR_ARR(const nlohmann::json &j, const std::
return ret;
}
inline std::vector<std::int64_t> GET_I64_ARR(const nlohmann::json &j, const std::string& tag) {
std::vector<std::int64_t> ret;
if (CHECK_ARRAY(j, tag)) {
try {
for (const auto &iter: j[tag])
ret.push_back(iter.get<int64_t>());
} catch (std::exception &e) {
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + ": " + e.what());
}
}
return ret;
}
DetectorModuleGeometry::Direction GET_DIRECTION(const nlohmann::json &j, const std::string& tag) {
if (j.contains(tag)) {
if (!j[tag].is_string())
@@ -218,6 +232,7 @@ DetectorSetup ParseDetectorSetup(const nlohmann::json &j) {
std::string description = GET_STR(j, "description");
auto module_hostname = GET_STR_ARR(j, "module_hostname");
auto gain_files = GET_STR_ARR(j, "gain_files");
auto tx_delay = GET_I64_ARR(j, "tx_delay");
DetectorSetup setup(geom, description, module_hostname);
if (!gain_files.empty())
@@ -226,7 +241,9 @@ DetectorSetup ParseDetectorSetup(const nlohmann::json &j) {
setup.UDPInterfaceCount(GET_I64(j, "udp_interface_count", 2))
.SensorThickness_um(GET_FLOAT(j, "sensor_thickness_um", 320.0f))
.PixelSize_um(GET_FLOAT(j, "pixel_size_um", 75.0f))
.SensorMaterial(GET_STR(j, "sensor_material", "Si"));
.SensorMaterial(GET_STR(j, "sensor_material", "Si"))
.TxDelay(tx_delay);
return setup;
}

View File

@@ -145,3 +145,24 @@ void JFJochServices::Trigger() {
if (detector && (receiver != nullptr))
detector->Trigger();
}
std::optional<DetectorStatus> JFJochServices::GetDetectorStatus() const {
if (detector)
return detector->GetStatus();
else
return {};
}
std::string JFJochServices::GetPreviewJPEG(const PreviewJPEGSettings &settings) const {
if (receiver != nullptr)
return receiver->GetJPEG(settings);
else
return PreviewImage::GenerateTestJPEG(settings);
}
std::string JFJochServices::GetPreviewTIFF(bool calibration) const {
if (receiver != nullptr)
return receiver->GetTIFF(calibration);
else
return "";
}

View File

@@ -34,6 +34,11 @@ public:
void SetSpotFindingSettings(const SpotFindingSettings &settings);
JFJochServices& Receiver(JFJochReceiverService *input);
JFJochServices& Detector();
std::optional<DetectorStatus> GetDetectorStatus() const;
std::string GetPreviewJPEG(const PreviewJPEGSettings &settings) const;
std::string GetPreviewTIFF(bool calibration) const;
};

View File

@@ -72,6 +72,8 @@ void ApplyDetectorSettings(DiffractionExperiment& experiment, const DetectorSett
experiment.PedestalG2Frames(settings.pedestal_g2_frames.value());
if (settings.storage_cell_delay_ns)
experiment.StorageCellDelay(std::chrono::nanoseconds(settings.storage_cell_delay_ns.value()));
if (settings.detector_delay_ns)
experiment.DetectorDelay(std::chrono::nanoseconds(settings.detector_delay_ns.value()));
} catch (...) {
experiment = tmp;
throw;
@@ -514,6 +516,7 @@ DetectorSettings JFJochStateMachine::GetDetectorSettings() const {
ret.pedestal_g1_frames = experiment.GetPedestalG1Frames();
ret.pedestal_g2_frames = experiment.GetPedestalG2Frames();
ret.storage_cell_delay_ns = experiment.GetStorageCellDelay().count();
ret.detector_delay_ns = experiment.GetDetectorDelay().count();
ret.fixed_gain_g1 = experiment.IsFixedGainG1();
ret.use_gain_hg0 = experiment.IsUsingGainHG0();
return ret;
@@ -591,7 +594,7 @@ void JFJochStateMachine::AddDetectorSetup(const DetectorSetup &setup) {
detector_setup.emplace_back(setup);
}
DetectorList JFJochStateMachine::GetDetectorsList() {
DetectorList JFJochStateMachine::GetDetectorsList() const {
std::unique_lock<std::mutex> ul(m);
DetectorList ret;
@@ -608,6 +611,10 @@ DetectorList JFJochStateMachine::GetDetectorsList() {
return ret;
}
std::optional<DetectorStatus> JFJochStateMachine::GetDetectorStatus() const {
return services.GetDetectorStatus();
}
void JFJochStateMachine::SelectDetector(int64_t id) {
std::unique_lock<std::mutex> ul(m);
@@ -628,7 +635,7 @@ void JFJochStateMachine::SelectDetector(int64_t id) {
}
}
void JFJochStateMachine::LoadRadialIntegrationSettings(const RadialIntegrationSettings &settings) {
void JFJochStateMachine::SetRadialIntegrationSettings(const RadialIntegrationSettings &settings) {
std::unique_lock<std::mutex> ul(m);
if (IsRunning())
@@ -682,4 +689,20 @@ std::optional<std::string> JFJochStateMachine::CheckError() {
return e.what();
}
return {};
}
}
void JFJochStateMachine::SetPreviewJPEGSettings(const PreviewJPEGSettings &settings) {
preview_jpeg_settings = settings;
}
PreviewJPEGSettings JFJochStateMachine::GetPreviewJPEGSettings() const {
return preview_jpeg_settings;
}
std::string JFJochStateMachine::GetPreviewJPEG() const {
return services.GetPreviewJPEG(preview_jpeg_settings);
}
std::string JFJochStateMachine::GetPreviewTIFF(bool calibration) const {
return services.GetPreviewTIFF(calibration);
}

View File

@@ -104,6 +104,7 @@ struct DetectorSettings {
std::optional<int64_t> pedestal_g2_frames;
std::optional<int64_t> storage_cell_delay_ns;
std::optional<int64_t> detector_delay_ns;
};
@@ -147,6 +148,11 @@ class JFJochStateMachine {
mutable std::mutex data_processing_settings_mutex;
SpotFindingSettings data_processing_settings;
// Not protected with mutex:
// little harm of having preview image out-of-sync, given these images are regularly recalculated
// while there is risk of deadlock with too many mutexes
PreviewJPEGSettings preview_jpeg_settings;
// Private functions assume that lock m is acquired
void SetDatasetDefaults(DatasetSettings& settings);
void MeasurementThread();
@@ -194,12 +200,18 @@ public:
JFJochState GetState() const;
void AddDetectorSetup(const DetectorSetup& setup);
DetectorList GetDetectorsList();
DetectorList GetDetectorsList() const;
void SelectDetector(int64_t id);
std::optional<DetectorStatus> GetDetectorStatus() const;
void LoadRadialIntegrationSettings(const RadialIntegrationSettings& settings);
void SetRadialIntegrationSettings(const RadialIntegrationSettings& settings);
RadialIntegrationSettings GetRadialIntegrationSettings() const;
void SetPreviewJPEGSettings(const PreviewJPEGSettings& settings);
PreviewJPEGSettings GetPreviewJPEGSettings() const;
std::string GetPreviewJPEG() const;
std::string GetPreviewTIFF(bool calibration) const;
// Not thread safe - only for configuration in serial context
DiffractionExperiment& NotThreadSafe_Experiment();

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -43,6 +43,7 @@ void DefaultApi::setupRoutes() {
Routes::Get(*router, base + "/config/spot_finding", Routes::bind(&DefaultApi::config_spot_finding_get_handler, this));
Routes::Put(*router, base + "/config/spot_finding", Routes::bind(&DefaultApi::config_spot_finding_put_handler, this));
Routes::Post(*router, base + "/deactivate", Routes::bind(&DefaultApi::deactivate_post_handler, this));
Routes::Get(*router, base + "/detector/status", Routes::bind(&DefaultApi::detector_status_get_handler, this));
Routes::Post(*router, base + "/initialize", Routes::bind(&DefaultApi::initialize_post_handler, this));
Routes::Post(*router, base + "/pedestal", Routes::bind(&DefaultApi::pedestal_post_handler, this));
Routes::Post(*router, base + "/plot/bkg_estimate", Routes::bind(&DefaultApi::plot_bkg_estimate_post_handler, this));
@@ -57,6 +58,11 @@ void DefaultApi::setupRoutes() {
Routes::Post(*router, base + "/plot/saturated_pixel", Routes::bind(&DefaultApi::plot_saturated_pixel_post_handler, this));
Routes::Post(*router, base + "/plot/spot_count", Routes::bind(&DefaultApi::plot_spot_count_post_handler, this));
Routes::Post(*router, base + "/plot/strong_pixel", Routes::bind(&DefaultApi::plot_strong_pixel_post_handler, this));
Routes::Get(*router, base + "/preview/calibration.tiff", Routes::bind(&DefaultApi::preview_calibration_tiff_get_handler, this));
Routes::Get(*router, base + "/preview/image.jpeg", Routes::bind(&DefaultApi::preview_image_jpeg_get_handler, this));
Routes::Get(*router, base + "/preview/image.tiff", Routes::bind(&DefaultApi::preview_image_tiff_get_handler, this));
Routes::Get(*router, base + "/preview/jpeg_settings", Routes::bind(&DefaultApi::preview_jpeg_settings_get_handler, this));
Routes::Put(*router, base + "/preview/jpeg_settings", Routes::bind(&DefaultApi::preview_jpeg_settings_put_handler, this));
Routes::Post(*router, base + "/start", Routes::bind(&DefaultApi::start_post_handler, this));
Routes::Get(*router, base + "/statistics/calibration", Routes::bind(&DefaultApi::statistics_calibration_get_handler, this));
Routes::Get(*router, base + "/statistics/data_collection", Routes::bind(&DefaultApi::statistics_data_collection_get_handler, this));
@@ -337,6 +343,26 @@ void DefaultApi::deactivate_post_handler(const Pistache::Rest::Request &, Pistac
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::detector_status_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
try {
try {
this->detector_status_get(response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception &e) {
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
response.send(errorInfo.first, errorInfo.second);
return;
}
} catch (std::exception &e) {
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::initialize_post_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
try {
@@ -734,6 +760,119 @@ void DefaultApi::plot_strong_pixel_post_handler(const Pistache::Rest::Request &r
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::preview_calibration_tiff_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
try {
try {
this->preview_calibration_tiff_get(response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception &e) {
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
response.send(errorInfo.first, errorInfo.second);
return;
}
} catch (std::exception &e) {
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::preview_image_jpeg_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
try {
try {
this->preview_image_jpeg_get(response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception &e) {
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
response.send(errorInfo.first, errorInfo.second);
return;
}
} catch (std::exception &e) {
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::preview_image_tiff_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
try {
try {
this->preview_image_tiff_get(response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception &e) {
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
response.send(errorInfo.first, errorInfo.second);
return;
}
} catch (std::exception &e) {
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::preview_jpeg_settings_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
try {
try {
this->preview_jpeg_settings_get(response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception &e) {
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
response.send(errorInfo.first, errorInfo.second);
return;
}
} catch (std::exception &e) {
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::preview_jpeg_settings_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
try {
// Getting the body param
Preview_settings previewSettings;
try {
nlohmann::json::parse(request.body()).get_to(previewSettings);
previewSettings.validate();
} catch (std::exception &e) {
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleParsingException(e);
response.send(errorInfo.first, errorInfo.second);
return;
}
try {
this->preview_jpeg_settings_put(previewSettings, response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception &e) {
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
response.send(errorInfo.first, errorInfo.second);
return;
}
} catch (std::exception &e) {
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::start_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
try {

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -32,10 +32,12 @@
#include "Detector_list.h"
#include "Detector_selection.h"
#include "Detector_settings.h"
#include "Detector_status.h"
#include "Error_message.h"
#include "Measurement_statistics.h"
#include "Plot.h"
#include "Plot_request.h"
#include "Preview_settings.h"
#include "Rad_int_settings.h"
#include "Radial_integration_plots_inner.h"
#include "Spot_finding_settings.h"
@@ -65,6 +67,7 @@ private:
void config_spot_finding_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_spot_finding_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void deactivate_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void detector_status_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void initialize_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void pedestal_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_bkg_estimate_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
@@ -79,6 +82,11 @@ private:
void plot_saturated_pixel_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_spot_count_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_strong_pixel_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void preview_calibration_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void preview_image_jpeg_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void preview_image_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void preview_jpeg_settings_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void preview_jpeg_settings_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void start_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void statistics_calibration_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void statistics_data_collection_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
@@ -126,7 +134,7 @@ private:
/// <param name="detectorSettings"> (optional)</param>
virtual void config_detector_put(const org::openapitools::server::model::Detector_settings &detectorSettings, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get data processing configuration
/// Get radial integration configuration
/// </summary>
/// <remarks>
/// Can be done anytime
@@ -178,6 +186,13 @@ private:
/// </remarks>
virtual void deactivate_post(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get detector status
/// </summary>
/// <remarks>
/// Status of the JUNGFRAU detector
/// </remarks>
virtual void detector_status_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Initialize detector and data acquisition
/// </summary>
/// <remarks>
@@ -285,6 +300,42 @@ private:
/// <param name="plotRequest"> (optional)</param>
virtual void plot_strong_pixel_post(const org::openapitools::server::model::Plot_request &plotRequest, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get last preview image in TIFF format for calibration with PyFAI/Dioptas
/// </summary>
/// <remarks>
/// Image is reduced to unsigned 16-bit images, all bad pixels are set to 65535 and image is mirrored in vertical direction
/// </remarks>
virtual void preview_calibration_tiff_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get last preview image in JPEG format
/// </summary>
/// <remarks>
///
/// </remarks>
virtual void preview_image_jpeg_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get last preview image in TIFF format
/// </summary>
/// <remarks>
///
/// </remarks>
virtual void preview_image_tiff_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get JPEG rendering configuration
/// </summary>
/// <remarks>
/// Can be done anytime
/// </remarks>
virtual void preview_jpeg_settings_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Configure JPEG rendering of preview images
/// </summary>
/// <remarks>
/// Can be done at any state of the detector
/// </remarks>
/// <param name="previewSettings"> (optional)</param>
virtual void preview_jpeg_settings_put(const org::openapitools::server::model::Preview_settings &previewSettings, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Start detector
/// </summary>
/// <remarks>

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,246 +0,0 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "Data_processing_settings.h"
#include "Helpers.h"
#include <sstream>
namespace org::openapitools::server::model
{
Data_processing_settings::Data_processing_settings()
{
m_Signal_to_noise_threshold = 0.0f;
m_Photon_count_threshold = 0L;
m_Min_pix_per_spot = 0L;
m_Max_pix_per_spot = 0L;
m_High_resolution_limit = 0.0f;
m_Low_resolution_limit = 0.0f;
m_Preview_indexed_only = false;
m_Preview_indexed_onlyIsSet = false;
}
void Data_processing_settings::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Data_processing_settings::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Data_processing_settings::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Data_processing_settings" : pathPrefix;
/* Signal_to_noise_threshold */ {
const float& value = m_Signal_to_noise_threshold;
const std::string currentValuePath = _pathPrefix + ".signalToNoiseThreshold";
if (value < static_cast<float>(0))
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
}
/* Photon_count_threshold */ {
const int64_t& value = m_Photon_count_threshold;
const std::string currentValuePath = _pathPrefix + ".photonCountThreshold";
if (value < 0ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
}
/* Min_pix_per_spot */ {
const int64_t& value = m_Min_pix_per_spot;
const std::string currentValuePath = _pathPrefix + ".minPixPerSpot";
if (value < 1ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 1;";
}
}
/* Max_pix_per_spot */ {
const int64_t& value = m_Max_pix_per_spot;
const std::string currentValuePath = _pathPrefix + ".maxPixPerSpot";
if (value < 1ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 1;";
}
}
return success;
}
bool Data_processing_settings::operator==(const Data_processing_settings& rhs) const
{
return
(getSignalToNoiseThreshold() == rhs.getSignalToNoiseThreshold())
&&
(getPhotonCountThreshold() == rhs.getPhotonCountThreshold())
&&
(getMinPixPerSpot() == rhs.getMinPixPerSpot())
&&
(getMaxPixPerSpot() == rhs.getMaxPixPerSpot())
&&
(getHighResolutionLimit() == rhs.getHighResolutionLimit())
&&
(getLowResolutionLimit() == rhs.getLowResolutionLimit())
&&
((!previewIndexedOnlyIsSet() && !rhs.previewIndexedOnlyIsSet()) || (previewIndexedOnlyIsSet() && rhs.previewIndexedOnlyIsSet() && isPreviewIndexedOnly() == rhs.isPreviewIndexedOnly()))
;
}
bool Data_processing_settings::operator!=(const Data_processing_settings& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Data_processing_settings& o)
{
j = nlohmann::json();
j["signal_to_noise_threshold"] = o.m_Signal_to_noise_threshold;
j["photon_count_threshold"] = o.m_Photon_count_threshold;
j["min_pix_per_spot"] = o.m_Min_pix_per_spot;
j["max_pix_per_spot"] = o.m_Max_pix_per_spot;
j["high_resolution_limit"] = o.m_High_resolution_limit;
j["low_resolution_limit"] = o.m_Low_resolution_limit;
if(o.previewIndexedOnlyIsSet())
j["preview_indexed_only"] = o.m_Preview_indexed_only;
}
void from_json(const nlohmann::json& j, Data_processing_settings& o)
{
j.at("signal_to_noise_threshold").get_to(o.m_Signal_to_noise_threshold);
j.at("photon_count_threshold").get_to(o.m_Photon_count_threshold);
j.at("min_pix_per_spot").get_to(o.m_Min_pix_per_spot);
j.at("max_pix_per_spot").get_to(o.m_Max_pix_per_spot);
j.at("high_resolution_limit").get_to(o.m_High_resolution_limit);
j.at("low_resolution_limit").get_to(o.m_Low_resolution_limit);
if(j.find("preview_indexed_only") != j.end())
{
j.at("preview_indexed_only").get_to(o.m_Preview_indexed_only);
o.m_Preview_indexed_onlyIsSet = true;
}
}
float Data_processing_settings::getSignalToNoiseThreshold() const
{
return m_Signal_to_noise_threshold;
}
void Data_processing_settings::setSignalToNoiseThreshold(float const value)
{
m_Signal_to_noise_threshold = value;
}
int64_t Data_processing_settings::getPhotonCountThreshold() const
{
return m_Photon_count_threshold;
}
void Data_processing_settings::setPhotonCountThreshold(int64_t const value)
{
m_Photon_count_threshold = value;
}
int64_t Data_processing_settings::getMinPixPerSpot() const
{
return m_Min_pix_per_spot;
}
void Data_processing_settings::setMinPixPerSpot(int64_t const value)
{
m_Min_pix_per_spot = value;
}
int64_t Data_processing_settings::getMaxPixPerSpot() const
{
return m_Max_pix_per_spot;
}
void Data_processing_settings::setMaxPixPerSpot(int64_t const value)
{
m_Max_pix_per_spot = value;
}
float Data_processing_settings::getHighResolutionLimit() const
{
return m_High_resolution_limit;
}
void Data_processing_settings::setHighResolutionLimit(float const value)
{
m_High_resolution_limit = value;
}
float Data_processing_settings::getLowResolutionLimit() const
{
return m_Low_resolution_limit;
}
void Data_processing_settings::setLowResolutionLimit(float const value)
{
m_Low_resolution_limit = value;
}
bool Data_processing_settings::isPreviewIndexedOnly() const
{
return m_Preview_indexed_only;
}
void Data_processing_settings::setPreviewIndexedOnly(bool const value)
{
m_Preview_indexed_only = value;
m_Preview_indexed_onlyIsSet = true;
}
bool Data_processing_settings::previewIndexedOnlyIsSet() const
{
return m_Preview_indexed_onlyIsSet;
}
void Data_processing_settings::unsetPreview_indexed_only()
{
m_Preview_indexed_onlyIsSet = false;
}
} // namespace org::openapitools::server::model

View File

@@ -1,120 +0,0 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Data_processing_settings.h
*
*
*/
#ifndef Data_processing_settings_H_
#define Data_processing_settings_H_
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
///
/// </summary>
class Data_processing_settings
{
public:
Data_processing_settings();
virtual ~Data_processing_settings() = default;
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes an error
/// message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
/// Not meant to be called outside that case.
/// </summary>
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
bool operator==(const Data_processing_settings& rhs) const;
bool operator!=(const Data_processing_settings& rhs) const;
/////////////////////////////////////////////
/// Data_processing_settings members
/// <summary>
///
/// </summary>
float getSignalToNoiseThreshold() const;
void setSignalToNoiseThreshold(float const value);
/// <summary>
///
/// </summary>
int64_t getPhotonCountThreshold() const;
void setPhotonCountThreshold(int64_t const value);
/// <summary>
///
/// </summary>
int64_t getMinPixPerSpot() const;
void setMinPixPerSpot(int64_t const value);
/// <summary>
///
/// </summary>
int64_t getMaxPixPerSpot() const;
void setMaxPixPerSpot(int64_t const value);
/// <summary>
///
/// </summary>
float getHighResolutionLimit() const;
void setHighResolutionLimit(float const value);
/// <summary>
///
/// </summary>
float getLowResolutionLimit() const;
void setLowResolutionLimit(float const value);
/// <summary>
///
/// </summary>
bool isPreviewIndexedOnly() const;
void setPreviewIndexedOnly(bool const value);
bool previewIndexedOnlyIsSet() const;
void unsetPreview_indexed_only();
friend void to_json(nlohmann::json& j, const Data_processing_settings& o);
friend void from_json(const nlohmann::json& j, Data_processing_settings& o);
protected:
float m_Signal_to_noise_threshold;
int64_t m_Photon_count_threshold;
int64_t m_Min_pix_per_spot;
int64_t m_Max_pix_per_spot;
float m_High_resolution_limit;
float m_Low_resolution_limit;
bool m_Preview_indexed_only;
bool m_Preview_indexed_onlyIsSet;
};
} // namespace org::openapitools::server::model
#endif /* Data_processing_settings_H_ */

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -38,6 +38,8 @@ Detector_settings::Detector_settings()
m_Pedestal_g2_framesIsSet = false;
m_Storage_cell_delay_ns = 0L;
m_Storage_cell_delay_nsIsSet = false;
m_Detector_trigger_delay_ns = 0L;
m_Detector_trigger_delay_nsIsSet = false;
m_Fixed_gain_g1 = false;
m_Fixed_gain_g1IsSet = false;
m_Use_gain_hg0 = false;
@@ -139,7 +141,7 @@ bool Detector_settings::validate(std::stringstream& msg, const std::string& path
}
}
return success;
}
@@ -176,6 +178,9 @@ bool Detector_settings::operator==(const Detector_settings& rhs) const
((!storageCellDelayNsIsSet() && !rhs.storageCellDelayNsIsSet()) || (storageCellDelayNsIsSet() && rhs.storageCellDelayNsIsSet() && getStorageCellDelayNs() == rhs.getStorageCellDelayNs())) &&
((!detectorTriggerDelayNsIsSet() && !rhs.detectorTriggerDelayNsIsSet()) || (detectorTriggerDelayNsIsSet() && rhs.detectorTriggerDelayNsIsSet() && getDetectorTriggerDelayNs() == rhs.getDetectorTriggerDelayNs())) &&
((!fixedGainG1IsSet() && !rhs.fixedGainG1IsSet()) || (fixedGainG1IsSet() && rhs.fixedGainG1IsSet() && isFixedGainG1() == rhs.isFixedGainG1())) &&
@@ -209,6 +214,8 @@ void to_json(nlohmann::json& j, const Detector_settings& o)
j["pedestal_g2_frames"] = o.m_Pedestal_g2_frames;
if(o.storageCellDelayNsIsSet())
j["storage_cell_delay_ns"] = o.m_Storage_cell_delay_ns;
if(o.detectorTriggerDelayNsIsSet())
j["detector_trigger_delay_ns"] = o.m_Detector_trigger_delay_ns;
if(o.fixedGainG1IsSet())
j["fixed_gain_g1"] = o.m_Fixed_gain_g1;
if(o.useGainHg0IsSet())
@@ -259,6 +266,11 @@ void from_json(const nlohmann::json& j, Detector_settings& o)
j.at("storage_cell_delay_ns").get_to(o.m_Storage_cell_delay_ns);
o.m_Storage_cell_delay_nsIsSet = true;
}
if(j.find("detector_trigger_delay_ns") != j.end())
{
j.at("detector_trigger_delay_ns").get_to(o.m_Detector_trigger_delay_ns);
o.m_Detector_trigger_delay_nsIsSet = true;
}
if(j.find("fixed_gain_g1") != j.end())
{
j.at("fixed_gain_g1").get_to(o.m_Fixed_gain_g1);
@@ -416,6 +428,23 @@ void Detector_settings::unsetStorage_cell_delay_ns()
{
m_Storage_cell_delay_nsIsSet = false;
}
int64_t Detector_settings::getDetectorTriggerDelayNs() const
{
return m_Detector_trigger_delay_ns;
}
void Detector_settings::setDetectorTriggerDelayNs(int64_t const value)
{
m_Detector_trigger_delay_ns = value;
m_Detector_trigger_delay_nsIsSet = true;
}
bool Detector_settings::detectorTriggerDelayNsIsSet() const
{
return m_Detector_trigger_delay_nsIsSet;
}
void Detector_settings::unsetDetector_trigger_delay_ns()
{
m_Detector_trigger_delay_nsIsSet = false;
}
bool Detector_settings::isFixedGainG1() const
{
return m_Fixed_gain_g1;

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -119,6 +119,13 @@ public:
bool storageCellDelayNsIsSet() const;
void unsetStorage_cell_delay_ns();
/// <summary>
/// Delay between TTL trigger and acquisition start
/// </summary>
int64_t getDetectorTriggerDelayNs() const;
void setDetectorTriggerDelayNs(int64_t const value);
bool detectorTriggerDelayNsIsSet() const;
void unsetDetector_trigger_delay_ns();
/// <summary>
/// Fix gain to G1 (can be useful for storage cells)
/// </summary>
bool isFixedGainG1() const;
@@ -154,6 +161,8 @@ protected:
bool m_Pedestal_g2_framesIsSet;
int64_t m_Storage_cell_delay_ns;
bool m_Storage_cell_delay_nsIsSet;
int64_t m_Detector_trigger_delay_ns;
bool m_Detector_trigger_delay_nsIsSet;
bool m_Fixed_gain_g1;
bool m_Fixed_gain_g1IsSet;
bool m_Use_gain_hg0;

View File

@@ -0,0 +1,242 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "Detector_status.h"
#include "Helpers.h"
#include <sstream>
namespace org::openapitools::server::model
{
Detector_status::Detector_status()
{
m_State = "";
m_StateIsSet = false;
m_Powerchip = "";
m_PowerchipIsSet = false;
m_Server_version = "";
m_Server_versionIsSet = false;
m_Number_of_triggers_left = 0L;
m_Number_of_triggers_leftIsSet = false;
m_Fpga_temp_degCIsSet = false;
}
void Detector_status::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Detector_status::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Detector_status::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Detector_status" : pathPrefix;
if (fpgaTempDegCIsSet())
{
const std::vector<int64_t>& value = m_Fpga_temp_degC;
const std::string currentValuePath = _pathPrefix + ".fpgaTempDegC";
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const int64_t& value : value)
{
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
i++;
}
}
}
return success;
}
bool Detector_status::operator==(const Detector_status& rhs) const
{
return
((!stateIsSet() && !rhs.stateIsSet()) || (stateIsSet() && rhs.stateIsSet() && getState() == rhs.getState())) &&
((!powerchipIsSet() && !rhs.powerchipIsSet()) || (powerchipIsSet() && rhs.powerchipIsSet() && getPowerchip() == rhs.getPowerchip())) &&
((!serverVersionIsSet() && !rhs.serverVersionIsSet()) || (serverVersionIsSet() && rhs.serverVersionIsSet() && getServerVersion() == rhs.getServerVersion())) &&
((!numberOfTriggersLeftIsSet() && !rhs.numberOfTriggersLeftIsSet()) || (numberOfTriggersLeftIsSet() && rhs.numberOfTriggersLeftIsSet() && getNumberOfTriggersLeft() == rhs.getNumberOfTriggersLeft())) &&
((!fpgaTempDegCIsSet() && !rhs.fpgaTempDegCIsSet()) || (fpgaTempDegCIsSet() && rhs.fpgaTempDegCIsSet() && getFpgaTempDegC() == rhs.getFpgaTempDegC()))
;
}
bool Detector_status::operator!=(const Detector_status& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Detector_status& o)
{
j = nlohmann::json();
if(o.stateIsSet())
j["state"] = o.m_State;
if(o.powerchipIsSet())
j["powerchip"] = o.m_Powerchip;
if(o.serverVersionIsSet())
j["server_version"] = o.m_Server_version;
if(o.numberOfTriggersLeftIsSet())
j["number_of_triggers_left"] = o.m_Number_of_triggers_left;
if(o.fpgaTempDegCIsSet() || !o.m_Fpga_temp_degC.empty())
j["fpga_temp_degC"] = o.m_Fpga_temp_degC;
}
void from_json(const nlohmann::json& j, Detector_status& o)
{
if(j.find("state") != j.end())
{
j.at("state").get_to(o.m_State);
o.m_StateIsSet = true;
}
if(j.find("powerchip") != j.end())
{
j.at("powerchip").get_to(o.m_Powerchip);
o.m_PowerchipIsSet = true;
}
if(j.find("server_version") != j.end())
{
j.at("server_version").get_to(o.m_Server_version);
o.m_Server_versionIsSet = true;
}
if(j.find("number_of_triggers_left") != j.end())
{
j.at("number_of_triggers_left").get_to(o.m_Number_of_triggers_left);
o.m_Number_of_triggers_leftIsSet = true;
}
if(j.find("fpga_temp_degC") != j.end())
{
j.at("fpga_temp_degC").get_to(o.m_Fpga_temp_degC);
o.m_Fpga_temp_degCIsSet = true;
}
}
std::string Detector_status::getState() const
{
return m_State;
}
void Detector_status::setState(std::string const& value)
{
m_State = value;
m_StateIsSet = true;
}
bool Detector_status::stateIsSet() const
{
return m_StateIsSet;
}
void Detector_status::unsetState()
{
m_StateIsSet = false;
}
std::string Detector_status::getPowerchip() const
{
return m_Powerchip;
}
void Detector_status::setPowerchip(std::string const& value)
{
m_Powerchip = value;
m_PowerchipIsSet = true;
}
bool Detector_status::powerchipIsSet() const
{
return m_PowerchipIsSet;
}
void Detector_status::unsetPowerchip()
{
m_PowerchipIsSet = false;
}
std::string Detector_status::getServerVersion() const
{
return m_Server_version;
}
void Detector_status::setServerVersion(std::string const& value)
{
m_Server_version = value;
m_Server_versionIsSet = true;
}
bool Detector_status::serverVersionIsSet() const
{
return m_Server_versionIsSet;
}
void Detector_status::unsetServer_version()
{
m_Server_versionIsSet = false;
}
int64_t Detector_status::getNumberOfTriggersLeft() const
{
return m_Number_of_triggers_left;
}
void Detector_status::setNumberOfTriggersLeft(int64_t const value)
{
m_Number_of_triggers_left = value;
m_Number_of_triggers_leftIsSet = true;
}
bool Detector_status::numberOfTriggersLeftIsSet() const
{
return m_Number_of_triggers_leftIsSet;
}
void Detector_status::unsetNumber_of_triggers_left()
{
m_Number_of_triggers_leftIsSet = false;
}
std::vector<int64_t> Detector_status::getFpgaTempDegC() const
{
return m_Fpga_temp_degC;
}
void Detector_status::setFpgaTempDegC(std::vector<int64_t> const value)
{
m_Fpga_temp_degC = value;
m_Fpga_temp_degCIsSet = true;
}
bool Detector_status::fpgaTempDegCIsSet() const
{
return m_Fpga_temp_degCIsSet;
}
void Detector_status::unsetFpga_temp_degC()
{
m_Fpga_temp_degCIsSet = false;
}
} // namespace org::openapitools::server::model

View File

@@ -0,0 +1,116 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Detector_status.h
*
*
*/
#ifndef Detector_status_H_
#define Detector_status_H_
#include <string>
#include <vector>
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
///
/// </summary>
class Detector_status
{
public:
Detector_status();
virtual ~Detector_status() = default;
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes an error
/// message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
/// Not meant to be called outside that case.
/// </summary>
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
bool operator==(const Detector_status& rhs) const;
bool operator!=(const Detector_status& rhs) const;
/////////////////////////////////////////////
/// Detector_status members
/// <summary>
/// Current state of the detector
/// </summary>
std::string getState() const;
void setState(std::string const& value);
bool stateIsSet() const;
void unsetState();
/// <summary>
/// Power on of ASICs
/// </summary>
std::string getPowerchip() const;
void setPowerchip(std::string const& value);
bool powerchipIsSet() const;
void unsetPowerchip();
/// <summary>
/// Detector server (on read-out boards) version
/// </summary>
std::string getServerVersion() const;
void setServerVersion(std::string const& value);
bool serverVersionIsSet() const;
void unsetServer_version();
/// <summary>
/// Remaining triggers to the detector (max of all modules)
/// </summary>
int64_t getNumberOfTriggersLeft() const;
void setNumberOfTriggersLeft(int64_t const value);
bool numberOfTriggersLeftIsSet() const;
void unsetNumber_of_triggers_left();
/// <summary>
/// Temperature of detector FPGAs
/// </summary>
std::vector<int64_t> getFpgaTempDegC() const;
void setFpgaTempDegC(std::vector<int64_t> const value);
bool fpgaTempDegCIsSet() const;
void unsetFpga_temp_degC();
friend void to_json(nlohmann::json& j, const Detector_status& o);
friend void from_json(const nlohmann::json& j, Detector_status& o);
protected:
std::string m_State;
bool m_StateIsSet;
std::string m_Powerchip;
bool m_PowerchipIsSet;
std::string m_Server_version;
bool m_Server_versionIsSet;
int64_t m_Number_of_triggers_left;
bool m_Number_of_triggers_leftIsSet;
std::vector<int64_t> m_Fpga_temp_degC;
bool m_Fpga_temp_degCIsSet;
};
} // namespace org::openapitools::server::model
#endif /* Detector_status_H_ */

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -0,0 +1,187 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "Preview_settings.h"
#include "Helpers.h"
#include <sstream>
namespace org::openapitools::server::model
{
Preview_settings::Preview_settings()
{
m_Saturation = 0L;
m_Show_spots = true;
m_Show_spotsIsSet = false;
m_Jpeg_quality = 0L;
m_Jpeg_qualityIsSet = false;
}
void Preview_settings::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Preview_settings::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Preview_settings::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Preview_settings" : pathPrefix;
/* Saturation */ {
const int64_t& value = m_Saturation;
const std::string currentValuePath = _pathPrefix + ".saturation";
if (value < 0ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
if (value > 65535ll)
{
success = false;
msg << currentValuePath << ": must be less than or equal to 65535;";
}
}
if (jpegQualityIsSet())
{
const int64_t& value = m_Jpeg_quality;
const std::string currentValuePath = _pathPrefix + ".jpegQuality";
if (value < 0ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
if (value > 100ll)
{
success = false;
msg << currentValuePath << ": must be less than or equal to 100;";
}
}
return success;
}
bool Preview_settings::operator==(const Preview_settings& rhs) const
{
return
(getSaturation() == rhs.getSaturation())
&&
((!showSpotsIsSet() && !rhs.showSpotsIsSet()) || (showSpotsIsSet() && rhs.showSpotsIsSet() && isShowSpots() == rhs.isShowSpots())) &&
((!jpegQualityIsSet() && !rhs.jpegQualityIsSet()) || (jpegQualityIsSet() && rhs.jpegQualityIsSet() && getJpegQuality() == rhs.getJpegQuality()))
;
}
bool Preview_settings::operator!=(const Preview_settings& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Preview_settings& o)
{
j = nlohmann::json();
j["saturation"] = o.m_Saturation;
if(o.showSpotsIsSet())
j["show_spots"] = o.m_Show_spots;
if(o.jpegQualityIsSet())
j["jpeg_quality"] = o.m_Jpeg_quality;
}
void from_json(const nlohmann::json& j, Preview_settings& o)
{
j.at("saturation").get_to(o.m_Saturation);
if(j.find("show_spots") != j.end())
{
j.at("show_spots").get_to(o.m_Show_spots);
o.m_Show_spotsIsSet = true;
}
if(j.find("jpeg_quality") != j.end())
{
j.at("jpeg_quality").get_to(o.m_Jpeg_quality);
o.m_Jpeg_qualityIsSet = true;
}
}
int64_t Preview_settings::getSaturation() const
{
return m_Saturation;
}
void Preview_settings::setSaturation(int64_t const value)
{
m_Saturation = value;
}
bool Preview_settings::isShowSpots() const
{
return m_Show_spots;
}
void Preview_settings::setShowSpots(bool const value)
{
m_Show_spots = value;
m_Show_spotsIsSet = true;
}
bool Preview_settings::showSpotsIsSet() const
{
return m_Show_spotsIsSet;
}
void Preview_settings::unsetShow_spots()
{
m_Show_spotsIsSet = false;
}
int64_t Preview_settings::getJpegQuality() const
{
return m_Jpeg_quality;
}
void Preview_settings::setJpegQuality(int64_t const value)
{
m_Jpeg_quality = value;
m_Jpeg_qualityIsSet = true;
}
bool Preview_settings::jpegQualityIsSet() const
{
return m_Jpeg_qualityIsSet;
}
void Preview_settings::unsetJpeg_quality()
{
m_Jpeg_qualityIsSet = false;
}
} // namespace org::openapitools::server::model

View File

@@ -0,0 +1,94 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Preview_settings.h
*
* Settings for JPEG rendering of preview images
*/
#ifndef Preview_settings_H_
#define Preview_settings_H_
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
/// Settings for JPEG rendering of preview images
/// </summary>
class Preview_settings
{
public:
Preview_settings();
virtual ~Preview_settings() = default;
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes an error
/// message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
/// Not meant to be called outside that case.
/// </summary>
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
bool operator==(const Preview_settings& rhs) const;
bool operator!=(const Preview_settings& rhs) const;
/////////////////////////////////////////////
/// Preview_settings members
/// <summary>
/// Saturation value to set contrast in the preview image
/// </summary>
int64_t getSaturation() const;
void setSaturation(int64_t const value);
/// <summary>
/// Show spot finding results on the image
/// </summary>
bool isShowSpots() const;
void setShowSpots(bool const value);
bool showSpotsIsSet() const;
void unsetShow_spots();
/// <summary>
/// Quality of JPEG image (100 - highest; 0 - lowest)
/// </summary>
int64_t getJpegQuality() const;
void setJpegQuality(int64_t const value);
bool jpegQualityIsSet() const;
void unsetJpeg_quality();
friend void to_json(nlohmann::json& j, const Preview_settings& o);
friend void from_json(const nlohmann::json& j, Preview_settings& o);
protected:
int64_t m_Saturation;
bool m_Show_spots;
bool m_Show_spotsIsSet;
int64_t m_Jpeg_quality;
bool m_Jpeg_qualityIsSet;
};
} // namespace org::openapitools::server::model
#endif /* Preview_settings_H_ */

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@ openapi: 3.0.3
info:
title: Jungfraujoch
description: Jungfraujoch Broker Web API
version: 1.0.0
version: 1.0.1
components:
schemas:
rotation_axis:
@@ -209,6 +209,43 @@ components:
type: number
format: float
example: 90
detector_status:
type: object
required:
- state
- powerchip
- server_version
- number_of_triggers_left
- fpga_temp_degC
properties:
state:
type: string
description: Current state of the detector
enum:
- Idle
- Waiting
- Busy
- Error
powerchip:
type: string
description: Power on of ASICs
enum:
- On
- Off
- Partial
server_version:
type: string
description: Detector server (on read-out boards) version
number_of_triggers_left:
type: integer
format: int64
description: Remaining triggers to the detector (max of all modules)
fpga_temp_degC:
type: array
description: Temperature of detector FPGAs
items:
type: integer
format: int64
detector_settings:
type: object
required:
@@ -253,6 +290,10 @@ components:
type: integer
format: int64
description: Delay between two storage cells
detector_trigger_delay_ns:
type: integer
format: int64
description: Delay between TTL trigger and acquisition start
fixed_gain_g1:
type: boolean
default: false
@@ -526,6 +567,29 @@ components:
masked_pixels:
type: integer
format: int64
preview_settings:
type: object
description: "Settings for JPEG rendering of preview images"
required:
- saturation
properties:
saturation:
type: integer
format: int64
minimum: 0
maximum: 65535
description: "Saturation value to set contrast in the preview image"
show_spots:
type: boolean
default: true
description: "Show spot finding results on the image"
jpeg_quality:
type: integer
description: "Quality of JPEG image (100 - highest; 0 - lowest)"
format: int64
minimum: 0
maximum: 100
error_message:
type: object
required:
@@ -769,7 +833,7 @@ paths:
schema:
$ref: '#/components/schemas/error_message'
get:
summary: Get data processing configuration
summary: Get radial integration configuration
description: Can be done anytime
responses:
"200":
@@ -828,6 +892,27 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/broker_status'
/detector/status:
get:
summary: Get detector status
description: Status of the JUNGFRAU detector
responses:
"200":
description: Everything OK
content:
application/json:
schema:
$ref: '#/components/schemas/detector_status'
"404":
description: Running in "simulator" mode - no detector present
"500":
description: Error encountered when trying to read status
content:
text/plain:
schema:
type: string
description: Exception error
/plot/bkg_estimate:
post:
summary: Generate background estimate plot
@@ -1093,3 +1178,78 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/calibration_statistics'
/preview/image.jpeg:
get:
summary: Get last preview image in JPEG format
responses:
"200":
description: Preview image
content:
image/jpeg:
schema:
type: string
format: binary
"404":
description: No preview image recorded so far
/preview/jpeg_settings:
put:
summary: Configure JPEG rendering of preview images
description: Can be done at any state of the detector
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/preview_settings'
responses:
"200":
description: Everything OK
"400":
description: Input parsing or validation error
content:
text/plain:
schema:
type: string
description: Exception error
"500":
description: Error within Jungfraujoch code - see output message.
content:
application/json:
schema:
$ref: '#/components/schemas/error_message'
get:
summary: Get JPEG rendering configuration
description: Can be done anytime
responses:
"200":
description: Everything OK
content:
application/json:
schema:
$ref: '#/components/schemas/preview_settings'
/preview/image.tiff:
get:
summary: Get last preview image in TIFF format
responses:
"200":
description: Preview image
content:
image/tiff:
schema:
type: string
format: binary
"404":
description: No preview image recorded so far
/preview/calibration.tiff:
get:
summary: Get last preview image in TIFF format for calibration with PyFAI/Dioptas
description: Image is reduced to unsigned 16-bit images, all bad pixels are set to 65535 and image is mirrored in vertical direction
responses:
"200":
description: Preview image
content:
image/tiff:
schema:
type: string
format: binary
"404":
description: No preview image recorded so far

File diff suppressed because one or more lines are too long

View File

@@ -45,7 +45,7 @@ ADD_LIBRARY( CommonFunctions STATIC
../fpga/include/jfjoch_fpga.h
ZMQWrappers.cpp ZMQWrappers.h)
TARGET_LINK_LIBRARIES(CommonFunctions Compression JFCalibration libzmq -lrt)
TARGET_LINK_LIBRARIES(CommonFunctions Compression JFCalibration "$<BUILD_INTERFACE:libzmq-static>" -lrt)
IF (CMAKE_CUDA_COMPILER)
TARGET_SOURCES(CommonFunctions PRIVATE CUDAWrapper.cu )

View File

@@ -9,7 +9,9 @@ DetectorSetup::DetectorSetup(const DetectorGeometry &in_geometry)
DetectorSetup::DetectorSetup(const DetectorGeometry &in_geometry,
const std::string &in_description,
const std::vector<std::string> &in_det_modules_hostname) :
geometry(in_geometry), description(in_description), det_modules_hostname(in_det_modules_hostname) {
geometry(in_geometry),
description(in_description),
det_modules_hostname(in_det_modules_hostname) {
if (!det_modules_hostname.empty() && (geometry.GetModulesNum() != det_modules_hostname.size()))
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"Mismatch between number of modules in detector geometry and hostname");
@@ -81,3 +83,19 @@ DetectorSetup &DetectorSetup::PixelSize_um(float input) {
pixel_size_um = input;
return *this;
}
DetectorSetup &DetectorSetup::TxDelay(const std::vector<int64_t> &v) {
if (!v.empty() && (v.size() != GetModulesNum()))
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"Mismatch between size of TX delay vector and modules number");
for (const auto &i: v) {
if ((i < 0) || (i > 31))
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "TX delay must be in range 0-31");
}
tx_delay = v;
return *this;
}
const std::vector<int64_t> &DetectorSetup::GetTxDelay() const {
return tx_delay;
}

View File

@@ -15,6 +15,7 @@ class DetectorSetup {
float pixel_size_um = 75.0f;
std::string sensor_material = "Si";
float sensor_thickness_um = 320.0f;
std::vector<int64_t> tx_delay;
public:
DetectorSetup(const DetectorGeometry& geom);
DetectorSetup(const DetectorGeometry& geom,
@@ -23,6 +24,7 @@ public:
void LoadGain(const std::vector<std::string> &filenames);
DetectorSetup& TxDelay(const std::vector<int64_t> &v);
DetectorSetup& UDPInterfaceCount(int64_t input);
DetectorSetup& SensorMaterial(const std::string &input);
DetectorSetup& SensorThickness_um(float input);
@@ -37,6 +39,7 @@ public:
[[nodiscard]] std::string GetSensorMaterial() const;
[[nodiscard]] const std::vector<JFModuleGainCalibration> &GetGainCalibration() const;
[[nodiscard]] int64_t GetUDPInterfaceCount() const;
[[nodiscard]] const std::vector<int64_t> &GetTxDelay() const; // can be empty for default
};

View File

@@ -61,6 +61,7 @@ DiffractionExperiment::DiffractionExperiment(const DetectorSetup& det_setup) : d
storage_cells = 1;
storage_cell_start = 15;
storage_cell_delay = std::chrono::nanoseconds(10*1000);
detector_delay = std::chrono::nanoseconds(0);
pedestal_g0_frames = 0;
pedestal_g1_frames = 0;
@@ -71,6 +72,8 @@ DiffractionExperiment::DiffractionExperiment(const DetectorSetup& det_setup) : d
series_id = 0;
conversion_on_fpga = true;
Mode(DetectorMode::Conversion);
}
@@ -1119,3 +1122,28 @@ DiffractionExperiment &DiffractionExperiment::ROISummation(const std::optional<R
std::optional<ROIRectangle> DiffractionExperiment::GetROISummation() const {
return dataset.roi_sum;
}
DiffractionExperiment &DiffractionExperiment::ConversionOnFPGA(bool input) {
conversion_on_fpga = input;
return *this;
}
bool DiffractionExperiment::IsConversionOnFPGA() const {
if (GetDetectorMode() == DetectorMode::Conversion)
return conversion_on_fpga;
else
return false;
}
DiffractionExperiment &DiffractionExperiment::DetectorDelay(std::chrono::nanoseconds input) {
detector_delay = input;
return *this;
}
std::chrono::nanoseconds DiffractionExperiment::GetDetectorDelay() const {
return detector_delay;
}
const DetectorSetup &DiffractionExperiment::GetDetectorSetup() const {
return detector;
}

View File

@@ -57,6 +57,7 @@ class DiffractionExperiment {
int64_t storage_cells;
int64_t storage_cell_start;
std::chrono::nanoseconds storage_cell_delay;
std::chrono::nanoseconds detector_delay;
int64_t pedestal_g0_frames;
int64_t pedestal_g1_frames;
int64_t pedestal_g2_frames;
@@ -86,6 +87,8 @@ class DiffractionExperiment {
bool debug_pixel_mask;
Coord default_omega_axis;
bool conversion_on_fpga;
uint64_t series_id;
// Dataset settings
@@ -193,6 +196,7 @@ public:
DiffractionExperiment& ImageAppendix(const std::string& input);
DiffractionExperiment& IncrementSeriesID();
DiffractionExperiment& ROISummation(const std::optional<ROIRectangle>& input);
DiffractionExperiment& ConversionOnFPGA(bool input);
void FillMessage(StartMessage &message) const;
@@ -225,6 +229,9 @@ public:
DiffractionExperiment& StorageCellDelay(std::chrono::nanoseconds input);
std::chrono::nanoseconds GetStorageCellDelay() const;
DiffractionExperiment& DetectorDelay(std::chrono::nanoseconds input);
std::chrono::nanoseconds GetDetectorDelay() const;
float GetPhotonEnergy_keV() const;
float GetWavelength_A() const;
float GetBeamX_pxl() const;
@@ -333,6 +340,9 @@ public:
uint64_t GetSeriesID() const;
std::string GetSeriesIDString() const;
std::optional<ROIRectangle> GetROISummation() const;
bool IsConversionOnFPGA() const;
const DetectorSetup& GetDetectorSetup() const;
};
inline int64_t CalculateStride(const std::chrono::microseconds &frame_time, const std::chrono::microseconds &preview_time) {

View File

@@ -116,4 +116,18 @@ inline std::vector<float> CalcRadIntCorrRawCoord(const DiffractionExperiment& ex
return corr;
}
inline std::vector<float> CalcSpotFinderResolutionMap(const DiffractionExperiment& experiment) {
std::vector<float> corr(experiment.GetModulesNum() * RAW_MODULE_SIZE, 1.0);
for (int m = 0; m < experiment.GetModulesNum(); m++) {
for (int i = 0; i < RAW_MODULE_SIZE; i++) {
auto [x,y] = RawToConvertedCoordinate(experiment, m, i);
corr[m * RAW_MODULE_SIZE + i] = PxlToRes(experiment, static_cast<float>(x), static_cast<float>(y));
}
}
return corr;
}
#endif //JUNGFRAUJOCH_DIFFRACTIONGEOMETRY_H

View File

@@ -115,12 +115,18 @@ void DetectorWrapper::Start(const DiffractionExperiment& experiment) {
}
}
auto tx_delay = experiment.GetDetectorSetup().GetTxDelay();
if (tx_delay.size() == experiment.GetModulesNum()) {
for (int i = 0 ; i < tx_delay.size(); i++)
det.setTransmissionDelayFrame(tx_delay[i], {i});
}
if (experiment.IsUsingGainHG0())
det.setSettings(slsDetectorDefs::HIGHGAIN0);
else
det.setSettings(slsDetectorDefs::GAIN0);
det.setDelayAfterTrigger(experiment.GetDetectorDelay());
det.setNextFrameNumber(1);
if (experiment.GetNumTriggers() == 1) {
@@ -220,19 +226,24 @@ void DetectorWrapper::Trigger() {
logger.Info(" ... done");
}
DetectorWrapper::DetectorState DetectorWrapper::GetState() const {
DetectorState DetectorWrapper::GetState() const {
try {
bool is_idle = true;
for (auto & i : det.getDetectorStatus()) {
bool is_waiting = true;
for (const auto & i : det.getDetectorStatus()) {
if (i == slsDetectorDefs::runStatus::ERROR)
return DetectorState::ERROR;
if ((i != slsDetectorDefs::runStatus::IDLE) &&
(i != slsDetectorDefs::runStatus::STOPPED) &&
(i != slsDetectorDefs::runStatus::RUN_FINISHED))
is_idle = false;
if (i != slsDetectorDefs::WAITING)
is_waiting = false;
}
if (is_idle)
return DetectorState::IDLE;
else if (is_waiting)
return DetectorState::WAITING;
else
return DetectorState::BUSY;
} catch (std::exception &e) {
@@ -240,7 +251,30 @@ DetectorWrapper::DetectorState DetectorWrapper::GetState() const {
}
}
int64_t DetectorWrapper::GetFirmwareVersion() {
int64_t DetectorWrapper::GetNumberOfTriggersLeft() const {
int64_t ret = 0;
for (const auto & i : det.getNumberOfTriggersLeft()) {
if (i > ret)
ret = i;
}
return ret;
}
DetectorPowerState DetectorWrapper::GetPowerState() const {
uint64_t count_on = 0;
for (const auto &i : det.getPowerChip()) {
if (i) count_on++;
}
if (count_on == 0)
return DetectorPowerState::OFF;
else if (count_on == det.size())
return DetectorPowerState::ON;
else
return DetectorPowerState::PARTIAL;
}
int64_t DetectorWrapper::GetFirmwareVersion() const {
try {
auto result = det.getFirmwareVersion();
return result.squash(0x0);
@@ -249,11 +283,33 @@ int64_t DetectorWrapper::GetFirmwareVersion() {
}
}
std::string DetectorWrapper::GetDetectorServerVersion() {
std::string DetectorWrapper::GetDetectorServerVersion() const {
try {
auto result = det.getDetectorServerVersion();
return result.squash("");
return result.squash("mixed");
} catch (std::exception &e) {
throw JFJochException(JFJochExceptionCategory::Detector, e.what());
}
}
std::vector<int64_t> DetectorWrapper::GetFPGATemperatures() const {
try {
auto result = det.getTemperature(slsDetectorDefs::TEMPERATURE_FPGA);
std::vector<int64_t> ret;
for (int i = 0; i < result.size(); i++)
ret.push_back(result[i]);
return ret;
} catch (std::exception &e) {
throw JFJochException(JFJochExceptionCategory::Detector, e.what());
}
}
DetectorStatus DetectorWrapper::GetStatus() const {
DetectorStatus status;
status.detector_server_version = GetDetectorServerVersion();
status.detector_state = GetState();
status.power_state = GetPowerState();
status.remaining_triggers = GetNumberOfTriggersLeft();
status.temperature_fpga_degC = GetFPGATemperatures();
return status;
}

View File

@@ -11,20 +11,35 @@
#define HIGH_VOLTAGE 120
#define THRESHOLD_TEMPERATURE_DEGC 60
enum class DetectorState {IDLE, ERROR, BUSY, WAITING};
enum class DetectorPowerState {ON, OFF, PARTIAL};
struct DetectorStatus {
std::vector<int64_t> temperature_fpga_degC;
DetectorState detector_state;
DetectorPowerState power_state;
std::string detector_server_version;
int64_t remaining_triggers;
};
class DetectorWrapper {
Logger logger{"DetectorWrapper"};
sls::Detector det;
void InternalStop();
public:
enum class DetectorState {IDLE, ERROR, BUSY};
[[nodiscard]] DetectorState GetState() const;
[[nodiscard]] int64_t GetNumberOfTriggersLeft() const;
[[nodiscard]] DetectorPowerState GetPowerState() const;
int64_t GetFirmwareVersion() const;
std::string GetDetectorServerVersion() const;
std::vector<int64_t> GetFPGATemperatures() const;
public:
void Configure(const DiffractionExperiment& experiment, const std::vector<AcquisitionDeviceNetConfig>& net_config);
void Start(const DiffractionExperiment& experiment);
void Stop();
void Trigger();
void Deactivate();
int64_t GetFirmwareVersion();
std::string GetDetectorServerVersion();
DetectorStatus GetStatus() const;
};

View File

@@ -1,16 +1,25 @@
FIND_PACKAGE(TIFF COMPONENTS CXX)
FIND_PACKAGE(JPEG)
FIND_PACKAGE(TIFF COMPONENTS CXX REQUIRED)
FIND_PACKAGE(JPEG REQUIRED)
ADD_LIBRARY(ExportImage STATIC WriteTIFF.cpp WriteTIFF.h WriteJPEG.cpp WriteJPEG.h)
ADD_LIBRARY(ExportImage STATIC
WriteTIFF.cpp WriteTIFF.h
WriteJPEG.cpp WriteJPEG.h
PreviewImage.cpp PreviewImage.h)
IF (${TIFF_FOUND})
TARGET_COMPILE_DEFINITIONS(ExportImage PUBLIC -DJFJOCH_USE_TIFF)
TARGET_LINK_LIBRARIES(ExportImage PUBLIC CommonFunctions)
IF((EXISTS ${TIFF_INCLUDE_DIR}/tiffio.hxx) AND (EXISTS ${TIFF_INCLUDE_DIR}/tiffio.h))
TARGET_INCLUDE_DIRECTORIES(ExportImage PRIVATE ${TIFF_INCLUDE_DIR})
TARGET_LINK_LIBRARIES(ExportImage PUBLIC ${TIFF_LIBRARIES})
MESSAGE(STATUS "TIFF headers present and library included")
ELSE()
MESSAGE(FATAL_ERROR "TIFF headers tiffio.h and tiffio.hxx not present")
ENDIF()
IF (${JPEG_FOUND})
TARGET_COMPILE_DEFINITIONS(ExportImage PUBLIC -DJFJOCH_USE_JPEG)
IF (EXISTS ${JPEG_INCLUDE_DIR}/jpeglib.h)
TARGET_INCLUDE_DIRECTORIES(ExportImage PRIVATE ${JPEG_INCLUDE_DIR})
TARGET_LINK_LIBRARIES(ExportImage PUBLIC ${JPEG_LIBRARIES})
ENDIF()
MESSAGE(STATUS "JPEG headers present and library included")
ELSE()
MESSAGE(FATAL_ERROR "JPEG header jpeglib.h not found")
ENDIF()

View File

@@ -0,0 +1,217 @@
// Copyright (2019-2024) Paul Scherrer Institute
#include "PreviewImage.h"
#include <cmath>
#include "WriteJPEG.h"
#include "WriteTIFF.h"
#include "../common/JFJochException.h"
PreviewImage::PreviewImage(const DiffractionExperiment &experiment) :
xpixel(experiment.GetXPixelsNum()),
ypixel(experiment.GetYPixelsNum()),
beam_x(experiment.GetBeamX_pxl()),
beam_y(experiment.GetBeamY_pxl()),
pixel_depth_bytes(experiment.GetPixelDepth()),
pixel_is_signed(experiment.IsPixelSigned()),
uncompressed_image(experiment.GetPixelsNum() * experiment.GetPixelDepth()) {
}
void PreviewImage::UpdateImage(const void *in_uncompressed_image,
const std::vector<SpotToSave> &in_spots) {
std::unique_lock<std::mutex> ul(m);
memcpy(uncompressed_image.data(), in_uncompressed_image, xpixel * ypixel * pixel_depth_bytes);
spots = in_spots;
}
#define JFJOCH_JPEG_BASE_R (0x3f)
#define JFJOCH_JPEG_BASE_G (0x51)
#define JFJOCH_JPEG_BASE_B (0xb5)
void colormap(std::vector<unsigned char>& ret, float v, size_t pixel) {
if ((v < 0.0) || (v > 1.0)) {
ret[pixel * 3] = 0xBE;
ret[pixel * 3+1] = 0xBE;
ret[pixel * 3+2] = 0xBE;
} else {
ret[pixel * 3] = 255 - std::lround((255-JFJOCH_JPEG_BASE_R) * v);
ret[pixel * 3 + 1] = 255 - std::lround((255-JFJOCH_JPEG_BASE_G) * v);
ret[pixel * 3 + 2] = 255 - std::lround((255-JFJOCH_JPEG_BASE_B) * v);
}
}
void feature(std::vector<unsigned char>& ret, size_t pixel) {
ret[pixel * 3] = 0xE9;
ret[pixel * 3+1] = 0x1E;
ret[pixel * 3+2] = 0x63;
}
void spot(std::vector<unsigned char>& ret, int64_t pixel, bool indexed) {
if (indexed) {
ret[pixel * 3] = 0xE9;
ret[pixel * 3 + 1] = 0x1E;
ret[pixel * 3 + 2] = 0x63;
} else {
ret[pixel * 3] = 0xCD;
ret[pixel * 3 + 1] = 0xDC;
ret[pixel * 3 + 2] = 0x39;
}
}
template<class T>
std::vector<unsigned char> GenerateRGB(const T* value, size_t npixel, uint32_t saturation_value, T special_value) {
std::vector<unsigned char> ret(3*npixel, 0);
for (int i = 0; i < npixel; i++) {
if (value[i] == special_value) {
colormap(ret, -1.0, i);
} else if (value[i] >= static_cast<T>(saturation_value))
colormap(ret, 1.0, i);
else if (value[i] <= 0)
colormap(ret, 0.0, i);
else {
colormap(ret, value[i] / static_cast<float>(saturation_value), i);
}
}
return ret;
}
std::string PreviewImage::GenerateJPEG(const PreviewJPEGSettings &settings) const {
if (!pixel_is_signed)
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Unsigned images not allowed");
std::vector<unsigned char> v;
{
// JPEG compression is outside the critical loop protected by m
std::unique_lock<std::mutex> ul(m);
if (pixel_depth_bytes == 2)
v = GenerateRGB<int16_t>((int16_t *) uncompressed_image.data(), xpixel * ypixel, settings.saturation_value,
INT16_MIN);
else
v = GenerateRGB<int32_t>((int32_t *) uncompressed_image.data(), xpixel * ypixel, settings.saturation_value,
INT32_MIN);
AddSpots(v);
}
AddBeamCenter(v);
return WriteJPEGToMem(v, xpixel, ypixel, settings.jpeg_quality);
}
std::string PreviewImage::GenerateTIFF() const {
std::unique_lock<std::mutex> ul(m);
std::string s = WriteTIFFToString(const_cast<uint8_t *>(uncompressed_image.data()),
xpixel, ypixel, pixel_depth_bytes, pixel_is_signed);
return s;
}
template <class T>
std::vector<uint16_t> GenerateDioptasPreview(const void* input, size_t xpixel, size_t ypixel, T special_value) {
auto input_ptr = (T *) input;
std::vector<uint16_t> vec(xpixel * ypixel);
for (int y = 0; y < ypixel; y++) {
for (int x = 0; x < xpixel; x++) {
T val = input_ptr[(ypixel - 1 - y) * xpixel + x];
if ((val == special_value) || (val >= UINT16_MAX))
vec[y * xpixel + x] = UINT16_MAX;
else if (val <= 0)
vec [y * xpixel + x] = 0;
else
vec[y * xpixel + x] = val;
}
}
return vec;
}
std::string PreviewImage::GenerateTIFFDioptas() const {
std::unique_lock<std::mutex> ul(m);
std::vector<uint16_t> vec;
if (pixel_depth_bytes == 2)
vec = GenerateDioptasPreview<int16_t>(uncompressed_image.data(), xpixel, ypixel, INT16_MIN);
else
vec = GenerateDioptasPreview<int32_t>(uncompressed_image.data(), xpixel, ypixel, INT32_MIN);
return WriteTIFFToString(vec.data(), xpixel, ypixel, 2, false);
}
std::string PreviewImage::GenerateTestJPEG(const PreviewJPEGSettings &settings) {
std::vector<unsigned char> v;
size_t xpixel = 1030 * 3 + 2 * 8;
size_t ypixel = 514 * 6 + 5 * 36;
std::vector<int16_t> uncompressed_image(xpixel * ypixel, 5);
for (int y = 0; y < ypixel; y++) {
for (int gap = 1; gap <= 2; gap++) {
for (int pixel = 0; pixel < 8; pixel++)
uncompressed_image[y * xpixel + 1030 * gap + 8 * (gap - 1) + pixel] = INT16_MIN;
}
}
for (int gap = 1; gap <= 5; gap++) {
for (int pixel = 0; pixel < 36; pixel++) {
for (int x = 0; x < xpixel; x++)
uncompressed_image[(gap * 514 + 36 * (gap - 1) + pixel) * xpixel + x] = INT16_MIN;
}
}
v = GenerateRGB<int16_t>((int16_t *) uncompressed_image.data(), xpixel * ypixel, settings.saturation_value,
INT16_MIN);
size_t beam_x_int = std::lround(1200);
size_t beam_y_int = std::lround(800);
int crosshair_size = 30;
int crosshair_width = 3;
for (int w = -crosshair_width; w < crosshair_width; w++) {
for (int i = -crosshair_size; i < crosshair_size; i++) {
feature(v, (beam_y_int + w) * xpixel + beam_x_int + i);
feature(v, (beam_y_int + i) * xpixel + beam_x_int + w);
}
}
return WriteJPEGToMem(v, xpixel, ypixel, settings.jpeg_quality);
}
void PreviewImage::AddBeamCenter(std::vector<uint8_t> &rgb_image) const {
size_t beam_x_int = std::lround(beam_x);
size_t beam_y_int = std::lround(beam_y);
int crosshair_size = 30;
int crosshair_width = 3;
for (int w = -crosshair_width; w <= crosshair_width; w++) {
for (int i = -crosshair_size; i <= crosshair_size; i++) {
feature(rgb_image, (beam_y_int + w) * xpixel + beam_x_int + i);
feature(rgb_image, (beam_y_int + i) * xpixel + beam_x_int + w);
}
}
}
void PreviewImage::AddSpots(std::vector<uint8_t> &rgb_image) const {
for (const auto &s: spots) {
int64_t spot_x_int = std::lround(s.x);
int64_t spot_y_int = std::lround(s.y);
int rectangle_size = 4;
int rectangle_width = 3;
if ((spot_x_int - rectangle_width < 0)
|| (spot_x_int + rectangle_width >= xpixel)
|| (spot_y_int - rectangle_width < 0)
|| (spot_y_int + rectangle_width >= ypixel))
continue;
for (int z = rectangle_size; z < rectangle_size + rectangle_width; z++) {
for (int w = -z; w <= z; w++) {
spot(rgb_image, (spot_y_int + w) * xpixel + spot_x_int + z, s.indexed);
spot(rgb_image, (spot_y_int + w) * xpixel + spot_x_int - z, s.indexed);
spot(rgb_image, (spot_y_int + z) * xpixel + spot_x_int + w, s.indexed);
spot(rgb_image, (spot_y_int - z) * xpixel + spot_x_int - w, s.indexed);
}
}
}
}

View File

@@ -0,0 +1,40 @@
// Copyright (2019-2024) Paul Scherrer Institute
#ifndef JUNGFRAUJOCH_PREVIEWIMAGE_H
#define JUNGFRAUJOCH_PREVIEWIMAGE_H
#include <vector>
#include <mutex>
#include "../common/SpotToSave.h"
#include "../common/DiffractionExperiment.h"
struct PreviewJPEGSettings {
int64_t saturation_value = 10;
int64_t jpeg_quality = 70;
bool show_spots = true;
};
class PreviewImage {
mutable std::mutex m;
std::vector<uint8_t> uncompressed_image;
std::vector<SpotToSave> spots;
size_t xpixel;
size_t ypixel;
size_t pixel_depth_bytes;
bool pixel_is_signed;
float beam_x;
float beam_y;
void AddBeamCenter(std::vector<uint8_t> &rgb_image) const;
void AddSpots(std::vector<uint8_t> &rgb_image) const;
public:
explicit PreviewImage(const DiffractionExperiment& experiment);
void UpdateImage(const void *uncompressed_image, const std::vector<SpotToSave> &spots);
[[nodiscard]] std::string GenerateJPEG(const PreviewJPEGSettings& settings) const;
[[nodiscard]] std::string GenerateTIFF() const;
[[nodiscard]] std::string GenerateTIFFDioptas() const;
[[nodiscard]] static std::string GenerateTestJPEG(const PreviewJPEGSettings& settings);
};
#endif //JUNGFRAUJOCH_PREVIEWIMAGE_H

View File

@@ -1,16 +1,20 @@
// Copyright (2019-2024) Paul Scherrer Institute
#ifdef JFJOCH_USE_JPEG
#include <cstdio>
#include <cstdint>
#include <cstddef>
#include <vector>
#include <cstdio>
#include <cmath>
#include <jpeglib.h>
#endif
void WriteJPEG(const std::vector<char> &input, size_t width, size_t height) {
#include "../common/JFJochException.h"
#include "WriteJPEG.h"
std::string WriteJPEGToMem(const std::vector<uint8_t> &input, size_t width, size_t height, int quality) {
unsigned char *buf;
unsigned long buf_size;
unsigned long buf_size = 0;
if (width * height * 3 != input.size())
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Invalid array size for WriteJPEG");
struct jpeg_compress_struct cinfo;
struct jpeg_error_mgr jerr;
@@ -26,16 +30,22 @@ void WriteJPEG(const std::vector<char> &input, size_t width, size_t height) {
jpeg_set_defaults(&cinfo);
/*set the quality [0..100] */
jpeg_set_quality (&cinfo, 75, true);
jpeg_set_quality (&cinfo, quality, true);
jpeg_simple_progression(&cinfo);
jpeg_start_compress(&cinfo, true);
JSAMPROW row_pointer; /* pointer to a single row */
while (cinfo.next_scanline < cinfo.image_height) {
row_pointer = (JSAMPROW) (input.data() + cinfo.next_scanline*(sizeof(char)>>3)*width);
row_pointer = (JSAMPROW) (input.data() + cinfo.next_scanline*(sizeof(char)*3)*width);
jpeg_write_scanlines(&cinfo, &row_pointer, 1);
}
jpeg_finish_compress(&cinfo);
jpeg_destroy_compress(&cinfo);
}
if (buf_size > 0)
return {(char *)buf, buf_size};
else
return "";
}

View File

@@ -3,5 +3,9 @@
#ifndef JUNGFRAUJOCH_WRITEJPEG_H
#define JUNGFRAUJOCH_WRITEJPEG_H
#include <vector>
#include <string>
std::string WriteJPEGToMem(const std::vector<unsigned char> &input, size_t width, size_t height, int quality = 70);
#endif //JUNGFRAUJOCH_WRITEJPEG_H

View File

@@ -1,18 +1,15 @@
// Copyright (2019-2024) Paul Scherrer Institute
#include <tiffio.h>
#include <tiffio.hxx>
#include <sstream>
#include "WriteTIFF.h"
#include "../common/JFJochException.h"
#ifdef JFJOCH_USE_TIFF
#include <tiffio.h>
#include <tiffio.hxx>
#include <sstream>
#endif
void WriteTIFF(TIFF *tiff, void *buff, size_t cols, size_t lines, size_t elem_size, bool is_signed) {
#ifndef JFJOCH_USE_TIFF
throw JFJochException(JFJochExceptionCategory::TIFFGeneratorError, "Compiled without TIFF support");
#else
if (tiff == nullptr)
throw JFJochException(JFJochExceptionCategory::TIFFGeneratorError, "TIFFStreamOpen error");
@@ -29,13 +26,9 @@ void WriteTIFF(TIFF *tiff, void *buff, size_t cols, size_t lines, size_t elem_si
if (TIFFWriteEncodedStrip(tiff, 0, buff, cols * lines * elem_size) < 0)
throw JFJochException(JFJochExceptionCategory::TIFFGeneratorError, "TIFFWriteEncodedStrip error");
#endif
}
std::string WriteTIFFToString(void *buff, size_t cols, size_t lines, size_t elem_size, bool is_signed) {
#ifndef JFJOCH_USE_TIFF
throw JFJochException(JFJochExceptionCategory::TIFFGeneratorError, "Compiled without TIFF support");
#else
std::stringstream os;
TIFF *tiff = TIFFStreamOpen("x", (std::ostream *) &os);
@@ -43,18 +36,13 @@ std::string WriteTIFFToString(void *buff, size_t cols, size_t lines, size_t elem
TIFFClose(tiff);
return os.str();
#endif
}
void WriteTIFFToFile(const std::string &filename, void *buff, size_t cols, size_t lines, size_t elem_size,
bool is_signed) {
#ifndef JFJOCH_USE_TIFF
throw JFJochException(JFJochExceptionCategory::TIFFGeneratorError, "Compiled without TIFF support");
#else
TIFF *tiff = TIFFOpen(filename.c_str(), "w");
WriteTIFF(tiff, buff, cols, lines, elem_size, is_signed);
TIFFClose(tiff);
#endif
}
}

View File

@@ -51,6 +51,9 @@
`define ADDR_SPOT_FINDER_CNT_THR 16'h0100
`define ADDR_SPOT_FINDER_SNR_THR 16'h0104
`define ADDR_SPOT_FINDER_D_MIN 16'h0108
`define ADDR_SPOT_FINDER_D_MAX 16'h010C
`define ADDR_SPOT_FINDER_MIN_PIX 16'h0110
`define ADDR_MAC_ADDR_LO 16'h0200
`define ADDR_MAC_ADDR_HI 16'h0204
@@ -104,9 +107,13 @@ module action_config
output reg [7:0] nsummation ,
output reg [1:0] data_source ,
output wire [31:0] hbm_size_bytes ,
output reg [31:0] spot_finder_count_threshold,
output reg [31:0] spot_finder_snr_threshold,
output reg [31:0] spot_finder_d_min ,
output reg [31:0] spot_finder_d_max ,
output reg [31:0] spot_finder_min_pix_per_spot,
output reg data_collection_start ,
output reg data_collection_cancel ,
input data_collection_idle ,
@@ -445,6 +452,15 @@ always @(posedge clk) begin
`ADDR_SPOT_FINDER_SNR_THR: begin
rdata <= spot_finder_snr_threshold;
end
`ADDR_SPOT_FINDER_D_MIN: begin
rdata <= spot_finder_d_min;
end
`ADDR_SPOT_FINDER_D_MAX: begin
rdata <= spot_finder_d_max;
end
`ADDR_SPOT_FINDER_MIN_PIX: begin
rdata <= spot_finder_min_pix_per_spot;
end
`ADDR_RUN_COUNTER: begin
rdata <= reg_data_acquisition_count;
end
@@ -621,6 +637,27 @@ always @(posedge clk) begin
spot_finder_count_threshold <= (s_axi_WDATA[31:0] & wmask[31:0]) | (spot_finder_count_threshold & !wmask[31:0]);
end
always @(posedge clk) begin
if (!resetn)
spot_finder_d_min <= 0;
else if (w_hs && waddr == `ADDR_SPOT_FINDER_D_MIN)
spot_finder_d_min <= (s_axi_WDATA[31:0] & wmask[31:0]) | (spot_finder_d_min & !wmask[31:0]);
end
always @(posedge clk) begin
if (!resetn)
spot_finder_d_max <= 0;
else if (w_hs && waddr == `ADDR_SPOT_FINDER_D_MAX)
spot_finder_d_max <= (s_axi_WDATA[31:0] & wmask[31:0]) | (spot_finder_d_max & !wmask[31:0]);
end
always @(posedge clk) begin
if (!resetn)
spot_finder_min_pix_per_spot <= 0;
else if (w_hs && waddr == `ADDR_SPOT_FINDER_MIN_PIX)
spot_finder_min_pix_per_spot <= (s_axi_WDATA[31:0] & wmask[31:0]) | ( spot_finder_min_pix_per_spot & !wmask[31:0]);
end
always @ (posedge clk) begin
if (!resetn)
begin

View File

@@ -25,7 +25,10 @@ ADD_LIBRARY( HLSSimulation STATIC
frame_summation.cpp
frame_summation_reorder_compl.cpp
pedestal.cpp
stream_24bit_conv.cpp)
stream_24bit_conv.cpp
spot_finder_merge.cpp
spot_finder_connectivity.cpp
spot_finder_mask.cpp)
TARGET_INCLUDE_DIRECTORIES(HLSSimulation PUBLIC ../include)
TARGET_LINK_LIBRARIES(HLSSimulation CommonFunctions)
@@ -83,12 +86,14 @@ MAKE_HLS_MODULE(integration integration.cpp integration_tb.cpp)
MAKE_HLS_MODULE(spot_finder spot_finder.cpp spot_finder_tb.cpp)
MAKE_HLS_MODULE(axis_broadcast axis_broadcast.cpp "")
MAKE_HLS_MODULE(axis_64_to_512 axis_helpers.cpp "")
MAKE_HLS_MODULE(axis_32_to_512 axis_helpers.cpp "")
MAKE_HLS_MODULE(adu_histo adu_histo.cpp adu_histo_tb.cpp)
MAKE_HLS_MODULE(pedestal pedestal.cpp "")
MAKE_HLS_MODULE(frame_summation frame_summation.cpp frame_summation_tb_2.cpp)
MAKE_HLS_MODULE(frame_summation_reorder_compl frame_summation_reorder_compl.cpp "")
MAKE_HLS_MODULE(stream_24bit_conv stream_24bit_conv.cpp stream_24bit_conv_tb.cpp)
MAKE_HLS_MODULE(spot_finder_mask spot_finder_mask.cpp "")
MAKE_HLS_MODULE(spot_finder_merge spot_finder_merge.cpp "")
MAKE_HLS_MODULE(spot_finder_connectivity spot_finder_connectivity.cpp "")
SET (HLS_IPS ${HLS_IPS} PARENT_SCOPE)
ADD_CUSTOM_TARGET(hls DEPENDS ${HLS_IPS})

View File

@@ -24,23 +24,3 @@ void axis_64_to_512(hls::stream<ap_axiu<64,1,1,1>> &data_in,
}
}
void axis_32_to_512(hls::stream<ap_axiu<32,1,1,1>> &data_in,
hls::stream<ap_uint<512>> &data_out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis register both port=data_in
#pragma HLS INTERFACE axis register both port=data_out
ap_axiu<32,1,1,1> packet_32;
data_in >> packet_32;
while (!packet_32.user) {
#pragma HLS PIPELINE II=16
ap_uint<512> val = 0;
val(31,0) = packet_32.data;
for (int i = 1; i < 16; i++) {
data_in >> packet_32;
val(i * 32 + 31, i * 32) = packet_32.data;
}
data_out << val;
data_in >> packet_32;
}
}

View File

@@ -13,9 +13,15 @@
#ifndef JFJOCH_HLS_NOSYNTH
#include <ap_axi_sdata.h>
#include <hls_stream.h>
#include <hls_math.h>
#else
#define ap_wait()
#include "parallel_stream.h"
#include <cmath>
namespace hls {
inline bool isfinite(float f) {return std::isfinite(f);}
}
#endif
#include "../include/jfjoch_fpga.h"
@@ -26,13 +32,14 @@
#define INT24_MAX 8388607
#define INT24_MIN (-8388608)
#define AXI_STREAM_ID_FULL_NETWORK_STACK 0 // For 100G provide full network stack - enforce MAC/IPv4 and provide provide ARP/ICMP
#define AXI_STREAM_ID_FULL_NETWORK_STACK 0 // For 100G provide full network stack - enforce MAC/IPv4 and provide ARP/ICMP
#define AXI_STREAM_ID_SIMPLIFIED_NETWORK_STACK 1 // For 4x10G the connection is direct detector-DCU, so no need to enforce MAC/IPv4 and to provide ARP and ICMP
typedef ap_ufixed<16,2, AP_RND_CONV> gainG0_t;
typedef ap_ufixed<16,4, AP_RND_CONV> gainG1_t;
typedef ap_ufixed<16,6, AP_RND_CONV> gainG2_t;
typedef ap_ufixed<16,1, AP_RND_CONV> integration_factor_t;
typedef ap_ufixed<16,9, AP_RND_CONV> xray_d_t;
typedef ap_ufixed<32,12,AP_RND_CONV> one_over_energy_t;
@@ -51,9 +58,9 @@ template<int D,int U,int TI,int TD>
};
#endif
typedef ap_axiu<512,1, 1, 1> packet_512_t;
typedef ap_axiu<576,1, 1, 1> packet_576_t;
typedef ap_axiu<768,1, 1, 1> packet_768_t;
typedef ap_axiu<512, 1, 1, 1> packet_512_t;
typedef ap_axiu<576, 1, 1, 1> packet_576_t;
typedef ap_axiu<768, 1, 1, 1> packet_768_t;
typedef hls::stream<packet_512_t> AXI_STREAM;
typedef hls::stream<packet_512_t> STREAM_512;
@@ -113,9 +120,6 @@ void stream_merge(AXI_STREAM &input_100g,
void axis_64_to_512(hls::stream<ap_axiu<64,1,1,1>> &data_in,
hls::stream<ap_uint<512>> &data_out);
void axis_32_to_512(hls::stream<ap_axiu<32,1,1,1>> &data_in,
hls::stream<ap_uint<512>> &data_out);
template<int N> ap_uint<N*32> pack32(ap_int<N> in[32]) {
#pragma HLS INLINE
ap_uint<N*32> out;
@@ -180,6 +184,20 @@ inline ap_uint<16> get_header_field_16(ap_uint<512> data, size_t position) {
return retval;
}
template <class T>
T float_conv(const ap_uint<32> &input) {
#pragma HLS INLINE
float_uint32 tmp;
tmp.u = input;
if (hls::isfinite(tmp.f)) {
T ret = tmp.f;
return ret;
} else {
T ret = 0;
return ret;
}
}
static const uint8_t ECHO_REQUEST = 0x08;
static const uint8_t ECHO_REPLY = 0x00;
static const uint8_t PROTOCOL_ICMP = 0x01;
@@ -280,6 +298,7 @@ void jf_conversion(STREAM_512 &data_in, STREAM_576 &data_out,
ap_uint<32> hbm_size_bytes);
void spot_finder(STREAM_768 &data_in,
hls::stream<ap_uint<32>> &mask_in,
STREAM_768 &data_out,
hls::stream<ap_axiu<32,1,1,1>> &strong_pixel_out,
volatile ap_int<32> &in_count_threshold,
@@ -399,4 +418,24 @@ void frame_summation_reorder_compl(STREAM_512 &data_in,
void stream_24bit_conv(STREAM_768 &data_in, STREAM_512 &data_out,
volatile ap_uint<1> &idle);
void spot_finder_connectivity(hls::stream<ap_axiu<32,1,1,1>> &data_in,
hls::stream<ap_axiu<32,1,1,1>> &data_out,
hls::stream<ap_uint<256>> &connectivity_out);
void spot_finder_merge(hls::stream<ap_axiu<32,1,1,1>> &data_in,
hls::stream<ap_uint<256>> &connectivity_in,
hls::stream<ap_uint<512>> &data_out,
volatile ap_uint<32> &in_min_pix_per_spot);
void spot_finder_mask(STREAM_768 &data_in,
STREAM_768 &data_out,
hls::stream<ap_uint<32>> &mask_out,
hls::stream<axis_completion > &s_axis_completion,
hls::stream<axis_completion > &m_axis_completion,
ap_uint<256> *d_hbm_p0,
ap_uint<256> *d_hbm_p1,
volatile ap_uint<32> &in_min_d_value,
volatile ap_uint<32> &in_max_d_value,
ap_uint<32> hbm_size_bytes);
#endif

View File

@@ -139,7 +139,7 @@ void host_writer(STREAM_512 &data_in,
if (send_images) {
setup_datamover(datamover_out_cmd, req_host_offset, RAW_MODULE_SIZE * pixel_depth);
setup_datamover(datamover_out_cmd, req_host_offset + offsetof(DeviceOutput, spot_finding_result),
RAW_MODULE_SIZE * sizeof(uint16_t) / 16 + 64);
(SPOT_FINDER_MAX_STRONG_PIXEL / 16 + 1) * 64);
setup_datamover(datamover_out_cmd, req_host_offset + offsetof(DeviceOutput, integration_result),
(FPGA_INTEGRATION_BIN_COUNT / 8) * 64);
setup_datamover(datamover_out_cmd, req_host_offset + offsetof(DeviceOutput, adu_histogram),
@@ -175,11 +175,11 @@ void host_writer(STREAM_512 &data_in,
packet_out.last = 0;
// 1024 transfers x 512-bit
for (int i = 0; i < RAW_MODULE_SIZE * sizeof(uint16_t) / (64 * 16) + 1; i++) {
// 256 transfers x 512-bit
for (int i = 0; i < SPOT_FINDER_MAX_STRONG_PIXEL / 16 + 1; i++) {
#pragma HLS PIPELINE II=1
spot_finder_in >> packet_out.data;
packet_out.last = (i == RAW_MODULE_SIZE * sizeof(uint16_t) / (64 * 16) + 1 - 1);
packet_out.last = (i == SPOT_FINDER_MAX_STRONG_PIXEL / 16);
if (send_images)
host_memory_out << packet_out;
}

View File

@@ -177,7 +177,11 @@ void jf_conversion(STREAM_512 &data_in, STREAM_576 &data_out,
ap_uint<32> offset_hbm_10 = 10 * hbm_size_bytes / 32;
ap_uint<32> offset_hbm_11 = 11 * hbm_size_bytes / 32;
one_over_energy_t one_over_energy = hls::recip(in_energy_kev.f);
one_over_energy_t one_over_energy;
if (hls::isfinite(in_energy_kev.f) && (in_energy_kev.f != 0.0))
one_over_energy = hls::recip(in_energy_kev.f);
else
one_over_energy = 0;
if (conversion) {
axis_completion cmpl;

View File

@@ -1,14 +1,5 @@
// Copyright (2019-2023) Paul Scherrer Institute
#ifndef JFJOCH_HLS_NOSYNTH
#include <hls_math.h>
#else
#include <cmath>
namespace hls {
inline bool isfinite(float f) {return std::isfinite(f);}
}
#endif
#include "hls_jfjoch.h"
#define o(field) offsetof(ModuleStatistics, field)
@@ -171,6 +162,12 @@ int load_calibration(ap_uint<256> *d_hbm_p0,
offset_hbm_1 = 21 * hbm_size_bytes / 32 + module_id * RAW_MODULE_SIZE * sizeof(int16_t) / 64;
read_module(d_hbm_p0, d_hbm_p1, host_memory_in, offset_hbm_0, offset_hbm_1);
break;
case LOAD_CALIBRATION_DEST_SPOT_FINDER_RESOLUTION_MAP:
setup_datamover(datamover_in_cmd, mem_addr, RAW_MODULE_SIZE * sizeof(float));
offset_hbm_0 = 22 * hbm_size_bytes / 32 + module_id * RAW_MODULE_SIZE * sizeof(int16_t) / 64;
offset_hbm_1 = 23 * hbm_size_bytes / 32 + module_id * RAW_MODULE_SIZE * sizeof(int16_t) / 64;
read_module_float<xray_d_t>(d_hbm_p0, d_hbm_p1, host_memory_in, offset_hbm_0, offset_hbm_1);
break;
default:
return LOAD_CALIBRATION_ERR_DEST;
}

View File

@@ -141,12 +141,12 @@ void pedestal(STREAM_512 &data_in, STREAM_512 &data_out,
|| ((conversion_mode & MODE_PEDESTAL_G1) != 0)
|| ((conversion_mode & MODE_PEDESTAL_G2) != 0);
ap_uint<32> offset_hbm_0 = 22 * hbm_size_bytes / 32;
ap_uint<32> offset_hbm_1 = 23 * hbm_size_bytes / 32;
ap_uint<32> offset_hbm_2 = 24 * hbm_size_bytes / 32;
ap_uint<32> offset_hbm_3 = 25 * hbm_size_bytes / 32;
ap_uint<32> offset_hbm_4 = 26 * hbm_size_bytes / 32;
ap_uint<32> offset_hbm_5 = 27 * hbm_size_bytes / 32;
ap_uint<32> offset_hbm_0 = 24 * hbm_size_bytes / 32;
ap_uint<32> offset_hbm_1 = 25 * hbm_size_bytes / 32;
ap_uint<32> offset_hbm_2 = 26 * hbm_size_bytes / 32;
ap_uint<32> offset_hbm_3 = 27 * hbm_size_bytes / 32;
ap_uint<32> offset_hbm_4 = 28 * hbm_size_bytes / 32;
ap_uint<32> offset_hbm_5 = 29 * hbm_size_bytes / 32;
if (pedestal_mode) {
clean_hbm:

View File

@@ -10,60 +10,33 @@
#include <thread>
#endif
ap_uint<32> count_pixels(ap_uint<32> &in) {
#pragma HLS INLINE
ap_uint<32> ret = 0;
for (int i = 0; i < 32; i++)
ret += in[i];
return ret;
}
struct spot_finder_packet {
ap_uint<768> data;
ap_uint<32> mask;
ap_uint<1> user;
ap_uint<1> last;
};
void spot_finder_in_stream(STREAM_768 &data_in,
hls::stream<ap_uint<32>> &mask_in,
hls::stream<spot_finder_packet> &data_out) {
ap_uint<32> mask;
packet_768_t packet_in;
{
#pragma HLS PROTOCOL fixed
data_in >> packet_in;
ap_wait();
data_out << spot_finder_packet{.data = packet_in.data, .user = packet_in.user, .last = packet_in.last};
data_out << spot_finder_packet{.data = packet_in.data, .mask = 0, .user = packet_in.user, .last = packet_in.last};
ap_wait();
}
data_in >> packet_in;
while (!packet_in.user) {
#pragma HLS PIPELINE II=1
data_out << spot_finder_packet{.data = packet_in.data, .user = packet_in.user, .last = packet_in.last};
mask_in >> mask;
data_out << spot_finder_packet{.data = packet_in.data, .mask = mask, .user = packet_in.user, .last = packet_in.last};
data_in >> packet_in;
}
data_out << spot_finder_packet{.data = packet_in.data, .user = packet_in.user, .last = packet_in.last};
}
ap_uint<32> calc_mask(ap_int<24> val[32], ap_uint<15> packet_number) {
#pragma HLS PIPELINE II=1
ap_uint<32> ret = 0;
ap_uint<9> line = packet_number / 32;
ap_uint<5> col = packet_number % 32;
if ((line == 255) || (line == 256))
return 0;
for (int i = 0; i < 32; i++) {
if (((col == 7) || (col == 15) || (col == 23)) && (i == 31))
ret[i] = 0;
else if (((col == 8) || (col == 16) || (col == 24)) && (i == 0))
ret[i] = 0;
else if ((val[i] == INT24_MAX) || (val[i] == INT24_MIN))
ret[i] = 0;
else
ret[i] = 1;
}
return ret;
data_out << spot_finder_packet{.data = packet_in.data, .mask = 0, .user = packet_in.user, .last = packet_in.last};
}
ap_int<SUM_BITWIDTH> calc_sum(ap_int<24> val[32], ap_uint<32> mask) {
@@ -124,7 +97,7 @@ void spot_finder_prepare(hls::stream<spot_finder_packet> &data_in,
data_out << packet;
ap_int<24> val[32];
unpack32(packet.data, val);
ap_uint<32> mask = calc_mask(val, i);
ap_uint<32> mask = packet.mask;
if ((i / 32) % 32 == 0) {
sum[i % 32] = calc_sum(val, mask);
@@ -169,8 +142,7 @@ ap_uint<32> spot_finder_snr_threshold(ap_int<24> val[32],
// but need to make sure that (pxl - mean) is positive
// Also assume that N ≈ (N-1)
if ((val[j] != INT24_MIN) &&
(in_minus_mean * in_minus_mean > threshold) &&
if ((in_minus_mean * in_minus_mean > threshold) &&
(in_minus_mean > 0) &&
(valid_count > 32 * 32 / 2)) // at least half of the pixels
ret[j] = 1;
@@ -243,25 +215,25 @@ void spot_finder_apply_threshold(hls::stream<spot_finder_packet> &data_in,
data_out << packet_768_t{.data = packet_in.data, .user = packet_in.user, .last = packet_in.last};
ap_int<24> data_unpacked[32];
unpack32(packet_in.data, data_unpacked);
ap_uint<32> strong_pixel = spot_finder_count_threshold(data_unpacked, count_threshold) &
spot_finder_snr_threshold(data_unpacked, snr_threshold_2,
sum[i % 32], sum2[i % 32], valid[i % 32]);
strong_pixel = strong_pixel & packet_in.mask;
if ((snr_threshold == 0) && (count_threshold <= 0))
strong_pixel = 0;
strong_pixel_out << ap_axiu<32,1,1,1>{.data = strong_pixel, .user = 0};
strong_pixel_count += count_pixels(strong_pixel);
data_in >> packet_in;
}
// Save module statistics
strong_pixel_out << ap_axiu<32,1,1,1>{.data = count_threshold, .user = 0};
strong_pixel_out << ap_axiu<32,1,1,1>{.data = snr_threshold_u32, .user = 0};
strong_pixel_out << ap_axiu<32,1,1,1>{.data = strong_pixel_count, .user = 0};
for (int i = 0; i < 13; i++)
strong_pixel_out << ap_axiu<32,1,1,1>{.data = 0, .user = 0};
strong_pixel_out << ap_axiu<32,1,1,1>{.data = count_threshold, .user = 0};
strong_pixel_out << ap_axiu<32,1,1,1>{.data = snr_threshold_u32, .user = 0};
for (int i = 0; i < 14;i++)
strong_pixel_out << ap_axiu<32,1,1,1>{.data = 0, .user = 0};
}
strong_pixel_out << ap_axiu<32,1,1,1>{.data = 0, .user = 1};
data_out << packet_768_t{.data = packet_in.data, .user = packet_in.user, .last = packet_in.last};
@@ -269,11 +241,13 @@ void spot_finder_apply_threshold(hls::stream<spot_finder_packet> &data_in,
void spot_finder(STREAM_768 &data_in,
hls::stream<ap_uint<32>> &mask_in,
STREAM_768 &data_out,
hls::stream<ap_axiu<32,1,1,1>> &strong_pixel_out,
volatile ap_int<32> &in_count_threshold,
volatile ap_uint<32> &in_snr_threshold) {
#pragma HLS INTERFACE axis port=data_in
#pragma HLS INTERFACE axis port=mask_in
#pragma HLS INTERFACE axis port=data_out
#pragma HLS INTERFACE axis port=strong_pixel_out
#pragma HLS INTERFACE ap_none register port=in_count_threshold
@@ -287,13 +261,13 @@ void spot_finder(STREAM_768 &data_in,
hls::stream<ap_int<SUM2_BITWIDTH>, 24> sum2_0;
hls::stream<ap_int<VALID_BITWIDTH>, 24> valid_0;
#ifndef JFJOCH_HLS_NOSYNTH
spot_finder_in_stream(data_in, data_0);
spot_finder_in_stream(data_in, mask_in, data_0);
spot_finder_prepare(data_0, data_1, sum_0, sum2_0, valid_0);
spot_finder_apply_threshold(data_1, data_out, sum_0, sum2_0, valid_0, strong_pixel_out,
in_count_threshold, in_snr_threshold);
#else
std::vector<std::thread> spot_finder_cores;
spot_finder_cores.emplace_back([&] {spot_finder_in_stream(data_in, data_0);});
spot_finder_cores.emplace_back([&] {spot_finder_in_stream(data_in, mask_in, data_0);});
spot_finder_cores.emplace_back([&] {spot_finder_prepare(data_0, data_1, sum_0, sum2_0, valid_0);});
spot_finder_cores.emplace_back([&] {spot_finder_apply_threshold(data_1, data_out, sum_0, sum2_0, valid_0,
strong_pixel_out, in_count_threshold,

View File

@@ -0,0 +1,84 @@
// Copyright (2019-2024) Paul Scherrer Institute
#include "hls_jfjoch.h"
void spot_finder_connectivity(hls::stream<ap_axiu<32,1,1,1>> &data_in,
hls::stream<ap_axiu<32,1,1,1>> &data_out,
hls::stream<ap_uint<256>> &connectivity_out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis register both port=data_in
#pragma HLS INTERFACE axis register both port=data_out
#pragma HLS INTERFACE axis register both port=connectivity_out
ap_uint<RAW_MODULE_COLS> top_line;
ap_uint<RAW_MODULE_COLS> mid_line;
ap_uint<RAW_MODULE_COLS> bottom_line;
ap_axiu<32,1,1,1> val;
data_in >> val;
while (!val.user) {
top_line = 0;
mid_line = 0;
bottom_line = 0;
for (int line = 0; line < RAW_MODULE_LINES; line++) {
#pragma HLS PIPELINE II=32
for (int col = 0; col < RAW_MODULE_COLS / 32; col++) {
bottom_line(col * 32 + 31, col * 32) = val.data;
data_out << val;
data_in >> val;
}
if (line != 0) {
for (int col = 0; col < RAW_MODULE_COLS / 32; col++) {
ap_uint<256> output = 0;
for (int i = 0; i < 32; i++) {
size_t pos = col * 32 + i;
ap_uint<8> connect_mat = 0;
if (pos != 0) {
connect_mat[0] = top_line[pos - 1];
connect_mat[1] = mid_line[pos - 1];
connect_mat[2] = bottom_line[pos - 1];
}
connect_mat[3] = top_line[pos];
connect_mat[4] = bottom_line[pos];
if (pos != RAW_MODULE_COLS - 1) {
connect_mat[5] = top_line[pos + 1];
connect_mat[6] = mid_line[pos + 1];
connect_mat[7] = bottom_line[pos + 1];
}
output(i*8+7, i*8) = connect_mat;
}
connectivity_out << output;
}
}
top_line = mid_line;
mid_line = bottom_line;
}
for (int i = 0; i < 16; i++) {
data_out << val;
data_in >> val;
}
for (int col = 0; col < RAW_MODULE_COLS / 32; col++) {
#pragma HLS PIPELINE II=1
ap_uint<256> output = 0;
for (int i = 0; i < 32; i++) {
size_t pos = col * 32 + i;
ap_uint<8> connect_mat = 0;
if (pos != 0) {
connect_mat[0] = top_line[pos - 1];
connect_mat[1] = mid_line[pos - 1];
}
connect_mat[3] = top_line[pos];
if (pos != RAW_MODULE_COLS - 1) {
connect_mat[5] = top_line[pos + 1];
connect_mat[6] = mid_line[pos + 1];
}
output(i*8+7, i*8) = connect_mat;
}
connectivity_out << output;
}
}
data_out << val;
}

View File

@@ -0,0 +1,89 @@
// Copyright (2019-2024) Paul Scherrer Institute
#include "hls_jfjoch.h"
void spot_finder_mask(STREAM_768 &data_in,
STREAM_768 &data_out,
hls::stream<ap_uint<32>> &mask_out,
hls::stream<axis_completion > &s_axis_completion,
hls::stream<axis_completion > &m_axis_completion,
ap_uint<256> *d_hbm_p0,
ap_uint<256> *d_hbm_p1,
volatile ap_uint<32> &in_min_d_value,
volatile ap_uint<32> &in_max_d_value,
ap_uint<32> hbm_size_bytes) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE register both axis port=data_in
#pragma HLS INTERFACE register both axis port=data_out
#pragma HLS INTERFACE register both axis port=mask_out
#pragma HLS INTERFACE register both axis port=m_axis_completion
#pragma HLS INTERFACE register both axis port=s_axis_completion
#pragma HLS INTERFACE register ap_none port=in_min_d_value
#pragma HLS INTERFACE register ap_none port=in_max_d_value
#pragma HLS INTERFACE register ap_none port=hbm_size_bytes
#pragma HLS INTERFACE m_axi port=d_hbm_p0 bundle=d_hbm_p0 depth=16384 offset=off \
max_read_burst_length=16 max_write_burst_length=2 latency=120 num_write_outstanding=2 num_read_outstanding=8
#pragma HLS INTERFACE m_axi port=d_hbm_p1 bundle=d_hbm_p1 depth=16384 offset=off \
max_read_burst_length=16 max_write_burst_length=2 latency=120 num_write_outstanding=2 num_read_outstanding=8
packet_768_t packet_in;
{
#pragma HLS PROTOCOL fixed
data_in >> packet_in;
ap_wait();
data_out << packet_in;
ap_wait();
}
ap_uint<32> offset_hbm_0 = 22 * hbm_size_bytes / 32;
ap_uint<32> offset_hbm_1 = 23 * hbm_size_bytes / 32;
ap_int<24> pixel_val[32];
xray_d_t d[32];
axis_completion cmpl;
s_axis_completion >> cmpl;
while (!cmpl.last) {
m_axis_completion << cmpl;
xray_d_t min_d_value = float_conv<xray_d_t>(in_min_d_value.read());
xray_d_t max_d_value = float_conv<xray_d_t>(in_max_d_value.read());
for (int i = 0; i < RAW_MODULE_SIZE / 32; i++) {
#pragma HLS PIPELINE II=1
data_in >> packet_in;
ap_uint<256> d_0 = d_hbm_p0[offset_hbm_0 + cmpl.module * RAW_MODULE_SIZE * sizeof(int16_t) / 64 + i];
ap_uint<256> d_1 = d_hbm_p1[offset_hbm_1 + cmpl.module * RAW_MODULE_SIZE * sizeof(int16_t) / 64 + i];
unpack_2xhbm_to_32x16bit(d_0, d_1, d);
unpack32(packet_in.data, pixel_val);
ap_uint<32> mask_val = 0;
ap_uint<9> line = i / 32;
ap_uint<5> col = i % 32;
for (int j = 0; j < 32; j++) {
if ((line == 255)
|| (line == 256)
|| (((col == 7) || (col == 15) || (col == 23)) && (j == 31))
|| (((col == 8) || (col == 16) || (col == 24)) && (j == 0))
|| (pixel_val[j] == INT24_MIN)
|| ((d[j] != 0) && (d[j] < min_d_value))
|| ((d[j] != 0) && (d[j] > max_d_value)))
mask_val[j] = 0;
else
mask_val[j] = 1;
}
data_out << packet_in;
mask_out << mask_val;
}
s_axis_completion >> cmpl;
}
m_axis_completion << cmpl;
data_in >> packet_in;
data_out << packet_in;
}

View File

@@ -0,0 +1,92 @@
// Copyright (2019-2024) Paul Scherrer Institute
#include "hls_jfjoch.h"
inline ap_uint<32> count_pixels(ap_uint<32> &in) {
#pragma HLS INLINE
ap_uint<32> ret = 0;
for (int i = 0; i < 32; i++)
ret += in[i];
return ret;
}
void spot_finder_merge(hls::stream<ap_axiu<32,1,1,1>> &data_in,
hls::stream<ap_uint<256>> &connectivity_in,
hls::stream<ap_uint<512>> &data_out,
volatile ap_uint<32> &in_min_pix_per_spot) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis register both port=data_in
#pragma HLS INTERFACE axis register both port=data_out
#pragma HLS INTERFACE axis register both port=connectivity_in
#pragma HLS INTERFACE ap_none register port=in_min_pix_per_spot
ap_uint<32> memory[SPOT_FINDER_MAX_STRONG_PIXEL / 32][32];
#pragma HLS ARRAY_PARTITION variable=memory type=complete dim=2
ap_uint<32> memory_index[32];
#pragma HLS ARRAY_PARTITION variable=memory_index type=complete dim=1
for (int i = 0 ; i < SPOT_FINDER_MAX_STRONG_PIXEL / 32; i++) {
#pragma HLS PIPELINE II=1
for (int j = 0; j < 32; j++)
memory[i][j] = UINT32_MAX;
}
for (int j = 0; j < 32; j++) {
#pragma HLS UNROLL
memory_index[j] = 0;
}
ap_axiu<32,1,1,1> val = data_in.read();
while (!val.user) {
ap_uint<32> min_pix_per_spot = in_min_pix_per_spot;
ap_uint<32> strong_pixel_count = 0;
for (int i = 0; i < 16384; i++) {
#pragma HLS PIPELINE II=1
ap_uint<256> conn = connectivity_in.read();
for (int j = 0; j < 32; j++) {
if ((min_pix_per_spot > 1) && (conn(j * 8 + 7, j*8) == 0))
val.data[j] = 0;
if (val.data[j]) {
ap_uint<8> tmp = memory_index[j] % (SPOT_FINDER_MAX_STRONG_PIXEL / 32);
memory[tmp][j] = (i * 32 + j) | (conn(j * 8 + 7, j*8) << 24);
memory_index[j] = tmp + 1;
}
}
strong_pixel_count += count_pixels(val.data);
val = data_in.read();
}
ap_uint<32> max_memory_index = 0;
for (int i = 0; i < 32; i++) {
#pragma HLS UNROLL
if (max_memory_index < memory_index[i])
max_memory_index = memory_index[i];
memory_index[i] = 0;
}
for (int i = 0; i < SPOT_FINDER_MAX_STRONG_PIXEL / 32; i++) {
#pragma HLS PIPELINE II=2
ap_uint<512> out_val = 0;
for (int j = 0; j < 16; j++) {
out_val(j * 32 + 31, j * 32) = memory[i][j];
memory[i][j] = UINT32_MAX;
}
data_out << out_val;
for (int j = 0; j < 16; j++) {
out_val(j * 32 + 31, j * 32) = memory[i][j + 16];
memory[i][j + 16] = UINT32_MAX;
}
data_out << out_val;
}
{
ap_uint<512> out_val = 0;
for (int i = 0; i < 16; i++) {
out_val(i*32+31, i * 32) = val.data;
val = data_in.read();
}
out_val(95, 64) = strong_pixel_count;
out_val(127, 96) = max_memory_index;
data_out << out_val;
}
}
}

View File

@@ -2,7 +2,6 @@
#include <thread>
int main() {
size_t nframes = 4;
int ret = 0;
@@ -10,6 +9,7 @@ int main() {
STREAM_768 input;
STREAM_768 output;
hls::stream<ap_axiu<32, 1, 1, 1>> strong_pixel;
hls::stream<ap_uint<32>> mask_stream;
ap_int<32> in_photon_count_threshold = 8;
float_uint32 in_strong_pixel_threshold;
@@ -31,11 +31,12 @@ int main() {
tmp[j] = input_frame[i * 32 + j];
input << packet_768_t{.data = pack32(tmp), .user = 0};
mask_stream << UINT32_MAX;
}
input << packet_768_t{.user = 1};
spot_finder(input, output, strong_pixel, in_photon_count_threshold,local_strong_pixel_threshold);
spot_finder(input, mask_stream, output, strong_pixel, in_photon_count_threshold,local_strong_pixel_threshold);
if (input.size() != 0)
ret = 1;
@@ -44,9 +45,9 @@ int main() {
for (int i = 0; i < nframes * RAW_MODULE_SIZE * sizeof(uint16_t) / 64 + 2; i++)
output.read();
if (strong_pixel.size() != nframes * (RAW_MODULE_SIZE * sizeof(uint16_t) / 64 + 16) + 1)
if (strong_pixel.size() != nframes * (RAW_MODULE_SIZE * sizeof(uint16_t) / 64 + 2) + 1)
ret = 1;
for (int i = 0; i < nframes * (RAW_MODULE_SIZE * sizeof(uint16_t) / 64 + 16) + 1; i++)
for (int i = 0; i < nframes * (RAW_MODULE_SIZE * sizeof(uint16_t) / 64 + 2) + 1; i++)
strong_pixel.read();
if (ret != 0) {

View File

@@ -161,12 +161,6 @@ void JungfraujochDevice::RunFrameGenerator(const FrameGeneratorConfig &config) {
throw PCIeDeviceException("Failed starting frame generator");
}
void JungfraujochDevice::WriteRegister(uint32_t addr, uint32_t val) {
RegisterConfig config{.addr = addr, .val = val};
if (ioctl(fd, IOCTL_JFJOCH_WRITE_REGISTER, &config) != 0)
throw PCIeDeviceException("Failed writing to register");
}
uint32_t JungfraujochDevice::ReadRegister(uint32_t addr) const {
RegisterConfig config;
config.addr = addr;

View File

@@ -81,11 +81,8 @@ public:
// Doesn't wait for the result
void RunFrameGenerator(const FrameGeneratorConfig &config);
// Write to any FPGA register
// UNSAFE! only if you know what you are doing
// Read any FPGA register
// Can only be done by root user
void WriteRegister(uint32_t addr, uint32_t val);
// Read to any FPGA register
uint32_t ReadRegister(uint32_t addr) const;
// Load calibration parameters

View File

@@ -26,7 +26,7 @@ typedef __u64 uint64_t;
#define GAIN_G2_MULTIPLIER (-1)
#define ACTION_TYPE 0x52324158
#define RELEASE_LEVEL 0x004E
#define RELEASE_LEVEL 0x004F
#define MODE_CONV 0x0001L
#define MODE_32BIT 0x0002L
@@ -66,6 +66,8 @@ typedef __u64 uint64_t;
#define DMA_DESCRIPTORS_PER_MODULE 5
#define SPOT_FINDER_MAX_STRONG_PIXEL (16384)
// INT32_MAX is written explicitly, as the constant is not present in kernel
#define MAX_FRAMES (2147483647/(MAX_MODULES_FPGA*DMA_DESCRIPTORS_PER_MODULE))
@@ -81,6 +83,7 @@ typedef __u64 uint64_t;
#define LOAD_CALIBRATION_DEST_INTEGRATION_MAP 6
#define LOAD_CALIBRATION_DEST_INTEGRATION_WEIGHTS 7
#define LOAD_CALIBRATION_DEST_FRAME_GEN 8
#define LOAD_CALIBRATION_DEST_SPOT_FINDER_RESOLUTION_MAP 9
struct LoadCalibrationConfig {
uint32_t handle;
@@ -181,6 +184,9 @@ struct RegisterConfig {
struct SpotFinderParameters {
int32_t count_threshold;
float snr_threshold;
float min_d;
float max_d;
uint32_t min_pix_per_spot;
};
#pragma pack(pop)
@@ -193,11 +199,12 @@ struct IntegrationResult {
};
struct SpotFindingResult {
char strong_pixel[RAW_MODULE_SIZE / 8];
uint32_t strong_pixel_number[SPOT_FINDER_MAX_STRONG_PIXEL];
int32_t count_threshold;
float snr_threshold;
int32_t strong_pixel_count;
int32_t reserved[13];
uint32_t max_memory_index;
int32_t reserved[12];
};
struct ModuleStatistics {

View File

@@ -18,6 +18,19 @@ After installing the kernel driver, it should be possible to insert it into the
modprobe jfjoch
```
## Ownership of the character devices
By default, character devices `/dev/jfjoch<device number>` are owned by root (user/group) and are not accessible by others.
This means that `jfjoch_broker` must be running as superuser, which might not be optimal for security reasons in most cases.
The behavior can be changed by creating `udev` rules. Create a file called `/etc/udev/rules.d/99-jfjoch.rules`
with the following content:
```
KERNEL=="jfjoch*" OWNER="<UNIX username>" GROUP="<UNIX group>"
```
It is OK to provide only group, for example to make the devices accessible by group `jungfrau`:
```
KERNEL=="jfjoch*" GROUP="jungfrau"
```
## DKMS
To avoid problems with updating the kernel, it is possible to use DKMS to autobuild Jungfraujoch kernel
module, when new kernel is installed. This first requires to install DKMS - for RHEL it is available via EPEL repository:

View File

@@ -5,10 +5,6 @@
#include <linux/types.h>
#include <linux/delay.h>
void jfjoch_write_register(struct jfjoch_drvdata *drvdata, uint32_t addr, uint32_t val) {
iowrite32(val, drvdata->bar0 + addr);
}
uint32_t jfjoch_read_register(struct jfjoch_drvdata *drvdata, uint32_t addr) {
return ioread32(drvdata->bar0 + addr);
}

View File

@@ -158,14 +158,6 @@ long jfjoch_cdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) {
if (copy_to_user((char *) arg, exchange, sizeof(u32)) != 0)
return -EFAULT;
return 0;
case IOCTL_JFJOCH_WRITE_REGISTER:
// This is the most powerful option from security point of view and can only be performed by root
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
if (copy_from_user(&reg_config, (char *) arg, sizeof(struct RegisterConfig)) != 0)
return -EFAULT;
jfjoch_write_register(drvdata, reg_config.addr, reg_config.val);
return 0;
case IOCTL_JFJOCH_READ_REGISTER:
// This is the most powerful option from security point of view and can only be performed by root
if (!capable(CAP_SYS_ADMIN))

View File

@@ -35,7 +35,7 @@
// 19-21 are reserved
#define IOCTL_JFJOCH_RUN_FRAME_GEN _IOW(IOCTL_JFJOCH_MAGIC, 23, struct FrameGeneratorConfig)
#define IOCTL_JFJOCH_C2H_DMA_DESC _IOR(IOCTL_JFJOCH_MAGIC, 24, uint32_t)
#define IOCTL_JFJOCH_WRITE_REGISTER _IOW(IOCTL_JFJOCH_MAGIC, 25, struct RegisterConfig )
// 25 is reserved
#define IOCTL_JFJOCH_READ_REGISTER _IOWR(IOCTL_JFJOCH_MAGIC, 26, struct RegisterConfig )
#define IOCTL_JFJOCH_SET_SPOTFIN_PAR _IOW(IOCTL_JFJOCH_MAGIC, 27, struct SpotFinderParameters)
#define IOCTL_JFJOCH_SET_DATA_SOURCE _IOW(IOCTL_JFJOCH_MAGIC, 28, uint32_t)

View File

@@ -138,25 +138,27 @@ xilinx.com:ip:cms_subsystem:4.0\
xilinx.com:ip:xlconstant:1.1\
xilinx.com:ip:proc_sys_reset:5.0\
xilinx.com:ip:smartconnect:1.0\
psi.ch:hls:stream_merge:1.0\
xilinx.com:ip:xlconcat:2.1\
xilinx.com:ip:axi_protocol_converter:2.1\
xilinx.com:ip:axi_register_slice:2.1\
xilinx.com:ip:hbm:1.0\
xilinx.com:ip:util_vector_logic:2.0\
xilinx.com:ip:axi_bram_ctrl:4.1\
xilinx.com:ip:axis_data_fifo:2.0\
xilinx.com:ip:axis_register_slice:1.1\
psi.ch:hls:data_collection_fsm:1.0\
xilinx.com:ip:blk_mem_gen:8.4\
psi.ch:hls:frame_generator:1.0\
psi.ch:hls:host_writer:1.0\
psi.ch:hls:load_calibration:1.0\
xilinx.com:ip:mailbox:2.1\
psi.ch:hls:stream_merge:1.0\
psi.ch:hls:timer_host:1.0\
xilinx.com:ip:cmac_usplus:3.1\
xilinx.com:ip:axis_clock_converter:1.1\
xilinx.com:ip:axis_dwidth_converter:1.1\
xilinx.com:ip:xxv_ethernet:4.1\
xilinx.com:ip:axi_firewall:1.2\
xilinx.com:ip:axis_clock_converter:1.1\
xilinx.com:ip:util_ds_buf:2.2\
xilinx.com:ip:xdma:4.1\
xilinx.com:ip:axi_datamover:5.1\
@@ -165,12 +167,14 @@ psi.ch:hls:load_from_hbm:1.0\
psi.ch:hls:save_to_hbm:1.0\
psi.ch:hls:adu_histo:1.0\
psi.ch:hls:axis_64_to_512:1.0\
psi.ch:hls:axis_32_to_512:1.0\
psi.ch:hls:frame_summation:1.0\
psi.ch:hls:integration:1.0\
psi.ch:hls:jf_conversion:1.0\
psi.ch:hls:mask_missing:1.0\
psi.ch:hls:pedestal:1.0\
psi.ch:hls:spot_finder:1.0\
psi.ch:hls:spot_finder_connectivity:1.0\
psi.ch:hls:spot_finder_merge:1.0\
psi.ch:hls:stream_24bit_conv:1.0\
psi.ch:hls:arp:1.0\
xilinx.com:ip:axis_switch:1.1\
@@ -440,6 +444,8 @@ proc create_root_design { parentCell } {
connect_bd_intf_net -intf_net jungfraujoch_m_axi_d_hbm_p25 [get_bd_intf_pins hbm_infrastructure/s_axi_hbm_25] [get_bd_intf_pins jungfraujoch/m_axi_d_hbm_p25]
connect_bd_intf_net -intf_net jungfraujoch_m_axi_d_hbm_p26 [get_bd_intf_pins hbm_infrastructure/s_axi_hbm_26] [get_bd_intf_pins jungfraujoch/m_axi_d_hbm_p26]
connect_bd_intf_net -intf_net jungfraujoch_m_axi_d_hbm_p27 [get_bd_intf_pins hbm_infrastructure/s_axi_hbm_27] [get_bd_intf_pins jungfraujoch/m_axi_d_hbm_p27]
connect_bd_intf_net -intf_net jungfraujoch_m_axi_d_hbm_p28 [get_bd_intf_pins hbm_infrastructure/s_axi_hbm_28] [get_bd_intf_pins jungfraujoch/m_axi_d_hbm_p28]
connect_bd_intf_net -intf_net jungfraujoch_m_axi_d_hbm_p29 [get_bd_intf_pins hbm_infrastructure/s_axi_hbm_29] [get_bd_intf_pins jungfraujoch/m_axi_d_hbm_p29]
connect_bd_intf_net -intf_net jungfraujoch_m_axis_c2h_data [get_bd_intf_pins jungfraujoch/m_axis_c2h_data] [get_bd_intf_pins pcie_dma_0/s_axis_c2h_data]
connect_bd_intf_net -intf_net jungfraujoch_m_axis_c2h_datamover_cmd [get_bd_intf_pins jungfraujoch/m_axis_c2h_datamover_cmd] [get_bd_intf_pins pcie_dma_0/s_axis_c2h_cmd]
connect_bd_intf_net -intf_net jungfraujoch_m_axis_h2c_datamover_cmd [get_bd_intf_pins jungfraujoch/m_axis_h2c_datamover_cmd] [get_bd_intf_pins pcie_dma_0/s_axis_h2c_cmd]

View File

@@ -217,7 +217,6 @@ proc create_hier_cell_hbm_infrastructure { parentCell nameHier } {
CONFIG.USER_MC9_LOOKAHEAD_SBRF {true} \
CONFIG.USER_MC9_REF_TEMP_COMP {false} \
CONFIG.USER_MC9_TRAFFIC_OPTION {Linear} \
CONFIG.USER_MC_ENABLE_14 {FALSE} \
CONFIG.USER_MC_ENABLE_15 {FALSE} \
CONFIG.USER_MC_ENABLE_APB_01 {FALSE} \
CONFIG.USER_MEMORY_DISPLAY {16384} \
@@ -229,8 +228,6 @@ proc create_hier_cell_hbm_infrastructure { parentCell nameHier } {
CONFIG.USER_PHY_ENABLE_13 {TRUE} \
CONFIG.USER_PHY_ENABLE_14 {TRUE} \
CONFIG.USER_PHY_ENABLE_15 {TRUE} \
CONFIG.USER_SAXI_28 {false} \
CONFIG.USER_SAXI_29 {false} \
CONFIG.USER_SAXI_30 {false} \
CONFIG.USER_SAXI_31 {false} \
CONFIG.USER_SWITCH_ENABLE_00 {TRUE} \
@@ -269,7 +266,7 @@ proc create_hier_cell_hbm_infrastructure { parentCell nameHier } {
connect_bd_net [get_bd_pins axi_resetn] [get_bd_pins hbm/APB_0_PRESET_N] [get_bd_pins hbm/APB_1_PRESET_N]
connect_bd_net [get_bd_pins refclk100] [get_bd_pins hbm/APB_0_PCLK] [get_bd_pins hbm/APB_1_PCLK] [get_bd_pins hbm/HBM_REF_CLK_0] [get_bd_pins hbm/HBM_REF_CLK_1]
for {set i 0} {$i < 28} {incr i} {
for {set i 0} {$i < 30} {incr i} {
create_bd_intf_pin -mode Slave -vlnv xilinx.com:interface:aximm_rtl:1.0 s_axi_hbm_$i
set cell [create_bd_cell -type ip -vlnv {xilinx.com:ip:axi_register_slice:*} axi_register_slice_$i ]

View File

@@ -85,6 +85,10 @@ proc create_hier_cell_image_processing { parentCell nameHier } {
create_bd_intf_pin -mode Master -vlnv xilinx.com:interface:aximm_rtl:1.0 m_axi_d_hbm_p27
create_bd_intf_pin -mode Master -vlnv xilinx.com:interface:aximm_rtl:1.0 m_axi_d_hbm_p28
create_bd_intf_pin -mode Master -vlnv xilinx.com:interface:aximm_rtl:1.0 m_axi_d_hbm_p29
create_bd_intf_pin -mode Master -vlnv xilinx.com:interface:axis_rtl:1.0 m_axis_completion
create_bd_intf_pin -mode Master -vlnv xilinx.com:interface:axis_rtl:1.0 result_out
@@ -98,21 +102,21 @@ proc create_hier_cell_image_processing { parentCell nameHier } {
create_bd_pin -dir I -type rst ap_rst_n
create_bd_pin -dir I -type clk axi_clk
create_bd_pin -dir I -type rst axi_rst_n
create_bd_pin -dir O frame_summation_idle
create_bd_pin -dir O integration_idle
create_bd_pin -dir O stream_conv_idle
create_bd_pin -dir O -from 0 -to 0 frame_summation_idle
create_bd_pin -dir I -from 31 -to 0 -type data hbm_size_bytes
create_bd_pin -dir I -from 31 -to 0 -type data in_count_threshold
create_bd_pin -dir I -from 31 -to 0 -type data in_max_d_value
create_bd_pin -dir I -from 31 -to 0 -type data in_min_pix_per_spot
create_bd_pin -dir I -from 31 -to 0 -type data in_min_d_value
create_bd_pin -dir I -from 31 -to 0 -type data in_snr_threshold
create_bd_pin -dir O -from 0 -to 0 integration_idle
create_bd_pin -dir O proc_fifo_empty
create_bd_pin -dir O proc_fifo_full
create_bd_pin -dir O -from 0 -to 0 stream_conv_idle
# Create instance: adu_histo_0, and set properties
set adu_histo_0 [ create_bd_cell -type ip -vlnv psi.ch:hls:adu_histo:1.0 adu_histo_0 ]
# Create instance: axis_32_to_512_0, and set properties
set axis_32_to_512_0 [ create_bd_cell -type ip -vlnv psi.ch:hls:axis_32_to_512:1.0 axis_32_to_512_0 ]
# Create instance: axis_64_to_512_0, and set properties
set axis_64_to_512_0 [ create_bd_cell -type ip -vlnv psi.ch:hls:axis_64_to_512:1.0 axis_64_to_512_0 ]
@@ -150,6 +154,12 @@ proc create_hier_cell_image_processing { parentCell nameHier } {
CONFIG.FIFO_DEPTH {16} \
] $axis_compl_fifo_4
# Create instance: axis_compl_fifo_5, and set properties
set axis_compl_fifo_5 [ create_bd_cell -type ip -vlnv xilinx.com:ip:axis_data_fifo:2.0 axis_compl_fifo_5 ]
set_property -dict [ list \
CONFIG.FIFO_DEPTH {16} \
] $axis_compl_fifo_5
# Create instance: axis_data_fifo_0, and set properties
set axis_data_fifo_0 [ create_bd_cell -type ip -vlnv xilinx.com:ip:axis_data_fifo:2.0 axis_data_fifo_0 ]
set_property -dict [ list \
@@ -200,6 +210,18 @@ proc create_hier_cell_image_processing { parentCell nameHier } {
CONFIG.FIFO_DEPTH {256} \
] $axis_data_fifo_7
# Create instance: axis_data_fifo_8, and set properties
set axis_data_fifo_8 [ create_bd_cell -type ip -vlnv xilinx.com:ip:axis_data_fifo:2.0 axis_data_fifo_8 ]
set_property -dict [ list \
CONFIG.FIFO_DEPTH {512} \
] $axis_data_fifo_8
# Create instance: axis_data_spot_finder_mask_0, and set properties
set axis_data_spot_finder_mask_0 [ create_bd_cell -type ip -vlnv xilinx.com:ip:axis_data_fifo:2.0 axis_data_spot_finder_mask_0 ]
set_property -dict [ list \
CONFIG.FIFO_DEPTH {512} \
] $axis_data_spot_finder_mask_0
# Create instance: axis_integration_result_fifo_0, and set properties
set axis_integration_result_fifo_0 [ create_bd_cell -type ip -vlnv xilinx.com:ip:axis_data_fifo:2.0 axis_integration_result_fifo_0 ]
set_property -dict [ list \
@@ -230,6 +252,12 @@ proc create_hier_cell_image_processing { parentCell nameHier } {
CONFIG.REG_CONFIG {16} \
] $axis_register_slice_data_3
# Create instance: axis_spot_finder_conn_fifo_0, and set properties
set axis_spot_finder_conn_fifo_0 [ create_bd_cell -type ip -vlnv xilinx.com:ip:axis_data_fifo:2.0 axis_spot_finder_conn_fifo_0 ]
set_property -dict [ list \
CONFIG.FIFO_DEPTH {2048} \
] $axis_spot_finder_conn_fifo_0
# Create instance: axis_spot_finder_fifo_0, and set properties
set axis_spot_finder_fifo_0 [ create_bd_cell -type ip -vlnv xilinx.com:ip:axis_data_fifo:2.0 axis_spot_finder_fifo_0 ]
set_property -dict [ list \
@@ -240,9 +268,15 @@ proc create_hier_cell_image_processing { parentCell nameHier } {
set axis_spot_finder_fifo_1 [ create_bd_cell -type ip -vlnv xilinx.com:ip:axis_data_fifo:2.0 axis_spot_finder_fifo_1 ]
set_property -dict [ list \
CONFIG.FIFO_DEPTH {2048} \
CONFIG.FIFO_MEMORY_TYPE {ultra} \
] $axis_spot_finder_fifo_1
# Create instance: axis_spot_finder_fifo_2, and set properties
set axis_spot_finder_fifo_2 [ create_bd_cell -type ip -vlnv xilinx.com:ip:axis_data_fifo:2.0 axis_spot_finder_fifo_2 ]
set_property -dict [ list \
CONFIG.FIFO_DEPTH {2048} \
CONFIG.FIFO_MEMORY_TYPE {ultra} \
] $axis_spot_finder_fifo_2
# Create instance: frame_summation_0, and set properties
set frame_summation_0 [ create_bd_cell -type ip -vlnv psi.ch:hls:frame_summation:1.0 frame_summation_0 ]
@@ -282,11 +316,20 @@ proc create_hier_cell_image_processing { parentCell nameHier } {
# Create instance: spot_finder_0, and set properties
set spot_finder_0 [ create_bd_cell -type ip -vlnv psi.ch:hls:spot_finder:1.0 spot_finder_0 ]
# Create instance: spot_finder_connecti_0, and set properties
set spot_finder_connecti_0 [ create_bd_cell -type ip -vlnv psi.ch:hls:spot_finder_connectivity:1.0 spot_finder_connecti_0 ]
# Create instance: spot_finder_mask_0, and set properties
set spot_finder_mask_0 [ create_bd_cell -type ip -vlnv psi.ch:hls:spot_finder_mask:1.0 spot_finder_mask_0 ]
# Create instance: spot_finder_merge_0, and set properties
set spot_finder_merge_0 [ create_bd_cell -type ip -vlnv psi.ch:hls:spot_finder_merge:1.0 spot_finder_merge_0 ]
# Create instance: stream_24bit_conv_0, and set properties
set stream_24bit_conv_0 [ create_bd_cell -type ip -vlnv psi.ch:hls:stream_24bit_conv:1.0 stream_24bit_conv_0 ]
# Create interface connections
connect_bd_intf_net -intf_net Conn1 [get_bd_intf_pins spot_finder_out] [get_bd_intf_pins axis_spot_finder_fifo_1/M_AXIS]
connect_bd_intf_net -intf_net Conn1 [get_bd_intf_pins spot_finder_out] [get_bd_intf_pins axis_spot_finder_fifo_2/M_AXIS]
connect_bd_intf_net -intf_net Conn2 [get_bd_intf_pins m_axi_d_hbm_p0] [get_bd_intf_pins jf_conversion_0/m_axi_d_hbm_p0]
connect_bd_intf_net -intf_net Conn3 [get_bd_intf_pins integration_result_out] [get_bd_intf_pins axis_integration_result_fifo_1/M_AXIS]
connect_bd_intf_net -intf_net Conn5 [get_bd_intf_pins m_axi_d_hbm_p16] [get_bd_intf_pins integration_0/m_axi_d_hbm_p0]
@@ -307,31 +350,35 @@ proc create_hier_cell_image_processing { parentCell nameHier } {
connect_bd_intf_net -intf_net Conn31 [get_bd_intf_pins m_axi_d_hbm_p1] [get_bd_intf_pins jf_conversion_0/m_axi_d_hbm_p1]
connect_bd_intf_net -intf_net adu_histo_0_data_out [get_bd_intf_pins adu_histo_0/data_out] [get_bd_intf_pins axis_data_fifo_2/S_AXIS]
connect_bd_intf_net -intf_net adu_histo_0_m_axis_completion [get_bd_intf_pins adu_histo_0/m_axis_completion] [get_bd_intf_pins axis_compl_fifo_1/S_AXIS]
connect_bd_intf_net -intf_net axis_32_to_512_0_data_out [get_bd_intf_pins axis_32_to_512_0/data_out] [get_bd_intf_pins axis_spot_finder_fifo_1/S_AXIS]
connect_bd_intf_net -intf_net axis_64_to_512_0_data_out [get_bd_intf_pins axis_64_to_512_0/data_out] [get_bd_intf_pins axis_integration_result_fifo_1/S_AXIS]
connect_bd_intf_net -intf_net axis_compl_fifo_0_M_AXIS [get_bd_intf_pins adu_histo_0/s_axis_completion] [get_bd_intf_pins axis_compl_fifo_0/M_AXIS]
connect_bd_intf_net -intf_net axis_compl_fifo_1_M_AXIS [get_bd_intf_pins axis_compl_fifo_2/M_AXIS] [get_bd_intf_pins jf_conversion_0/s_axis_completion]
connect_bd_intf_net -intf_net axis_compl_fifo_2_M_AXIS [get_bd_intf_pins axis_compl_fifo_1/M_AXIS] [get_bd_intf_pins mask_missing_0/s_axis_completion]
connect_bd_intf_net -intf_net axis_compl_fifo_4_M_AXIS [get_bd_intf_pins axis_compl_fifo_3/M_AXIS] [get_bd_intf_pins frame_summation_0/s_axis_completion]
connect_bd_intf_net -intf_net axis_compl_fifo_5_M_AXIS [get_bd_intf_pins axis_compl_fifo_4/M_AXIS] [get_bd_intf_pins integration_0/s_axis_completion]
connect_bd_intf_net -intf_net axis_compl_fifo_5_M_AXIS1 [get_bd_intf_pins axis_compl_fifo_5/M_AXIS] [get_bd_intf_pins spot_finder_mask_0/s_axis_completion]
connect_bd_intf_net -intf_net axis_data_fifo_0_M_AXIS [get_bd_intf_pins axis_data_fifo_0/M_AXIS] [get_bd_intf_pins pedestal_0/data_in]
connect_bd_intf_net -intf_net axis_data_fifo_3_M_AXIS [get_bd_intf_pins adu_histo_0/data_in] [get_bd_intf_pins axis_data_fifo_1/M_AXIS]
connect_bd_intf_net -intf_net axis_data_fifo_3_M_AXIS1 [get_bd_intf_pins axis_data_fifo_3/M_AXIS] [get_bd_intf_pins jf_conversion_0/data_in]
connect_bd_intf_net -intf_net axis_data_fifo_4_M_AXIS [get_bd_intf_pins axis_data_fifo_2/M_AXIS] [get_bd_intf_pins mask_missing_0/data_in]
connect_bd_intf_net -intf_net axis_data_fifo_5_M_AXIS1 [get_bd_intf_pins axis_data_fifo_6/M_AXIS] [get_bd_intf_pins spot_finder_0/data_in]
connect_bd_intf_net -intf_net axis_data_fifo_6_M_AXIS [get_bd_intf_pins axis_data_fifo_4/M_AXIS] [get_bd_intf_pins axis_register_slice_data_1/S_AXIS]
connect_bd_intf_net -intf_net axis_data_fifo_6_M_AXIS1 [get_bd_intf_pins axis_data_fifo_7/M_AXIS] [get_bd_intf_pins stream_24bit_conv_0/data_in]
connect_bd_intf_net -intf_net axis_data_fifo_6_M_AXIS1 [get_bd_intf_pins axis_data_fifo_8/M_AXIS] [get_bd_intf_pins stream_24bit_conv_0/data_in]
connect_bd_intf_net -intf_net axis_data_fifo_6_M_AXIS2 [get_bd_intf_pins axis_data_fifo_6/M_AXIS] [get_bd_intf_pins spot_finder_mask_0/data_in]
connect_bd_intf_net -intf_net axis_data_fifo_7_M_AXIS [get_bd_intf_pins axis_data_fifo_5/M_AXIS] [get_bd_intf_pins integration_0/data_in]
connect_bd_intf_net -intf_net axis_data_fifo_7_M_AXIS1 [get_bd_intf_pins axis_data_fifo_7/M_AXIS] [get_bd_intf_pins spot_finder_0/data_in]
connect_bd_intf_net -intf_net axis_data_spot_finder_mask_0_M_AXIS [get_bd_intf_pins axis_data_spot_finder_mask_0/M_AXIS] [get_bd_intf_pins spot_finder_0/mask_in]
connect_bd_intf_net -intf_net axis_integration_result_fifo_0_M_AXIS [get_bd_intf_pins axis_64_to_512_0/data_in] [get_bd_intf_pins axis_integration_result_fifo_0/M_AXIS]
connect_bd_intf_net -intf_net axis_register_slice_data_1_M_AXIS [get_bd_intf_pins axis_register_slice_data_1/M_AXIS] [get_bd_intf_pins frame_summation_0/data_in]
connect_bd_intf_net -intf_net axis_register_slice_data_2_M_AXIS [get_bd_intf_pins axis_data_fifo_5/S_AXIS] [get_bd_intf_pins axis_register_slice_data_2/M_AXIS]
connect_bd_intf_net -intf_net axis_register_slice_data_3_M_AXIS [get_bd_intf_pins data_out] [get_bd_intf_pins axis_register_slice_data_3/M_AXIS]
connect_bd_intf_net -intf_net axis_spot_finder_fifo_0_M_AXIS [get_bd_intf_pins axis_32_to_512_0/data_in] [get_bd_intf_pins axis_spot_finder_fifo_0/M_AXIS]
connect_bd_intf_net -intf_net axis_spot_finder_conn_fifo_0_M_AXIS [get_bd_intf_pins axis_spot_finder_conn_fifo_0/M_AXIS] [get_bd_intf_pins spot_finder_merge_0/connectivity_in]
connect_bd_intf_net -intf_net axis_spot_finder_fifo_0_M_AXIS [get_bd_intf_pins axis_spot_finder_fifo_0/M_AXIS] [get_bd_intf_pins spot_finder_connecti_0/data_in]
connect_bd_intf_net -intf_net axis_spot_finder_fifo_1_M_AXIS [get_bd_intf_pins axis_spot_finder_fifo_1/M_AXIS] [get_bd_intf_pins spot_finder_merge_0/data_in]
connect_bd_intf_net -intf_net data_in_1 [get_bd_intf_pins data_in] [get_bd_intf_pins axis_data_fifo_0/S_AXIS]
connect_bd_intf_net -intf_net frame_summation_0_data_out [get_bd_intf_pins axis_register_slice_data_2/S_AXIS] [get_bd_intf_pins frame_summation_0/data_out]
connect_bd_intf_net -intf_net frame_summation_0_m_axis_completion [get_bd_intf_pins axis_compl_fifo_4/S_AXIS] [get_bd_intf_pins frame_summation_0/m_axis_completion]
connect_bd_intf_net -intf_net integration_0_data_out [get_bd_intf_pins axis_data_fifo_6/S_AXIS] [get_bd_intf_pins integration_0/data_out]
connect_bd_intf_net -intf_net integration_0_m_axis_completion [get_bd_intf_pins m_axis_completion] [get_bd_intf_pins integration_0/m_axis_completion]
connect_bd_intf_net -intf_net integration_0_m_axis_completion [get_bd_intf_pins axis_compl_fifo_5/S_AXIS] [get_bd_intf_pins integration_0/m_axis_completion]
connect_bd_intf_net -intf_net integration_0_result_out [get_bd_intf_pins axis_integration_result_fifo_0/S_AXIS] [get_bd_intf_pins integration_0/result_out]
connect_bd_intf_net -intf_net jf_conversion_0_data_out [get_bd_intf_pins axis_data_fifo_4/S_AXIS] [get_bd_intf_pins jf_conversion_0/data_out]
connect_bd_intf_net -intf_net jf_conversion_0_m_axis_completion [get_bd_intf_pins axis_compl_fifo_3/S_AXIS] [get_bd_intf_pins jf_conversion_0/m_axis_completion]
@@ -352,29 +399,40 @@ proc create_hier_cell_image_processing { parentCell nameHier } {
connect_bd_intf_net -intf_net pedestal_0_m_axi_d_hbm_p5_w [get_bd_intf_pins pedestal_0/m_axi_d_hbm_p5_w] [get_bd_intf_pins smartconnect_5/S01_AXI]
connect_bd_intf_net -intf_net pedestal_0_m_axis_completion [get_bd_intf_pins axis_compl_fifo_0/S_AXIS] [get_bd_intf_pins pedestal_0/m_axis_completion]
connect_bd_intf_net -intf_net s_axis_completion_1 [get_bd_intf_pins s_axis_completion] [get_bd_intf_pins pedestal_0/s_axis_completion]
connect_bd_intf_net -intf_net smartconnect_0_M00_AXI [get_bd_intf_pins m_axi_d_hbm_p22] [get_bd_intf_pins smartconnect_0/M00_AXI]
connect_bd_intf_net -intf_net smartconnect_1_M00_AXI [get_bd_intf_pins m_axi_d_hbm_p23] [get_bd_intf_pins smartconnect_1/M00_AXI]
connect_bd_intf_net -intf_net smartconnect_2_M00_AXI [get_bd_intf_pins m_axi_d_hbm_p24] [get_bd_intf_pins smartconnect_2/M00_AXI]
connect_bd_intf_net -intf_net smartconnect_3_M00_AXI [get_bd_intf_pins m_axi_d_hbm_p25] [get_bd_intf_pins smartconnect_3/M00_AXI]
connect_bd_intf_net -intf_net smartconnect_4_M00_AXI [get_bd_intf_pins m_axi_d_hbm_p26] [get_bd_intf_pins smartconnect_4/M00_AXI]
connect_bd_intf_net -intf_net smartconnect_5_M00_AXI [get_bd_intf_pins m_axi_d_hbm_p27] [get_bd_intf_pins smartconnect_5/M00_AXI]
connect_bd_intf_net -intf_net spot_finder_0_data_out [get_bd_intf_pins axis_data_fifo_7/S_AXIS] [get_bd_intf_pins spot_finder_0/data_out]
connect_bd_intf_net -intf_net smartconnect_0_M00_AXI [get_bd_intf_pins m_axi_d_hbm_p24] [get_bd_intf_pins smartconnect_0/M00_AXI]
connect_bd_intf_net -intf_net smartconnect_1_M00_AXI [get_bd_intf_pins m_axi_d_hbm_p25] [get_bd_intf_pins smartconnect_1/M00_AXI]
connect_bd_intf_net -intf_net smartconnect_2_M00_AXI [get_bd_intf_pins m_axi_d_hbm_p26] [get_bd_intf_pins smartconnect_2/M00_AXI]
connect_bd_intf_net -intf_net smartconnect_3_M00_AXI [get_bd_intf_pins m_axi_d_hbm_p27] [get_bd_intf_pins smartconnect_3/M00_AXI]
connect_bd_intf_net -intf_net smartconnect_4_M00_AXI [get_bd_intf_pins m_axi_d_hbm_p28] [get_bd_intf_pins smartconnect_4/M00_AXI]
connect_bd_intf_net -intf_net smartconnect_5_M00_AXI [get_bd_intf_pins m_axi_d_hbm_p29] [get_bd_intf_pins smartconnect_5/M00_AXI]
connect_bd_intf_net -intf_net spot_finder_0_data_out [get_bd_intf_pins axis_data_fifo_8/S_AXIS] [get_bd_intf_pins spot_finder_0/data_out]
connect_bd_intf_net -intf_net spot_finder_0_strong_pixel_out [get_bd_intf_pins axis_spot_finder_fifo_0/S_AXIS] [get_bd_intf_pins spot_finder_0/strong_pixel_out]
connect_bd_intf_net -intf_net spot_finder_connecti_0_connectivity_out [get_bd_intf_pins axis_spot_finder_conn_fifo_0/S_AXIS] [get_bd_intf_pins spot_finder_connecti_0/connectivity_out]
connect_bd_intf_net -intf_net spot_finder_connecti_0_data_out [get_bd_intf_pins axis_spot_finder_fifo_1/S_AXIS] [get_bd_intf_pins spot_finder_connecti_0/data_out]
connect_bd_intf_net -intf_net spot_finder_mask_0_data_out [get_bd_intf_pins axis_data_fifo_7/S_AXIS] [get_bd_intf_pins spot_finder_mask_0/data_out]
connect_bd_intf_net -intf_net spot_finder_mask_0_m_axi_d_hbm_p0 [get_bd_intf_pins m_axi_d_hbm_p22] [get_bd_intf_pins spot_finder_mask_0/m_axi_d_hbm_p0]
connect_bd_intf_net -intf_net spot_finder_mask_0_m_axi_d_hbm_p1 [get_bd_intf_pins m_axi_d_hbm_p23] [get_bd_intf_pins spot_finder_mask_0/m_axi_d_hbm_p1]
connect_bd_intf_net -intf_net spot_finder_mask_0_m_axis_completion [get_bd_intf_pins m_axis_completion] [get_bd_intf_pins spot_finder_mask_0/m_axis_completion]
connect_bd_intf_net -intf_net spot_finder_mask_0_mask_out [get_bd_intf_pins axis_data_spot_finder_mask_0/S_AXIS] [get_bd_intf_pins spot_finder_mask_0/mask_out]
connect_bd_intf_net -intf_net spot_finder_merge_0_data_out [get_bd_intf_pins axis_spot_finder_fifo_2/S_AXIS] [get_bd_intf_pins spot_finder_merge_0/data_out]
connect_bd_intf_net -intf_net stream_24bit_conv_0_data_out [get_bd_intf_pins axis_register_slice_data_3/S_AXIS] [get_bd_intf_pins stream_24bit_conv_0/data_out]
# Create port connections
connect_bd_net -net ap_rst_n_1 [get_bd_pins ap_rst_n] [get_bd_pins adu_histo_0/ap_rst_n] [get_bd_pins axis_32_to_512_0/ap_rst_n] [get_bd_pins axis_64_to_512_0/ap_rst_n] [get_bd_pins frame_summation_0/ap_rst_n] [get_bd_pins integration_0/ap_rst_n] [get_bd_pins jf_conversion_0/ap_rst_n] [get_bd_pins mask_missing_0/ap_rst_n] [get_bd_pins pedestal_0/ap_rst_n] [get_bd_pins spot_finder_0/ap_rst_n] [get_bd_pins stream_24bit_conv_0/ap_rst_n]
connect_bd_net -net ap_rst_n_1 [get_bd_pins ap_rst_n] [get_bd_pins adu_histo_0/ap_rst_n] [get_bd_pins axis_64_to_512_0/ap_rst_n] [get_bd_pins frame_summation_0/ap_rst_n] [get_bd_pins integration_0/ap_rst_n] [get_bd_pins jf_conversion_0/ap_rst_n] [get_bd_pins mask_missing_0/ap_rst_n] [get_bd_pins pedestal_0/ap_rst_n] [get_bd_pins spot_finder_0/ap_rst_n] [get_bd_pins spot_finder_connecti_0/ap_rst_n] [get_bd_pins spot_finder_mask_0/ap_rst_n] [get_bd_pins spot_finder_merge_0/ap_rst_n] [get_bd_pins stream_24bit_conv_0/ap_rst_n]
connect_bd_net -net ap_start_1 [get_bd_pins frame_summation_0/ap_start] [get_bd_pins integration_0/ap_start] [get_bd_pins one/dout] [get_bd_pins spot_finder_0/ap_start] [get_bd_pins stream_24bit_conv_0/ap_start]
connect_bd_net -net axi_clk_1 [get_bd_pins axi_clk] [get_bd_pins adu_histo_0/ap_clk] [get_bd_pins axis_32_to_512_0/ap_clk] [get_bd_pins axis_64_to_512_0/ap_clk] [get_bd_pins axis_compl_fifo_0/s_axis_aclk] [get_bd_pins axis_compl_fifo_1/s_axis_aclk] [get_bd_pins axis_compl_fifo_2/s_axis_aclk] [get_bd_pins axis_compl_fifo_3/s_axis_aclk] [get_bd_pins axis_compl_fifo_4/s_axis_aclk] [get_bd_pins axis_data_fifo_0/s_axis_aclk] [get_bd_pins axis_data_fifo_1/s_axis_aclk] [get_bd_pins axis_data_fifo_2/s_axis_aclk] [get_bd_pins axis_data_fifo_3/s_axis_aclk] [get_bd_pins axis_data_fifo_4/s_axis_aclk] [get_bd_pins axis_data_fifo_5/s_axis_aclk] [get_bd_pins axis_data_fifo_6/s_axis_aclk] [get_bd_pins axis_data_fifo_7/s_axis_aclk] [get_bd_pins axis_integration_result_fifo_0/s_axis_aclk] [get_bd_pins axis_integration_result_fifo_1/s_axis_aclk] [get_bd_pins axis_register_slice_data_1/aclk] [get_bd_pins axis_register_slice_data_2/aclk] [get_bd_pins axis_register_slice_data_3/aclk] [get_bd_pins axis_spot_finder_fifo_0/s_axis_aclk] [get_bd_pins axis_spot_finder_fifo_1/s_axis_aclk] [get_bd_pins frame_summation_0/ap_clk] [get_bd_pins integration_0/ap_clk] [get_bd_pins jf_conversion_0/ap_clk] [get_bd_pins mask_missing_0/ap_clk] [get_bd_pins pedestal_0/ap_clk] [get_bd_pins smartconnect_0/aclk] [get_bd_pins smartconnect_1/aclk] [get_bd_pins smartconnect_2/aclk] [get_bd_pins smartconnect_3/aclk] [get_bd_pins smartconnect_4/aclk] [get_bd_pins smartconnect_5/aclk] [get_bd_pins spot_finder_0/ap_clk] [get_bd_pins stream_24bit_conv_0/ap_clk]
connect_bd_net -net axi_rst_n_1 [get_bd_pins axi_rst_n] [get_bd_pins axis_compl_fifo_0/s_axis_aresetn] [get_bd_pins axis_compl_fifo_1/s_axis_aresetn] [get_bd_pins axis_compl_fifo_2/s_axis_aresetn] [get_bd_pins axis_compl_fifo_3/s_axis_aresetn] [get_bd_pins axis_compl_fifo_4/s_axis_aresetn] [get_bd_pins axis_data_fifo_0/s_axis_aresetn] [get_bd_pins axis_data_fifo_1/s_axis_aresetn] [get_bd_pins axis_data_fifo_2/s_axis_aresetn] [get_bd_pins axis_data_fifo_3/s_axis_aresetn] [get_bd_pins axis_data_fifo_4/s_axis_aresetn] [get_bd_pins axis_data_fifo_5/s_axis_aresetn] [get_bd_pins axis_data_fifo_6/s_axis_aresetn] [get_bd_pins axis_data_fifo_7/s_axis_aresetn] [get_bd_pins axis_integration_result_fifo_0/s_axis_aresetn] [get_bd_pins axis_integration_result_fifo_1/s_axis_aresetn] [get_bd_pins axis_register_slice_data_1/aresetn] [get_bd_pins axis_register_slice_data_2/aresetn] [get_bd_pins axis_register_slice_data_3/aresetn] [get_bd_pins axis_spot_finder_fifo_0/s_axis_aresetn] [get_bd_pins axis_spot_finder_fifo_1/s_axis_aresetn] [get_bd_pins smartconnect_0/aresetn] [get_bd_pins smartconnect_1/aresetn] [get_bd_pins smartconnect_2/aresetn] [get_bd_pins smartconnect_3/aresetn] [get_bd_pins smartconnect_4/aresetn] [get_bd_pins smartconnect_5/aresetn]
connect_bd_net -net axi_clk_1 [get_bd_pins axi_clk] [get_bd_pins adu_histo_0/ap_clk] [get_bd_pins axis_64_to_512_0/ap_clk] [get_bd_pins axis_compl_fifo_0/s_axis_aclk] [get_bd_pins axis_compl_fifo_1/s_axis_aclk] [get_bd_pins axis_compl_fifo_2/s_axis_aclk] [get_bd_pins axis_compl_fifo_3/s_axis_aclk] [get_bd_pins axis_compl_fifo_4/s_axis_aclk] [get_bd_pins axis_compl_fifo_5/s_axis_aclk] [get_bd_pins axis_data_fifo_0/s_axis_aclk] [get_bd_pins axis_data_fifo_1/s_axis_aclk] [get_bd_pins axis_data_fifo_2/s_axis_aclk] [get_bd_pins axis_data_fifo_3/s_axis_aclk] [get_bd_pins axis_data_fifo_4/s_axis_aclk] [get_bd_pins axis_data_fifo_5/s_axis_aclk] [get_bd_pins axis_data_fifo_6/s_axis_aclk] [get_bd_pins axis_data_fifo_7/s_axis_aclk] [get_bd_pins axis_data_fifo_8/s_axis_aclk] [get_bd_pins axis_data_spot_finder_mask_0/s_axis_aclk] [get_bd_pins axis_integration_result_fifo_0/s_axis_aclk] [get_bd_pins axis_integration_result_fifo_1/s_axis_aclk] [get_bd_pins axis_register_slice_data_1/aclk] [get_bd_pins axis_register_slice_data_2/aclk] [get_bd_pins axis_register_slice_data_3/aclk] [get_bd_pins axis_spot_finder_conn_fifo_0/s_axis_aclk] [get_bd_pins axis_spot_finder_fifo_0/s_axis_aclk] [get_bd_pins axis_spot_finder_fifo_1/s_axis_aclk] [get_bd_pins axis_spot_finder_fifo_2/s_axis_aclk] [get_bd_pins frame_summation_0/ap_clk] [get_bd_pins integration_0/ap_clk] [get_bd_pins jf_conversion_0/ap_clk] [get_bd_pins mask_missing_0/ap_clk] [get_bd_pins pedestal_0/ap_clk] [get_bd_pins smartconnect_0/aclk] [get_bd_pins smartconnect_1/aclk] [get_bd_pins smartconnect_2/aclk] [get_bd_pins smartconnect_3/aclk] [get_bd_pins smartconnect_4/aclk] [get_bd_pins smartconnect_5/aclk] [get_bd_pins spot_finder_0/ap_clk] [get_bd_pins spot_finder_connecti_0/ap_clk] [get_bd_pins spot_finder_mask_0/ap_clk] [get_bd_pins spot_finder_merge_0/ap_clk] [get_bd_pins stream_24bit_conv_0/ap_clk]
connect_bd_net -net axi_rst_n_1 [get_bd_pins axi_rst_n] [get_bd_pins axis_compl_fifo_0/s_axis_aresetn] [get_bd_pins axis_compl_fifo_1/s_axis_aresetn] [get_bd_pins axis_compl_fifo_2/s_axis_aresetn] [get_bd_pins axis_compl_fifo_3/s_axis_aresetn] [get_bd_pins axis_compl_fifo_4/s_axis_aresetn] [get_bd_pins axis_compl_fifo_5/s_axis_aresetn] [get_bd_pins axis_data_fifo_0/s_axis_aresetn] [get_bd_pins axis_data_fifo_1/s_axis_aresetn] [get_bd_pins axis_data_fifo_2/s_axis_aresetn] [get_bd_pins axis_data_fifo_3/s_axis_aresetn] [get_bd_pins axis_data_fifo_4/s_axis_aresetn] [get_bd_pins axis_data_fifo_5/s_axis_aresetn] [get_bd_pins axis_data_fifo_6/s_axis_aresetn] [get_bd_pins axis_data_fifo_7/s_axis_aresetn] [get_bd_pins axis_data_fifo_8/s_axis_aresetn] [get_bd_pins axis_data_spot_finder_mask_0/s_axis_aresetn] [get_bd_pins axis_integration_result_fifo_0/s_axis_aresetn] [get_bd_pins axis_integration_result_fifo_1/s_axis_aresetn] [get_bd_pins axis_register_slice_data_1/aresetn] [get_bd_pins axis_register_slice_data_2/aresetn] [get_bd_pins axis_register_slice_data_3/aresetn] [get_bd_pins axis_spot_finder_conn_fifo_0/s_axis_aresetn] [get_bd_pins axis_spot_finder_fifo_0/s_axis_aresetn] [get_bd_pins axis_spot_finder_fifo_1/s_axis_aresetn] [get_bd_pins axis_spot_finder_fifo_2/s_axis_aresetn] [get_bd_pins smartconnect_0/aresetn] [get_bd_pins smartconnect_1/aresetn] [get_bd_pins smartconnect_2/aresetn] [get_bd_pins smartconnect_3/aresetn] [get_bd_pins smartconnect_4/aresetn] [get_bd_pins smartconnect_5/aresetn]
connect_bd_net -net axis_data_fifo_6_almost_empty [get_bd_pins proc_fifo_empty] [get_bd_pins axis_data_fifo_6/almost_empty]
connect_bd_net -net axis_data_fifo_6_almost_full [get_bd_pins proc_fifo_full] [get_bd_pins axis_data_fifo_6/almost_full]
connect_bd_net -net frame_summation_0_idle [get_bd_pins frame_summation_idle] [get_bd_pins frame_summation_0/idle]
connect_bd_net -net hbm_size_bytes_1 [get_bd_pins hbm_size_bytes] [get_bd_pins integration_0/hbm_size_bytes] [get_bd_pins jf_conversion_0/hbm_size_bytes] [get_bd_pins pedestal_0/hbm_size_bytes] [get_bd_pins spot_finder_mask_0/hbm_size_bytes]
connect_bd_net -net in_count_threshold_1 [get_bd_pins in_count_threshold] [get_bd_pins spot_finder_0/in_count_threshold]
connect_bd_net -net in_min_pix_per_spot_1 [get_bd_pins in_min_pix_per_spot] [get_bd_pins spot_finder_mask_0/in_min_pix_per_spot]
connect_bd_net -net in_max_d_value_1 [get_bd_pins in_max_d_value] [get_bd_pins spot_finder_mask_0/in_max_d_value]
connect_bd_net -net in_min_d_value_1 [get_bd_pins in_min_d_value] [get_bd_pins spot_finder_mask_0/in_min_d_value]
connect_bd_net -net in_snr_threshold_1 [get_bd_pins in_snr_threshold] [get_bd_pins spot_finder_0/in_snr_threshold]
connect_bd_net -net integration_0_idle [get_bd_pins integration_idle] [get_bd_pins integration_0/idle]
connect_bd_net -net stream_conv_0_idle [get_bd_pins stream_conv_idle] [get_bd_pins stream_24bit_conv_0/idle]
connect_bd_net -net hbm_size_bytes_1 [get_bd_pins hbm_size_bytes] [get_bd_pins integration_0/hbm_size_bytes] [get_bd_pins jf_conversion_0/hbm_size_bytes] [get_bd_pins pedestal_0/hbm_size_bytes]
connect_bd_net -net in_count_threshold_1 [get_bd_pins in_count_threshold] [get_bd_pins spot_finder_0/in_count_threshold]
connect_bd_net -net in_snr_threshold_1 [get_bd_pins in_snr_threshold] [get_bd_pins spot_finder_0/in_snr_threshold]
# Restore current instance
current_bd_instance $oldCurInst

Some files were not shown because too many files have changed in this diff Show More