From 9f110f3c1a3d1f656c0668d97757979b8271264a Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Wed, 1 Nov 2023 14:28:32 +0100 Subject: [PATCH] FPGA: nmodules is actually module - 1 (there will be never 0 modules, while it can encode 32) --- fpga/hls/jf_conversion.cpp | 2 +- receiver/FPGAAcquisitionDevice.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fpga/hls/jf_conversion.cpp b/fpga/hls/jf_conversion.cpp index 035538c8..891386c8 100644 --- a/fpga/hls/jf_conversion.cpp +++ b/fpga/hls/jf_conversion.cpp @@ -139,7 +139,7 @@ void jf_conversion(STREAM_512 &data_in, STREAM_512 &data_out, ap_uint<64> mode = ACT_REG_MODE(packet_in.data); ap_uint<1> conversion = (mode & MODE_CONV) ? 1 : 0; - ap_uint<5> modules = ACT_REG_NMODULES(packet_in.data); + ap_uint<6> modules = ACT_REG_NMODULES(packet_in.data) + 1; ap_uint<32> in_one_over_energy = ACT_REG_ONE_OVER_ENERGY(packet_in.data); ap_uint<5> storage_cells = ACT_REG_NSTORAGE_CELLS(packet_in.data); diff --git a/receiver/FPGAAcquisitionDevice.cpp b/receiver/FPGAAcquisitionDevice.cpp index 32153691..41e8bbc3 100644 --- a/receiver/FPGAAcquisitionDevice.cpp +++ b/receiver/FPGAAcquisitionDevice.cpp @@ -202,7 +202,7 @@ void FPGAAcquisitionDevice::FillActionRegister(const DiffractionExperiment& x, D std::uniform_int_distribution dist; data_collection_id = dist(rd); - job.nmodules = x.GetModulesNum(data_stream); + job.nmodules = x.GetModulesNum(data_stream) - 1; job.nframes = x.GetFrameNum(); job.one_over_energy = std::lround((1<<20)/ x.GetPhotonEnergy_keV()); job.nstorage_cells = x.GetStorageCellNumber() - 1;