FPGA: Remove frame_summation_reorder_compl test bench
This commit is contained in:
@@ -76,7 +76,7 @@ MAKE_HLS_MODULE(adu_histo adu_histo.cpp "")
|
||||
MAKE_HLS_MODULE(add_multipixel add_multipixel.cpp add_multipixel_tb.cpp)
|
||||
MAKE_HLS_MODULE(module_upside_down module_upside_down.cpp module_upside_down_tb.cpp)
|
||||
MAKE_HLS_MODULE(frame_summation frame_summation.cpp frame_summation_tb.cpp)
|
||||
MAKE_HLS_MODULE(frame_summation_reorder_compl frame_summation_reorder_compl.cpp frame_summation_reorder_compl_tb.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)
|
||||
|
||||
SET (HLS_IPS ${HLS_IPS} PARENT_SCOPE)
|
||||
|
||||
@@ -1,123 +0,0 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#include "hls_jfjoch.h"
|
||||
|
||||
void expected(int &ret, hls::stream<axis_completion>& compl_in, size_t frame_number, uint16_t module,
|
||||
uint16_t packet_count, uint16_t ignore) {
|
||||
axis_completion cmpl = compl_in.read();
|
||||
if (cmpl.frame_number != frame_number) {
|
||||
ret = 1;
|
||||
std::cerr << "Frame number error " << cmpl.frame_number << " " << frame_number << std::endl;
|
||||
}
|
||||
if (cmpl.module != module) {
|
||||
ret = 1;
|
||||
std::cerr << "Module number error " << cmpl.module << " " << module << std::endl;
|
||||
}
|
||||
|
||||
if (cmpl.packet_count != packet_count) {
|
||||
ret = 1;
|
||||
std::cerr << "Packet count error " << cmpl.packet_count << " " << packet_count << std::endl;
|
||||
}
|
||||
if (cmpl.ignore != ignore) {
|
||||
ret = 1;
|
||||
std::cerr << "Ignore val error " << cmpl.ignore << " " << ignore << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
int main() {
|
||||
|
||||
int ret = 0;
|
||||
|
||||
STREAM_512 input;
|
||||
STREAM_512 output;
|
||||
hls::stream<axis_completion> compl_in;
|
||||
hls::stream<axis_completion> compl_out;
|
||||
size_t nframes = 5;
|
||||
|
||||
ap_uint<512> action_control = 0;
|
||||
ACT_REG_NSUMMATION(action_control) = nframes - 1;
|
||||
|
||||
input << packet_512_t { .data = action_control, .user = 0 };
|
||||
input << packet_512_t { .user = 1 };
|
||||
|
||||
compl_in << axis_completion{.frame_number = 100, .packet_count = 128, .module = 4, .last = 0, .ignore = 0};
|
||||
compl_in << axis_completion{.frame_number = 100, .packet_count = 128, .module = 5, .last = 0, .ignore = 0};
|
||||
compl_in << axis_completion{.frame_number = 100, .packet_count = 128, .module = 3, .last = 0, .ignore = 0};
|
||||
|
||||
compl_in << axis_completion{.frame_number = 101, .packet_count = 128, .module = 4, .last = 0, .ignore = 0};
|
||||
compl_in << axis_completion{.frame_number = 101, .packet_count = 128, .module = 5, .last = 0, .ignore = 0};
|
||||
|
||||
compl_in << axis_completion{.frame_number = 102, .packet_count = 128, .module = 5, .last = 0, .ignore = 0};
|
||||
compl_in << axis_completion{.frame_number = 102, .packet_count = 128, .module = 4, .last = 0, .ignore = 0};
|
||||
compl_in << axis_completion{.frame_number = 102, .packet_count = 128, .module = 3, .last = 0, .ignore = 0};
|
||||
|
||||
compl_in << axis_completion{.frame_number = 103, .packet_count = 128, .module = 5, .last = 0, .ignore = 0};
|
||||
compl_in << axis_completion{.frame_number = 103, .packet_count = 128, .module = 4, .last = 0, .ignore = 0};
|
||||
|
||||
compl_in << axis_completion{.frame_number = 104, .packet_count = 128, .module = 4, .last = 0, .ignore = 0};
|
||||
compl_in << axis_completion{.frame_number = 104, .packet_count = 128, .module = 5, .last = 0, .ignore = 0};
|
||||
compl_in << axis_completion{.frame_number = 80, .packet_count = 35, .module = 5, .last = 0, .ignore = 0};
|
||||
|
||||
compl_in << axis_completion{.frame_number = 105, .packet_count = 128, .module = 5, .last = 0, .ignore = 0};
|
||||
compl_in << axis_completion{.frame_number = 105, .packet_count = 128, .module = 4, .last = 0, .ignore = 0};
|
||||
compl_in << axis_completion{.frame_number = 105, .packet_count = 128, .module = 3, .last = 0, .ignore = 0};
|
||||
|
||||
compl_in << axis_completion{.last = 1};
|
||||
|
||||
size_t size_start = compl_in.size();
|
||||
|
||||
frame_summation_reorder_compl(input, output, compl_in, compl_out);
|
||||
|
||||
if (compl_in.size() != 0) {
|
||||
std::cout << "compl_in should be empty: " << compl_in.size() << std::endl;
|
||||
ret = 1;
|
||||
}
|
||||
|
||||
if (compl_out.size() != size_start) {
|
||||
std::cout << "compl_out should be size " << size_start << ": " << compl_out.size() << std::endl;
|
||||
ret = 1;
|
||||
}
|
||||
|
||||
if (input.size() != 0)
|
||||
ret = 1;
|
||||
|
||||
if (output.size() != 2)
|
||||
ret = 1;
|
||||
|
||||
output.read();
|
||||
output.read();
|
||||
|
||||
expected(ret, compl_out, 80, 5, 35, 1);
|
||||
|
||||
expected(ret, compl_out, 100, 5, 128, 0);
|
||||
expected(ret, compl_out, 101, 5, 128, 0);
|
||||
expected(ret, compl_out, 102, 5, 128, 0);
|
||||
expected(ret, compl_out, 103, 5, 128, 0);
|
||||
expected(ret, compl_out, 104, 5, 128, 0);
|
||||
|
||||
expected(ret, compl_out, 100, 4, 128, 0);
|
||||
expected(ret, compl_out, 101, 4, 128, 0);
|
||||
expected(ret, compl_out, 102, 4, 128, 0);
|
||||
expected(ret, compl_out, 103, 4, 128, 0);
|
||||
expected(ret, compl_out, 104, 4, 128, 0);
|
||||
expected(ret, compl_out, 100, 3, 128, 1);
|
||||
expected(ret, compl_out, 102, 3, 128, 1);
|
||||
expected(ret, compl_out, 105, 3, 128, 1);
|
||||
expected(ret, compl_out, 105, 4, 128, 1);
|
||||
expected(ret, compl_out, 105, 5, 128, 1);
|
||||
|
||||
axis_completion cmpl = compl_out.read();
|
||||
if (!cmpl.last) {
|
||||
std::cerr << "Last completion error" << std::endl;
|
||||
ret = 1;
|
||||
}
|
||||
|
||||
if (ret != 0) {
|
||||
printf("Test failed !!!\n");
|
||||
ret = 1;
|
||||
} else {
|
||||
printf("Test passed !\n");
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
Reference in New Issue
Block a user