From 7973c2ca81c03e4cac59e9e20f68d5a600dffba8 Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Fri, 27 Oct 2023 15:27:36 +0200 Subject: [PATCH] HLS: Minor fixes to adu_histo.cpp --- fpga/hls/adu_histo.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/fpga/hls/adu_histo.cpp b/fpga/hls/adu_histo.cpp index 2eec2fa6..610b156f 100644 --- a/fpga/hls/adu_histo.cpp +++ b/fpga/hls/adu_histo.cpp @@ -35,19 +35,21 @@ void adu_histo(STREAM_512 &data_in, axis_completion cmpl; s_axis_completion >> cmpl; while (!cmpl.last) { - m_axis_completion << cmpl; - for (int i = 0; i < (sum + 1) * RAW_MODULE_SIZE / (32 * 2); i++) { + for (int s = 0; s < sum+1; s++) { + m_axis_completion << cmpl; + for (int i = 0; i < RAW_MODULE_SIZE / (32 * 2); i++) { #pragma HLS PIPELINE II=2 - for (int k = 0; k < 2; k++) { - data_in >> packet_in; - data_out << packet_in; + for (int k = 0; k < 2; k++) { + data_in >> packet_in; + data_out << packet_in; - unpack32(packet_in.data, in_val); - for (int j = 0; j < 32; j++) - count[k * 32 + j][in_val[j] / ADU_HISTO_BIN_WIDTH] += (cmpl.packet_mask[i / 64] ? 1 : 0); + unpack32(packet_in.data, in_val); + for (int j = 0; j < 32; j++) + count[k * 32 + j][in_val[j] / ADU_HISTO_BIN_WIDTH] += (cmpl.packet_mask[i / 64] ? 1 : 0); + } } + s_axis_completion >> cmpl; } - for (int i = 0; i < ADU_HISTO_BIN_COUNT / 16; i++) { #pragma HLS PIPELINE II=1 ap_uint<512> val = 0; @@ -61,7 +63,6 @@ void adu_histo(STREAM_512 &data_in, } result_out << val; } - s_axis_completion >> cmpl; } m_axis_completion << cmpl;