Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't synthesis Qkeras CNN model #442

Closed
HenningCode opened this issue Nov 5, 2021 · 7 comments · Fixed by #482
Closed

Can't synthesis Qkeras CNN model #442

HenningCode opened this issue Nov 5, 2021 · 7 comments · Fixed by #482
Assignees
Labels

Comments

@HenningCode
Copy link

Hello Guys,
I successfully synthesized some FC neural networks, now I tried CNN's, but I cant seem to make them work. I used the master branch and also the branch form PR #220.
I tried both io_stream as well as io_parallel, with both Resource and Latency.
Do you guys have an idea why it doesn't work?

The synthesis either fails with being stuck at the unrolling process being stuck or with this error log:

source /mnt/e41fa463-d10e-4d8d-ae5b-f90fb0242bd6/Xilinx/Vivado/2019.1/scripts/vivado_hls/hls.tcl -notrace
INFO: [HLS 200-10] Running '/mnt/e41fa463-d10e-4d8d-ae5b-f90fb0242bd6/Xilinx/Vivado/2019.1/bin/unwrapped/lnx64.o/vivado_hls'
INFO: [HLS 200-10] For user 'henning' on host 'henningubuntu' (Linux_x86_64 version 5.4.0-89-generic) on Fri Nov 05 17:11:21 CET 2021
INFO: [HLS 200-10] On os Ubuntu 18.04.6 LTS
INFO: [HLS 200-10] In directory '/home/henning/Schreibtisch/Masterarbeit/Hls4Ml/Output/my_model_qkeras'
Sourcing Tcl script 'build_prj.tcl'
INFO: [HLS 200-10] Opening project '/home/henning/Schreibtisch/Masterarbeit/Hls4Ml/Output/my_model_qkeras/mnist_classifier_prj'.
INFO: [HLS 200-10] Adding design file 'firmware/mnist_classifier.cpp' to the project
INFO: [HLS 200-10] Adding test bench file 'mnist_classifier_test.cpp' to the project
INFO: [HLS 200-10] Adding test bench file 'firmware/weights' to the project
INFO: [HLS 200-10] Adding test bench file 'tb_data' to the project
INFO: [HLS 200-10] Opening solution '/home/henning/Schreibtisch/Masterarbeit/Hls4Ml/Output/my_model_qkeras/mnist_classifier_prj/solution1'.
INFO: [SYN 201-201] Setting up clock 'default' with a period of 10ns.
INFO: [HLS 200-10] Setting target device to 'xc7z020-clg400-1'
INFO: [XFORM 203-101] Allowed max sub elements number after partition is 4096.
INFO: [XFORM 203-1161] The maximum of name length is set into 60.
INFO: [XFORM 203-101] Allowed max sub elements number after partition is 4096.
INFO: [XFORM 203-1161] The maximum of name length is set into 60.
***** C SIMULATION *****
INFO: [SIM 211-2] *************** CSIM start ***************
INFO: [SIM 211-4] CSIM will launch GCC as the compiler.
   Compiling ../../../../mnist_classifier_test.cpp in debug mode
   Compiling ../../../../firmware/mnist_classifier.cpp in debug mode
   Generating csim.exe
INFO: Unable to open input/predictions file, using default input.
WARNING: Hls::stream 'layer11_cpy1' contains leftover data, which may result in RTL simulation hanging.
0.0996094 0.0996094 0.0996094 0.0996094 0.0996094 0.0996094 0.0996094 0.0996094 0.0996094 0.0996094 
INFO: Saved inference results to file: tb_data/csim_results.log
INFO: [SIM 211-1] CSim done with 0 errors.
INFO: [SIM 211-3] *************** CSIM finish ***************
***** C SIMULATION COMPLETED IN 0h0m6s *****
***** C/RTL SYNTHESIS *****
INFO: [SCHED 204-61] Option 'relax_ii_for_timing' is enabled, will increase II to preserve clock frequency constraints.
INFO: [HLS 200-10] Analyzing design file 'firmware/mnist_classifier.cpp' ... 
WARNING: [HLS 200-40] In file included from firmware/mnist_classifier.cpp:1:
In file included from firmware/mnist_classifier.cpp:22:
In file included from firmware/parameters.h:12:
In file included from firmware/nnet_utils/nnet_conv2d_stream.h:5:
firmware/nnet_utils/nnet_conv_stream.h:13:10: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
 if (idx < K - S) {
     ~~~ ^ ~~~~~
firmware/nnet_utils/nnet_conv_stream.h:58:16: note: in instantiation of function template specialization 'nnet::scale_index_K_gte_S<2, 2, 28>' requested here
        return scale_index_K_gte_S<K, S, W>(idx);
               ^
firmware/nnet_utils/nnet_conv2d_stream.h:16:29: note: in instantiation of function template specialization 'nnet::scale_index<2, 2, 28>' requested here
    const unsigned sh_idx = scale_index<CONFIG_T::filt_height, CONFIG_T::stride_height, CONFIG_T::in_height>(h_idx);
                            ^
firmware/nnet_utils/nnet_conv2d_stream.h:58:13: note: in instantiation of function template specialization 'nnet::compute_scaled_indices_2d<nnet::array<ap_fixed<16, 6, 5, 3, 0>, 1>, config2>' requested here
            compute_scaled_indices_2d<data_T, CONFIG_T>(i_ih, i_iw, pixel_idx);
            ^
firmware/mnist_classifier.cpp:69:2: note: in instantiation of function template specialization 'nnet::conv_2d_cl<nnet::array<ap_fixed<16, 6, 5, 3, 0>, 1>, nnet::array<ap_fixed<16, 6, 5, 3, 0>, 16>, config2>' requested here
 nnet::conv_2d_cl<layer11_t, layer2_t, config2>(layer11_cpy2, layer2_out, w2, b2);
 ^
In file included from firmware/mnist_classifier.cpp:1:
In file included from firmware/mnist_classifier.cpp:22:
In file included from firmware/parameters.h:12:
In file included from firmware/nnet_utils/nnet_conv2d_stream.h:5:
firmware/nnet_utils/nnet_conv_stream.h:35:10: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
 if (idx < S - K) {
     ~~~ ^ ~~~~~
firmware/nnet_utils/nnet_conv_stream.h:60:16: note: in instantiation of function template specialization 'nnet::scale_index_K_lt_S<2, 2, 28>' requested here
        return scale_index_K_lt_S<K, S, W>(idx);
               ^
firmware/nnet_utils/nnet_conv2d_stream.h:16:29: note: in instantiation of function template specialization 'nnet::scale_index<2, 2, 28>' requested here
    const unsigned sh_idx = scale_index<CONFIG_T::filt_height, CONFIG_T::stride_height, CONFIG_T::in_height>(h_idx);
                            ^
firmware/nnet_utils/nnet_conv2d_stream.h:58:13: note: in instantiation of function template specialization 'nnet::compute_scaled_indices_2d<nnet::array<ap_fixed<16, 6, 5, 3, 0>, 1>, config2>' requested here
            compute_scaled_indices_2d<data_T, CONFIG_T>(i_ih, i_iw, pixel_idx);
            ^
firmware/mnist_classifier.cpp:69:2: note: in instantiation of function template specialization 'nnet::conv_2d_cl<nnet::array<ap_fixed<16, 6, 5, 3, 0>, 1>, nnet::array<ap_fixed<16, 6, 5, 3, 0>, 16>, config2>' requested here
 nnet::conv_2d_cl<layer11_t, layer2_t, config2>(layer11_cpy2, layer2_out, w2, b2);
 ^
2 warnings generated.
WARNING: [HLS 214-114] Since the only kind of statements allowed in a dataflow region are variable declarations and function calls, the compiler may not be able to correctly handle the region: firmware/nnet_utils/nnet_dense_latency.h:64:9
WARNING: [HLS 214-104] Only for-loops and functions support the dataflow: firmware/nnet_utils/nnet_dense_latency.h:76:9
WARNING: [HLS 214-114] Since the only kind of statements allowed in a dataflow region are variable declarations and function calls, the compiler may not be able to correctly handle the region: firmware/mnist_classifier.cpp:35:2
WARNING: [HLS 200-471] Dataflow form checks found 3 issue(s) in file firmware/mnist_classifier.cpp
INFO: [HLS 200-111] Finished Linking Time (s): cpu = 00:00:29 ; elapsed = 00:00:30 . Memory (MB): peak = 903.199 ; gain = 194.969 ; free physical = 7753 ; free virtual = 12266
INFO: [HLS 200-111] Finished Checking Pragmas Time (s): cpu = 00:00:29 ; elapsed = 00:00:30 . Memory (MB): peak = 903.199 ; gain = 194.969 ; free physical = 7753 ; free virtual = 12266
INFO: [HLS 200-10] Starting code transformations ...
INFO: [HLS 200-489] Unrolling loop 'ClonePack' (firmware/nnet_utils/nnet_stream.h:28) in function 'void nnet::clone_stream<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, 784>(hls::stream<FORWARD_REFERENCE>&, hls::stream<FORWARD_REFERENCE>&, hls::stream<FORWARD_REFERENCE>&)' completely with a factor of 1.
INFO: [HLS 200-489] Unrolling loop 'MultLoop' (firmware/nnet_utils/nnet_dense_resource.h:158) in function 'void nnet::dense_resource_rf_gt_nin_rem0<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config8>(FORWARD_REFERENCE*, FORWARD_REFERENCE*, FORWARD_REFERENCE::weight_t*, FORWARD_REFERENCE::bias_t*)' completely with a factor of 1.
INFO: [HLS 200-489] Unrolling loop 'ComputeIndex' (firmware/nnet_utils/nnet_conv2d_stream.h:19) in function 'void nnet::compute_scaled_indices_2d<nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, config5>(unsigned int, unsigned int, ap_uint<(FORWARD_REFERENCE::filt_height) * (FORWARD_REFERENCE::filt_width)>*)' completely with a factor of 1.
INFO: [HLS 200-489] Unrolling loop 'MultLoop' (firmware/nnet_utils/nnet_dense_resource.h:158) in function 'void nnet::dense_resource_rf_gt_nin_rem0<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config5_mult>(FORWARD_REFERENCE*, FORWARD_REFERENCE*, FORWARD_REFERENCE::weight_t*, FORWARD_REFERENCE::bias_t*)' completely with a factor of 1.
INFO: [HLS 200-489] Unrolling loop 'ComputeIndex' (firmware/nnet_utils/nnet_conv2d_stream.h:19) in function 'void nnet::compute_scaled_indices_2d<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, config2>(unsigned int, unsigned int, ap_uint<(FORWARD_REFERENCE::filt_height) * (FORWARD_REFERENCE::filt_width)>*)' completely with a factor of 1.
INFO: [HLS 200-489] Unrolling loop 'CopyDataChan' (firmware/nnet_utils/nnet_conv_stream.h:130) in function 'void nnet::compute_output<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, config2>(FORWARD_REFERENCE const&, hls::stream<FORWARD_REFERENCE::value_type>*, hls::stream<FORWARD_REFERENCE>&, FORWARD_REFERENCE&, unsigned int&, FORWARD_REFERENCE::weight_t*, FORWARD_REFERENCE::bias_t*, ap_uint<FORWARD_REFERENCE::kernel_size>*)' completely with a factor of 1.
INFO: [HLS 200-489] Unrolling loop 'Loop-1' (firmware/nnet_utils/nnet_types.h:32) in function 'nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>::operator=(nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u> const&)' completely with a factor of 1.
INFO: [HLS 200-489] Unrolling loop 'MultLoop' (firmware/nnet_utils/nnet_dense_resource.h:158) in function 'void nnet::dense_resource_rf_gt_nin_rem0<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config2_mult>(FORWARD_REFERENCE*, FORWARD_REFERENCE*, FORWARD_REFERENCE::weight_t*, FORWARD_REFERENCE::bias_t*)' completely with a factor of 1.
INFO: [XFORM 203-603] Inlining function 'nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>::operator[]' into 'nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>::operator=' (firmware/nnet_utils/nnet_types.h:34).
INFO: [XFORM 203-603] Inlining function 'nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>::operator[]' into 'nnet::compute_output<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, config2>' (firmware/nnet_utils/nnet_conv_stream.h:132).
INFO: [XFORM 203-603] Inlining function 'nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>::operator[].1' into 'nnet::clone_stream<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, 784>' (firmware/nnet_utils/nnet_stream.h:30).
INFO: [XFORM 203-603] Inlining function 'nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>::operator[].1' into 'nnet::clone_stream<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, 784>' (firmware/nnet_utils/nnet_stream.h:30).
INFO: [XFORM 203-603] Inlining function 'nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>::operator[].1' into 'nnet::clone_stream<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, 784>' (firmware/nnet_utils/nnet_stream.h:31).
INFO: [XFORM 203-603] Inlining function 'nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>::operator[].1' into 'nnet::clone_stream<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, 784>' (firmware/nnet_utils/nnet_stream.h:31).
INFO: [XFORM 203-603] Inlining function 'nnet::scale_index_K_gte_S<2u, 2u, 28u>' into 'nnet::scale_index<2u, 2u, 28u>' (firmware/nnet_utils/nnet_conv_stream.h:58).
INFO: [XFORM 203-603] Inlining function 'nnet::scale_index<2u, 2u, 28u>' into 'nnet::compute_scaled_indices_2d<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, config2>' (firmware/nnet_utils/nnet_conv2d_stream.h:22).
INFO: [XFORM 203-603] Inlining function 'nnet::scale_index<2u, 2u, 28u>' into 'nnet::compute_scaled_indices_2d<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, config2>' (firmware/nnet_utils/nnet_conv2d_stream.h:16).
INFO: [XFORM 203-603] Inlining function 'nnet::product::mult<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<4, 1, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0> >::product' into 'nnet::dense_resource_rf_gt_nin_rem0<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config2_mult>' (firmware/nnet_utils/nnet_dense_resource.h:160).
INFO: [XFORM 203-603] Inlining function 'nnet::dense_resource_rf_gt_nin_rem0<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config2_mult>' into 'nnet::dense_resource<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config2_mult>' (firmware/nnet_utils/nnet_dense_resource.h:276).
INFO: [XFORM 203-603] Inlining function 'nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>::operator[]' into 'nnet::mult_buffer<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, config2>' (firmware/nnet_utils/nnet_conv_stream.h:95).
INFO: [XFORM 203-603] Inlining function 'nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>::operator[]' into 'nnet::relu<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, relu_config4>' (firmware/nnet_utils/nnet_activation_stream.h:69).
INFO: [XFORM 203-603] Inlining function 'nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>::operator[]' into 'nnet::relu<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, relu_config4>' (firmware/nnet_utils/nnet_activation_stream.h:69).
INFO: [XFORM 203-603] Inlining function 'nnet::dense_resource<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config2_mult>' into 'nnet::mult_buffer<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, config2>' (firmware/nnet_utils/nnet_conv_stream.h:89).
INFO: [XFORM 203-603] Inlining function 'nnet::mult_buffer<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, config2>' into 'nnet::compute_output<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, config2>' (firmware/nnet_utils/nnet_conv_stream.h:136).
INFO: [XFORM 203-603] Inlining function 'nnet::compute_output<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, config2>' into 'nnet::conv_2d_cl<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, config2>' (firmware/nnet_utils/nnet_conv2d_stream.h:59).
INFO: [XFORM 203-603] Inlining function 'nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>::operator[].1' into 'nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>::operator=' (firmware/nnet_utils/nnet_types.h:34).
INFO: [XFORM 203-603] Inlining function 'nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>::operator[].1' into 'nnet::relu<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, relu_config4>' (firmware/nnet_utils/nnet_activation_stream.h:70).
INFO: [XFORM 203-603] Inlining function 'nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>::operator[].1' into 'nnet::relu<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, relu_config4>' (firmware/nnet_utils/nnet_activation_stream.h:69).
INFO: [XFORM 203-603] Inlining function 'nnet::scale_index_K_gte_S<3u, 2u, 14u>' into 'nnet::scale_index<3u, 2u, 14u>' (firmware/nnet_utils/nnet_conv_stream.h:58).
INFO: [XFORM 203-603] Inlining function 'nnet::scale_index<3u, 2u, 14u>' into 'nnet::compute_scaled_indices_2d<nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, config5>' (firmware/nnet_utils/nnet_conv2d_stream.h:22).
INFO: [XFORM 203-603] Inlining function 'nnet::scale_index<3u, 2u, 14u>' into 'nnet::compute_scaled_indices_2d<nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, config5>' (firmware/nnet_utils/nnet_conv2d_stream.h:16).
INFO: [XFORM 203-603] Inlining function 'nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>::operator[]' into 'nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>::operator=' (firmware/nnet_utils/nnet_types.h:34).
INFO: [XFORM 203-603] Inlining function 'nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>::operator[]' into 'nnet::compute_output<nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, config5>' (firmware/nnet_utils/nnet_conv_stream.h:132).
INFO: [XFORM 203-603] Inlining function 'nnet::product::mult<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<4, 1, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0> >::product' into 'nnet::dense_resource_rf_gt_nin_rem0<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config5_mult>' (firmware/nnet_utils/nnet_dense_resource.h:160).
INFO: [XFORM 203-603] Inlining function 'nnet::product::mult<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<4, 1, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0> >::product' into 'nnet::dense_resource_rf_gt_nin_rem0<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config8>' (firmware/nnet_utils/nnet_dense_resource.h:160).
INFO: [XFORM 203-603] Inlining function 'nnet::dense_resource_rf_gt_nin_rem0<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config5_mult>' into 'nnet::dense_resource<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config5_mult>' (firmware/nnet_utils/nnet_dense_resource.h:276).
INFO: [XFORM 203-603] Inlining function 'nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>::operator[]' into 'nnet::mult_buffer<nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, config5>' (firmware/nnet_utils/nnet_conv_stream.h:95).
INFO: [XFORM 203-603] Inlining function 'nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>::operator[]' into 'nnet::relu<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, relu_config7>' (firmware/nnet_utils/nnet_activation_stream.h:69).
INFO: [XFORM 203-603] Inlining function 'nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>::operator[]' into 'nnet::relu<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, relu_config7>' (firmware/nnet_utils/nnet_activation_stream.h:69).
INFO: [XFORM 203-603] Inlining function 'nnet::dense_resource<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config5_mult>' into 'nnet::mult_buffer<nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, config5>' (firmware/nnet_utils/nnet_conv_stream.h:89).
INFO: [XFORM 203-603] Inlining function 'nnet::mult_buffer<nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, config5>' into 'nnet::compute_output<nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, config5>' (firmware/nnet_utils/nnet_conv_stream.h:136).
INFO: [XFORM 203-603] Inlining function 'nnet::compute_output<nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, config5>' into 'nnet::conv_2d_cl<nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, config5>' (firmware/nnet_utils/nnet_conv2d_stream.h:59).
INFO: [XFORM 203-603] Inlining function 'nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>::operator[].1' into 'nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>::operator=' (firmware/nnet_utils/nnet_types.h:34).
INFO: [XFORM 203-603] Inlining function 'nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>::operator[]' into 'nnet::dense<nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>, config8>' (firmware/nnet_utils/nnet_dense_stream.h:48).
INFO: [XFORM 203-603] Inlining function 'nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>::operator[]' into 'nnet::relu<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, relu_config7>' (firmware/nnet_utils/nnet_activation_stream.h:70).
INFO: [XFORM 203-603] Inlining function 'nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>::operator[]' into 'nnet::relu<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, relu_config7>' (firmware/nnet_utils/nnet_activation_stream.h:69).
INFO: [XFORM 203-603] Inlining function 'nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>::operator[].1' into 'nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>::operator=' (firmware/nnet_utils/nnet_types.h:34).
INFO: [XFORM 203-603] Inlining function 'nnet::dense_resource_rf_gt_nin_rem0<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config8>' into 'nnet::dense_resource<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config8>' (firmware/nnet_utils/nnet_dense_resource.h:276).
INFO: [XFORM 203-603] Inlining function 'nnet::dense_resource<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config8>' into 'nnet::dense_wrapper<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config8>' (firmware/nnet_utils/nnet_dense_stream.h:24).
INFO: [XFORM 203-603] Inlining function 'nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>::operator[]' into 'nnet::softmax_latency<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>, softmax_config10>' (firmware/nnet_utils/nnet_activation_stream.h:175).
INFO: [XFORM 203-603] Inlining function 'nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>::operator[]' into 'nnet::softmax_latency<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>, softmax_config10>' (firmware/nnet_utils/nnet_activation_stream.h:156).
INFO: [XFORM 203-603] Inlining function 'nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>::operator[]' into 'nnet::dense<nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>, config8>' (firmware/nnet_utils/nnet_dense_stream.h:62).
INFO: [XFORM 203-603] Inlining function 'nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>::operator[].1' into 'nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>::operator=' (firmware/nnet_utils/nnet_types.h:34).
INFO: [HLS 200-111] Finished Standard Transforms Time (s): cpu = 00:00:43 ; elapsed = 00:00:44 . Memory (MB): peak = 2439.199 ; gain = 1730.969 ; free physical = 6528 ; free virtual = 11041
INFO: [HLS 200-10] Checking synthesizability ...
INFO: [XFORM 203-602] Inlining function 'nnet::compute_scaled_indices_2d<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, config2>' into 'nnet::conv_2d_cl<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, config2>' (firmware/nnet_utils/nnet_conv2d_stream.h:58) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::cast<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config2_mult>' into 'nnet::conv_2d_cl<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, config2>' (firmware/nnet_utils/nnet_dense_resource.h:178->firmware/nnet_utils/nnet_dense_resource.h:276->firmware/nnet_utils/nnet_conv_stream.h:89->firmware/nnet_utils/nnet_conv_stream.h:136->firmware/nnet_utils/nnet_conv2d_stream.h:59) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::cast<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config5_mult>' into 'nnet::conv_2d_cl<nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, config5>' (firmware/nnet_utils/nnet_dense_resource.h:178->firmware/nnet_utils/nnet_dense_resource.h:276->firmware/nnet_utils/nnet_conv_stream.h:89->firmware/nnet_utils/nnet_conv_stream.h:136->firmware/nnet_utils/nnet_conv2d_stream.h:59) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::cast<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config8>' into 'nnet::dense_wrapper<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config8>' (firmware/nnet_utils/nnet_dense_resource.h:178->firmware/nnet_utils/nnet_dense_resource.h:276->firmware/nnet_utils/nnet_dense_stream.h:24) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0>, 2, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0> > >' into 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0>, 4, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0> > >' (firmware/nnet_utils/nnet_common.h:54) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0>, 4, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0> > >' into 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0>, 8, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0> > >' (firmware/nnet_utils/nnet_common.h:54) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0>, 8, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0> > >' into 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0>, 10, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0> > >' (firmware/nnet_utils/nnet_common.h:54) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0>, 2, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0> > >' into 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0>, 10, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0> > >' (firmware/nnet_utils/nnet_common.h:54) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::softmax_idx_from_real_val<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, softmax_config10>' into 'nnet::softmax_latency<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>, softmax_config10>' (firmware/nnet_utils/nnet_activation_stream.h:156) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0>, 10, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0> > >' into 'nnet::softmax_latency<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>, softmax_config10>' (firmware/nnet_utils/nnet_activation_stream.h:164) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::softmax_idx_from_real_val<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0>, softmax_config10>' into 'nnet::softmax_latency<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>, softmax_config10>' (firmware/nnet_utils/nnet_activation_stream.h:166) automatically.
INFO: [HLS 200-111] Finished Checking Synthesizability Time (s): cpu = 00:00:44 ; elapsed = 00:00:46 . Memory (MB): peak = 2440.367 ; gain = 1732.137 ; free physical = 6544 ; free virtual = 11058
INFO: [XFORM 203-1101] Packing variable 'out_pack.data.V' (firmware/nnet_utils/nnet_activation_stream.h:170) into a 160-bit variable.
INFO: [XFORM 203-1101] Packing variable 'out_data.data.V' (firmware/nnet_utils/nnet_activation_stream.h:64) into a 160-bit variable.
INFO: [XFORM 203-1101] Packing variable 'out_data.data.V' (firmware/nnet_utils/nnet_activation_stream.h:64) into a 80-bit variable.
INFO: [XFORM 203-1101] Packing variable 'res_pack.data.V' (firmware/nnet_utils/nnet_dense_stream.h:58) into a 160-bit variable.
INFO: [XFORM 203-1101] Packing variable 'res_pack.data.V' (firmware/nnet_utils/nnet_conv2d_stream.h:45) into a 512-bit variable.
INFO: [XFORM 203-1101] Packing variable 'res_pack.data.V' (firmware/nnet_utils/nnet_conv2d_stream.h:45) into a 256-bit variable.
INFO: [XFORM 203-1101] Packing variable 'out_data1.data.V' (firmware/nnet_utils/nnet_stream.h:23) into a 16-bit variable.
INFO: [XFORM 203-1101] Packing variable 'out_data2.data.V' (firmware/nnet_utils/nnet_stream.h:24) into a 16-bit variable.
INFO: [XFORM 203-502] Unrolling all loops for pipelining in function 'nnet::softmax_latency<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>, softmax_config10>' (firmware/nnet_utils/nnet_activation_stream.h:32:59).
INFO: [XFORM 203-502] Unrolling all sub-loops inside loop 'ReLUActLoop' (firmware/nnet_utils/nnet_activation_stream.h:60) in function 'nnet::relu<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, relu_config7>' for pipelining.
INFO: [XFORM 203-502] Unrolling all sub-loops inside loop 'ReLUActLoop' (firmware/nnet_utils/nnet_activation_stream.h:60) in function 'nnet::relu<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, relu_config4>' for pipelining.
INFO: [XFORM 203-502] Unrolling all sub-loops inside loop 'DataPrepare' (firmware/nnet_utils/nnet_dense_stream.h:41) in function 'nnet::dense<nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>, config8>' for pipelining.
INFO: [HLS 200-489] Unrolling loop 'Loop-1' (firmware/nnet_utils/nnet_types.h:32) in function 'nnet::softmax_latency<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>, softmax_config10>' completely with a factor of 10.
INFO: [HLS 200-489] Unrolling loop 'SoftmaxExpPackLoop' (firmware/nnet_utils/nnet_activation_stream.h:154) in function 'nnet::softmax_latency<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>, softmax_config10>' completely with a factor of 10.
INFO: [HLS 200-489] Unrolling loop 'SoftmaxInvPackLoop' (firmware/nnet_utils/nnet_activation_stream.h:172) in function 'nnet::softmax_latency<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>, softmax_config10>' completely with a factor of 10.
INFO: [HLS 200-489] Unrolling loop 'Loop-1.1' (firmware/nnet_utils/nnet_types.h:32) in function 'nnet::relu<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, relu_config7>' completely with a factor of 32.
INFO: [HLS 200-489] Unrolling loop 'ReLUPackLoop' (firmware/nnet_utils/nnet_activation_stream.h:67) in function 'nnet::relu<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, relu_config7>' completely with a factor of 32.
INFO: [HLS 200-489] Unrolling loop 'Loop-1.1' (firmware/nnet_utils/nnet_types.h:32) in function 'nnet::relu<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, relu_config4>' completely with a factor of 16.
INFO: [HLS 200-489] Unrolling loop 'ReLUPackLoop' (firmware/nnet_utils/nnet_activation_stream.h:67) in function 'nnet::relu<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, relu_config4>' completely with a factor of 16.
INFO: [HLS 200-489] Unrolling loop 'Loop-1.1' (firmware/nnet_utils/nnet_types.h:32) in function 'nnet::dense<nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>, config8>' completely with a factor of 32.
INFO: [HLS 200-489] Unrolling loop 'DataPack' (firmware/nnet_utils/nnet_dense_stream.h:46) in function 'nnet::dense<nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>, config8>' completely with a factor of 32.
INFO: [HLS 200-489] Unrolling loop 'ResPack' (firmware/nnet_utils/nnet_dense_stream.h:60) in function 'nnet::dense<nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>, config8>' completely with a factor of 10.
INFO: [HLS 200-489] Unrolling loop 'Loop-2.1.1' (firmware/nnet_utils/nnet_types.h:32) in function 'nnet::conv_2d_cl<nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, config5>' completely with a factor of 16.
INFO: [HLS 200-489] Unrolling loop 'CopyDataFilt' (firmware/nnet_utils/nnet_conv_stream.h:128) in function 'nnet::conv_2d_cl<nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, config5>' completely with a factor of 9.
INFO: [HLS 200-489] Unrolling loop 'CopyDataChan' (firmware/nnet_utils/nnet_conv_stream.h:130) in function 'nnet::conv_2d_cl<nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, config5>' completely with a factor of 16.
INFO: [HLS 200-489] Unrolling loop 'InitData' (firmware/nnet_utils/nnet_conv_stream.h:80) in function 'nnet::conv_2d_cl<nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, config5>' completely with a factor of 144.
INFO: [HLS 200-489] Unrolling loop 'InitAccum' (firmware/nnet_utils/nnet_dense_resource.h:130) in function 'nnet::conv_2d_cl<nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, config5>' completely with a factor of 32.
INFO: [HLS 200-489] Unrolling loop 'Result' (firmware/nnet_utils/nnet_dense_resource.h:176) in function 'nnet::conv_2d_cl<nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, config5>' completely with a factor of 32.
INFO: [HLS 200-489] Unrolling loop 'CastLoop' (firmware/nnet_utils/nnet_conv_stream.h:92) in function 'nnet::conv_2d_cl<nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, config5>' completely with a factor of 32.
INFO: [HLS 200-489] Unrolling loop 'CopyDataFilt' (firmware/nnet_utils/nnet_conv_stream.h:128) in function 'nnet::conv_2d_cl<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, config2>' completely with a factor of 4.
INFO: [HLS 200-489] Unrolling loop 'InitData' (firmware/nnet_utils/nnet_conv_stream.h:80) in function 'nnet::conv_2d_cl<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, config2>' completely with a factor of 4.
INFO: [HLS 200-489] Unrolling loop 'InitAccum' (firmware/nnet_utils/nnet_dense_resource.h:130) in function 'nnet::conv_2d_cl<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, config2>' completely with a factor of 16.
INFO: [HLS 200-489] Unrolling loop 'Result' (firmware/nnet_utils/nnet_dense_resource.h:176) in function 'nnet::conv_2d_cl<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, config2>' completely with a factor of 16.
INFO: [HLS 200-489] Unrolling loop 'CastLoop' (firmware/nnet_utils/nnet_conv_stream.h:92) in function 'nnet::conv_2d_cl<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, config2>' completely with a factor of 16.
INFO: [HLS 200-489] Unrolling loop 'InitAccum' (firmware/nnet_utils/nnet_dense_resource.h:130) in function 'nnet::dense_wrapper<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config8>' completely with a factor of 10.
INFO: [HLS 200-489] Unrolling loop 'Result' (firmware/nnet_utils/nnet_dense_resource.h:176) in function 'nnet::dense_wrapper<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config8>' completely with a factor of 10.
INFO: [XFORM 203-102] Partitioning array 'tmp.data.V.11' automatically.
INFO: [XFORM 203-102] Partitioning array 'tmp.data.V.5' automatically.
INFO: [XFORM 203-102] Partitioning array 'tmp.data.V.9' automatically.
INFO: [XFORM 203-102] Partitioning array 'tmp.data.V.3' automatically.
INFO: [XFORM 203-102] Partitioning array 'tmp.data.V.7' automatically.
INFO: [XFORM 203-102] Partitioning array 'tmp.data.V.1' automatically.
WARNING: [XFORM 203-135] Cannot reshape array 'w5.V' : incorrect reshape factor 1.
WARNING: [XFORM 203-135] Cannot reshape array 'w2.V' : incorrect reshape factor 1.
WARNING: [XFORM 203-135] Cannot reshape array 'w8.V' : incorrect reshape factor 1.
WARNING: [XFORM 203-135] Cannot reshape array 'w5.V' : incorrect reshape factor 1.
WARNING: [XFORM 203-135] Cannot reshape array 'w2.V' : incorrect reshape factor 1.
WARNING: [XFORM 203-135] Cannot reshape array 'w8.V' : incorrect reshape factor 1.
INFO: [XFORM 203-102] Automatically partitioning streamed array 'layer8_out.V.data.V' (firmware/mnist_classifier.cpp:86) .
INFO: [XFORM 203-102] Automatically partitioning streamed array 'layer10_out.V.data.V' (firmware/mnist_classifier.cpp:26) .
INFO: [XFORM 203-102] Automatically partitioning streamed array 'layer5_out.V.data.V' (firmware/mnist_classifier.cpp:76) .
INFO: [XFORM 203-102] Automatically partitioning streamed array 'layer7_out.V.data.V' (firmware/mnist_classifier.cpp:81) .
INFO: [XFORM 203-102] Automatically partitioning streamed array 'layer2_out.V.data.V' (firmware/mnist_classifier.cpp:66) .
INFO: [XFORM 203-102] Automatically partitioning streamed array 'layer4_out.V.data.V' (firmware/mnist_classifier.cpp:71) .
INFO: [XFORM 203-102] Automatically partitioning streamed array 'data_window.V.V' (firmware/nnet_utils/nnet_conv2d_stream.h:37) .
INFO: [XFORM 203-102] Automatically partitioning streamed array 'data_window.V.V' (firmware/nnet_utils/nnet_conv2d_stream.h:37) .
INFO: [XFORM 203-102] Automatically partitioning streamed array 'layer11_cpy2.V.data.V' (firmware/mnist_classifier.cpp:61) .
INFO: [XFORM 203-102] Automatically partitioning streamed array 'input.V.data.V' (firmware/mnist_classifier.cpp:25) .
INFO: [XFORM 203-102] Automatically partitioning streamed array 'layer11_cpy1.V.data.V' (firmware/mnist_classifier.cpp:58) .
INFO: [XFORM 203-101] Partitioning array 'exp_res.V' (firmware/nnet_utils/nnet_activation_stream.h:146) in dimension 1 completely.
INFO: [XFORM 203-101] Partitioning array 'tmp.data.V.2' in dimension 1 completely.
INFO: [XFORM 203-101] Partitioning array 'tmp.data.V.4' in dimension 1 completely.
INFO: [XFORM 203-101] Partitioning array 'tmp.data.V.6' in dimension 1 completely.
WARNING: [XFORM 203-104] Completely partitioning array 'data.V' (firmware/nnet_utils/nnet_dense_stream.h:35) accessed through non-constant indices on dimension 1 (firmware/nnet_utils/nnet_dense_stream.h:48:39), which may result in long runtime and suboptimal QoR due to large multiplexers. Please consider wrapping the array access into a function or using a register file core instead.
INFO: [XFORM 203-101] Partitioning array 'data.V' (firmware/nnet_utils/nnet_dense_stream.h:35) in dimension 1 completely.
INFO: [XFORM 203-101] Partitioning array 'res'  in dimension 1 completely.
INFO: [XFORM 203-101] Partitioning array 'tmp.data.V.8' in dimension 1 completely.
WARNING: [XFORM 203-104] Completely partitioning array 'config5::pixels.V'  accessed through non-constant indices on dimension 1 (firmware/nnet_utils/nnet_conv2d_stream.h:23:9), which may result in long runtime and suboptimal QoR due to large multiplexers. Please consider wrapping the array access into a function or using a register file core instead.
INFO: [XFORM 203-101] Partitioning array 'config5::pixels.V'  in dimension 1 completely.
INFO: [XFORM 203-101] Partitioning array 'pixel_idx.V' (firmware/nnet_utils/nnet_conv2d_stream.h:49) in dimension 1 completely.
INFO: [XFORM 203-101] Partitioning array 'tmp.data.V.10' in dimension 1 completely.
WARNING: [XFORM 203-104] Completely partitioning array 'data.V' (firmware/nnet_utils/nnet_conv_stream.h:75) accessed through non-constant indices on dimension 1 (firmware/nnet_utils/nnet_dense_resource.h:160:20), which may result in long runtime and suboptimal QoR due to large multiplexers. Please consider wrapping the array access into a function or using a register file core instead.
INFO: [XFORM 203-101] Partitioning array 'data.V' (firmware/nnet_utils/nnet_conv_stream.h:75) in dimension 1 completely.
INFO: [XFORM 203-101] Partitioning array 'res.i.i'  in dimension 1 completely.
INFO: [XFORM 203-101] Partitioning array 'b5.V'  in dimension 1 completely.
INFO: [XFORM 203-101] Partitioning array 'acc.V' (firmware/nnet_utils/nnet_dense_resource.h:126) in dimension 1 completely.
INFO: [XFORM 203-101] Partitioning array 'config2::pixels.V'  in dimension 1 completely.
INFO: [XFORM 203-101] Partitioning array 'pixel_idx.V' (firmware/nnet_utils/nnet_conv2d_stream.h:49) in dimension 1 completely.
INFO: [XFORM 203-101] Partitioning array 'data.V' (firmware/nnet_utils/nnet_conv_stream.h:75) in dimension 1 completely.
INFO: [XFORM 203-101] Partitioning array 'res.i.i'  in dimension 1 completely.
INFO: [XFORM 203-101] Partitioning array 'b2.V'  in dimension 1 completely.
INFO: [XFORM 203-101] Partitioning array 'acc.V' (firmware/nnet_utils/nnet_dense_resource.h:126) in dimension 1 completely.
INFO: [XFORM 203-101] Partitioning array 'b8.V'  in dimension 1 completely.
INFO: [XFORM 203-101] Partitioning array 'acc.V' (firmware/nnet_utils/nnet_dense_resource.h:126) in dimension 1 completely.
INFO: [XFORM 203-101] Partitioning array 'layer8_out.V.data.V' (firmware/mnist_classifier.cpp:86) in dimension 1 completely.
INFO: [XFORM 203-101] Partitioning array 'layer10_out.V.data.V' (firmware/mnist_classifier.cpp:26) in dimension 1 completely.
INFO: [XFORM 203-101] Partitioning array 'layer5_out.V.data.V' (firmware/mnist_classifier.cpp:76) in dimension 1 completely.
INFO: [XFORM 203-101] Partitioning array 'layer7_out.V.data.V' (firmware/mnist_classifier.cpp:81) in dimension 1 completely.
INFO: [XFORM 203-101] Partitioning array 'layer2_out.V.data.V' (firmware/mnist_classifier.cpp:66) in dimension 1 completely.
INFO: [XFORM 203-101] Partitioning array 'layer4_out.V.data.V' (firmware/mnist_classifier.cpp:71) in dimension 1 completely.
WARNING: [XFORM 203-104] Completely partitioning array 'data_window.V.V' (firmware/nnet_utils/nnet_conv2d_stream.h:37) accessed through non-constant indices on dimension 1 (firmware/nnet_utils/nnet_conv2d_stream.h:40:1), which may result in long runtime and suboptimal QoR due to large multiplexers. Please consider wrapping the array access into a function or using a register file core instead.
INFO: [XFORM 203-101] Partitioning array 'data_window.V.V' (firmware/nnet_utils/nnet_conv2d_stream.h:37) in dimension 1 completely.
INFO: [XFORM 203-101] Partitioning array 'data_window.V.V' (firmware/nnet_utils/nnet_conv2d_stream.h:37) in dimension 1 completely.
INFO: [XFORM 203-101] Partitioning array 'layer11_cpy2.V.data.V' (firmware/mnist_classifier.cpp:61) in dimension 1 completely.
INFO: [XFORM 203-101] Partitioning array 'input.V.data.V' (firmware/mnist_classifier.cpp:25) in dimension 1 completely.
INFO: [XFORM 203-101] Partitioning array 'layer11_cpy1.V.data.V' (firmware/mnist_classifier.cpp:58) in dimension 1 completely.
WARNING: [XFORM 203-104] Completely partitioning array 'data.V' (firmware/nnet_utils/nnet_dense_stream.h:35) accessed through non-constant indices on dimension 1 (firmware/nnet_utils/nnet_dense_resource.h:160:20), which may result in long runtime and suboptimal QoR due to large multiplexers. Please consider wrapping the array access into a function or using a register file core instead.
INFO: [XFORM 203-602] Inlining function 'nnet::compute_scaled_indices_2d<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, config2>' into 'nnet::conv_2d_cl<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, config2>' (firmware/nnet_utils/nnet_conv2d_stream.h:58) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::cast<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config2_mult>' into 'nnet::conv_2d_cl<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, config2>' (firmware/nnet_utils/nnet_dense_resource.h:178->firmware/nnet_utils/nnet_dense_resource.h:276->firmware/nnet_utils/nnet_conv_stream.h:89->firmware/nnet_utils/nnet_conv_stream.h:136->firmware/nnet_utils/nnet_conv2d_stream.h:59) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::cast<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config5_mult>' into 'nnet::conv_2d_cl<nnet::array<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, 16u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 32u>, config5>' (firmware/nnet_utils/nnet_dense_resource.h:178->firmware/nnet_utils/nnet_dense_resource.h:276->firmware/nnet_utils/nnet_conv_stream.h:89->firmware/nnet_utils/nnet_conv_stream.h:136->firmware/nnet_utils/nnet_conv2d_stream.h:59) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::cast<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config8>' into 'nnet::dense_wrapper<ap_fixed<5, 3, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config8>' (firmware/nnet_utils/nnet_dense_resource.h:178->firmware/nnet_utils/nnet_dense_resource.h:276->firmware/nnet_utils/nnet_dense_stream.h:24) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0> >::operator()' into 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0>, 2, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0> > >' (firmware/nnet_utils/nnet_common.h:52) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0> >::operator()' into 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0>, 4, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0> > >' (firmware/nnet_utils/nnet_common.h:54) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0> >::operator()' into 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0>, 8, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0> > >' (firmware/nnet_utils/nnet_common.h:54) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0>, 8, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0> > >' into 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0>, 10, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0> > >' (firmware/nnet_utils/nnet_common.h:54) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0>, 2, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0> > >' into 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0>, 10, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0> > >' (firmware/nnet_utils/nnet_common.h:54) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0> >::operator()' into 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0>, 10, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0> > >' (firmware/nnet_utils/nnet_common.h:54) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::softmax_idx_from_real_val<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, softmax_config10>' into 'nnet::softmax_latency<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>, softmax_config10>' (firmware/nnet_utils/nnet_activation_stream.h:156) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::softmax_idx_from_real_val<ap_fixed<18, 8, (ap_q_mode)0, (ap_o_mode)0, 0>, softmax_config10>' into 'nnet::softmax_latency<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 10u>, softmax_config10>' (firmware/nnet_utils/nnet_activation_stream.h:166) automatically.
WARNING: [XFORM 203-731] Internal stream variable 'layer11_cpy1.V.data[0].V' (firmware/mnist_classifier.cpp:58) is invalid: it has no data consumer.
ERROR: [XFORM 203-711] Internal stream 'layer11_cpy1.V.data[0].V' failed dataflow checking: it must be produced and consumed exactly once.
WARNING: [XFORM 203-713] Variable 'layer11_cpy1.V.data[0].V' has write operations in process function 'nnet::clone_stream<nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, nnet::array<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, 1u>, 784>'.
ERROR: [HLS 200-70] Pre-synthesis failed.
command 'ap_source' returned error code
    while executing
"source build_prj.tcl"
    ("uplevel" body line 1)
    invoked from within
"uplevel \#0 [list source $arg] "

INFO: [Common 17-206] Exiting vivado_hls at Fri Nov  5 17:12:39 2021...
Synthesis report not found.
Found 1 solution(s) in ../Output/my_model_qkeras/mnist_classifier_prj.
Reports for solution "solution1":

C SIMULATION RESULT:
INFO: [SIM 2] *************** CSIM start ***************
INFO: [SIM 4] CSIM will launch GCC as the compiler.
   Compiling ../../../../mnist_classifier_test.cpp in debug mode
   Compiling ../../../../firmware/mnist_classifier.cpp in debug mode
   Generating csim.exe
INFO: Unable to open input/predictions file, using default input.
WARNING: Hls::stream 'layer11_cpy1' contains leftover data, which may result in RTL simulation hanging.
0.0996094 0.0996094 0.0996094 0.0996094 0.0996094 0.0996094 0.0996094 0.0996094 0.0996094 0.0996094 
INFO: Saved inference results to file: tb_data/csim_results.log
INFO: [SIM 1] CSim done with 0 errors.
INFO: [SIM 3] *************** CSIM finish ***************

My config is this:

AxiWidth: '8'
Backend: Vivado
ClockPeriod: 10
IOType: io_stream
Implementation: serial
Interface: m_axi
OutputDir: ../Output/my_model_qkeras
ProjectName: mnist_classifier
XilinxPart: xc7z020clg400-1
HLSConfig:
  LayerName:
    act0_m:
      Precision:
        result: ap_fixed<5,3>
      ReuseFactor: 1000000
      Trace: true
    act1_m:
      Precision:
        result: ap_fixed<5,3>
      ReuseFactor: 1000000
      Trace: true
    conv2d_0_m:
      Precision:
        bias: ap_fixed<5,1>
        weight: ap_fixed<5,1>
      ReuseFactor: 1000000
      Trace: true
    conv2d_1_m:
      Precision:
        bias: ap_fixed<5,1>
        weight: ap_fixed<5,1>
      ReuseFactor: 1000000
      Trace: true
    dense:
      Precision:
        bias: ap_fixed<5,1>
        weight: ap_fixed<5,1>
      ReuseFactor: 1000000
      Trace: true
    input:
      Precision:
        result: ap_fixed<16,6>
      Trace: true
    softmax:
      Precision: ap_fixed<16,6>
      ReuseFactor: 1000000
      exp_table_t: ap_fixed<18,8,AP_RND,AP_SAT>
      inv_table_t: ap_fixed<18,8,AP_RND,AP_SAT>
      table_size: 1024
      Trace: true
  Model:
    Precision: ap_fixed<16,6>
    ReuseFactor: 1000000
    Strategy: Resource

This is my Model.
ModelCNN

@jmduarte jmduarte self-assigned this Nov 8, 2021
@jmduarte
Copy link
Member

jmduarte commented Nov 8, 2021

Can you send us a script to reproduce your model and error?

@jmduarte jmduarte added the bug label Nov 8, 2021
@HenningCode
Copy link
Author

This Code is used to convert the model:

print('-------------------------------------------------')
print('INFO: Starting Converter')
print('-------------------------------------------------')


QKERAS = 1
LOAD_CONFIG = 1
BUILDING = 1
CONVNET = 1

model_dir = 'model/qkeras_mymodel_smallconv.h5'


if QKERAS:
    co = {}
    utils._add_supported_quantized_objects(co)
    model = utils.load_qmodel(model_dir,custom_objects=co)

model.summary()

print('-------------------------------------------------')
print('INFO: Starting Conversion of Config')
print('-------------------------------------------------')

if LOAD_CONFIG:
    args = command_line_chk()
    param = yaml_load(args.config)
    config = param
    config['KerasModel'] = model
    hls_model = hls4ml.converters.keras_to_hls(config)
else:
    config = hls4ml.utils.config_from_keras_model(model,granularity='name')
    yaml_save(config=config,filepath='qkeras_mymode_conv_config.yml')
    print_dict(config)
    hls_model = hls4ml.converters.convert_from_keras_model(model,
                                            hls_config=config,
                                            output_dir='../output/model_std/hls4ml_prj',
                                            fpga_part='xc7z020clg400-1')




_ = hls_model.compile()


if BUILDING:
    print('-------------------------------------------------')
    print('INFO: Starting Building')
    print('-------------------------------------------------')
    hls_model.build(validation=True,export=True)
    hls4ml.report.read_vivado_report('../Output/my_model_qkeras')

This Code is used to create the Model:

def count_errors(x, y):
    error = 0
    for i in range(len(x)):
        if(not np.array_equal(x[i], y[i])):
            error += 1

    return error


def yaml_save(config, filepath):
    with open(filepath, 'w') as outfile:
        yaml.dump(config, outfile, default_flow_style=False)


print("============================================================================\n\n\n")


model_dir = 'model/qkeras_mymodel_smallconv.h5'
config_dir ='config/qkeras_mymodel_smallconv_config.yml'
picture_dir = 'picture/qkeras_mymodel_smallconv.png'

NB_EPOCH = 5
BATCH_SIZE = 64
VERBOSE = 1
NB_CLASSES = 10
OPTIMIZER = Adam(learning_rate=0.0001, decay=0.000025)
VALIDATION_SPLIT = 0.1

SAFE_CONFIG = 1
COVNET = 1

(x_train, y_train), (x_test, y_test) = mnist.load_data()

RESHAPED = 784

x_test_orig = x_test

x_train = x_train.astype("float32")
x_test = x_test.astype("float32")

if COVNET:
    x_train = x_train[..., np.newaxis]
    x_test = x_test[..., np.newaxis]
else:
    x_train = x_train.reshape(x_train.shape[0], RESHAPED)
    x_test = x_test.reshape(x_test.shape[0], RESHAPED)

# Here only tested with, without the accuracy is bad even without QDense
x_train /= 256
x_test /= 256

print('Train shape: ', x_train.shape)
print('Test shape: ', x_test.shape)

y_train = to_categorical(y_train, NB_CLASSES)
y_test = to_categorical(y_test, NB_CLASSES)

if COVNET:
    x = x_in = Input(
        x_train.shape[1:-1] + (1,), name="input")
    x = QConv2D(
        16, (2, 2), strides=(2, 2),
        kernel_quantizer=quantized_bits(4, 0, alpha=1),
        bias_quantizer=quantized_bits(4, 0, alpha=1),
        name="conv2d_0_m")(x)
    x = QActivation("quantized_relu(4,2)", name="act0_m")(x)
    x = QConv2D(
        32, (3, 3), strides=(2, 2),
        kernel_quantizer=quantized_bits(4, 0, alpha=1),
        bias_quantizer=quantized_bits(4, 0, alpha=1),
        name="conv2d_1_m")(x)
    x = QActivation("quantized_relu(4,2)", name="act1_m")(x)
    x = Flatten()(x)
    x = QDense(NB_CLASSES, kernel_quantizer=quantized_bits(4, 0, alpha=1),
               bias_quantizer=quantized_bits(4, 0, 1, alpha=1),
               name="dense")(x)
    x = Activation("softmax", name="softmax")(x)


else:
    x = x_in = Input((RESHAPED,), name="input")
    #x = Dense(64,name="dense0")(x)
    x = QDense(64, kernel_quantizer=quantized_bits(5, 0, alpha=1),
               bias_quantizer=quantized_bits(5, 0, alpha=1), name="dense0")(x)
    x = QBatchNormalization()(x)
    x = QActivation("quantized_relu(4,2)", name="act0")(x)
    x = QDense(NB_CLASSES, kernel_quantizer=quantized_bits(5, 0, alpha=1),
               bias_quantizer=quantized_bits(5, 0, alpha=1), name="dense2")(x)
    x = Activation("softmax", name="softmax")(x)

model = Model(inputs=[x_in], outputs=[x])
model.summary()
model.compile(
    loss="categorical_crossentropy", optimizer=OPTIMIZER, metrics=["accuracy"])

history = model.fit(
    x_train, y_train, batch_size=BATCH_SIZE,
    epochs=NB_EPOCH, initial_epoch=1, verbose=VERBOSE,
    validation_split=VALIDATION_SPLIT)

model.save(model_dir)

config = hls4ml.utils.config_from_keras_model(model, granularity='name')
config['Model']['Strategy'] = 'Resource'

if SAFE_CONFIG:
    yaml_save(config=config, filepath=config_dir)


print_dict(config)
hls_model = hls4ml.converters.convert_from_keras_model(model,
                                                       hls_config=config,
                                                       output_dir='../output/model_std/hls4ml_prj',
                                                       fpga_part='xc7z020clg400-1')
_ = hls_model.compile()


TEST_CASES = 1000

hls4ml.utils.plot_model(hls_model, show_shapes=True,
                        show_precision=True, to_file='pictures/batchdense_model.png')
plt.show()

out_model = model.predict(x_test[0:TEST_CASES])
out_model_change = np.zeros_like(out_model)
out_model_change[np.arange(len(out_model)), out_model.argmax(1)] = 1

out_hls = hls_model.predict(x_test[0:TEST_CASES])
out_hls_change = np.zeros_like(out_hls)
out_hls_change[np.arange(len(out_hls)), out_hls.argmax(1)] = 1

print('Error Normal: ', count_errors(out_model_change, y_test[0:TEST_CASES]))
print('Error HLS: ', count_errors(out_hls_change, y_test[0:TEST_CASES]))

@HenningCode
Copy link
Author

HenningCode commented Nov 12, 2021

I also found out, that I can synthesize the example qkeras_mnist_cnn just fine. I then tried to replicate the model for my self, train it and synthesize it.

I does not work...
I am on the latest master branch as well as the version 0.6.0 from pip
This is the script that works just fine for the example model.

import hls4ml
from tensorflow.keras.utils import to_categorical
from tensorflow.keras.datasets import mnist
import numpy as np
from sklearn.metrics import accuracy_score
import tensorflow as tf
from qkeras import *
import yaml
import json

def print_dict(d, indent=0):
    align = 20
    for key, value in d.items():
        print('  ' * indent + str(key), end='')
        if isinstance(value, dict):
            print()
            print_dict(value, indent+1)
        else:
            print(':' + ' ' * (20 - len(key) - 2 * indent) + str(value))


def yaml_save(config, filepath):
    with open(filepath, 'w') as outfile:
        yaml.dump(config, outfile, default_flow_style=False)

print('----------------------------------------------------------------')

output_dir = '../Output/example_model'

with open('qkeras_mnist_cnn.json') as f:
  data = json.load(f)

data = json.dumps(data)

co = {}
utils._add_supported_quantized_objects(co)
model = tf.keras.models.model_from_json(data,custom_objects=co)
model.load_weights('qkeras_mnist_cnn_weights.h5')
model.summary()


config = hls4ml.utils.fetch_example_model('qkeras_mnist_cnn.json')
config.pop('KerasJson')
config.pop('KerasH5')
config['XilinxPart'] = 'xc7z020clg400-1'
config['OutputDir'] = output_dir

#config['KerasJson'] = 'qkeras_mnist_cnn.json'
config['HLSConfig']['Model']['Strategy'] = 'Resource'
config['HLSConfig']['Model']['ReuseFactor'] = 1024
config['IOType'] = 'io_stream'
config['Backend'] = 'Vivado'
config['HLSConfig']['LayerName']['q_conv2d']['ReuseFactor'] = 10000
config['HLSConfig']['LayerName']['q_conv2d_1']['ReuseFactor'] = 10000000
config['HLSConfig']['LayerName']['q_dense']['ReuseFactor'] = 100000000
yaml_save(config=config, filepath='config/example_config.yml')
config['KerasModel'] = model
print_dict(config)
hls_model = hls4ml.converters.keras_to_hls(config)
hls4ml.utils.plot_model(hls_model, show_shapes=True,
                        show_precision=True, to_file='pictures/example_model.png')

(x_train, y_train), (x_test, y_test) = mnist.load_data()

TEST_CASES = 1000

RESHAPED = 28*28
NB_CLASSES = 10

x_train = x_train.astype("float32")
x_test = x_test.astype("float32")

x_train = x_train.reshape(x_train.shape[0], RESHAPED)
x_test = x_test.reshape(x_test.shape[0], RESHAPED)

x_train /= 256
x_test /= 256


y_train = to_categorical(y_train, NB_CLASSES)
y_test = to_categorical(y_test, NB_CLASSES)

hls_model.compile()


y_hls = hls_model.predict(x_test[0:TEST_CASES])
acc_hls4ml = accuracy_score(np.argmax(y_test[0:TEST_CASES], axis=1), np.argmax(y_hls, axis=1))

print('\n')
print('Accuracy hls4ml:     {}'.format(acc_hls4ml))

hls_model.build()
hls4ml.report.read_vivado_report(output_dir) 

With this script I am trying to replicate the model, but that doesnt not work. It always gets stuck at Unrolling loop 'Loop-1.1.1'

import hls4ml
import tensorflow.keras.backend as K
from tensorflow.keras.datasets import mnist
from tensorflow.keras.layers import Activation
from tensorflow.keras.layers import Flatten
from tensorflow.keras.layers import Input
from tensorflow.keras.layers import *
from tensorflow.keras.models import Model
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.utils import to_categorical
from sklearn.metrics import accuracy_score
from tensorflow.python.keras.backend import backend
import yaml

import matplotlib.pyplot as plt
from create_model import *
from qkeras import *


def print_dict(d, indent=0):
    align = 20
    for key, value in d.items():
        print('  ' * indent + str(key), end='')
        if isinstance(value, dict):
            print()
            print_dict(value, indent+1)
        else:
            print(':' + ' ' * (20 - len(key) - 2 * indent) + str(value))


def count_errors(x, y):
    error = 0
    for i in range(len(x)):
        if(not np.array_equal(x[i], y[i])):
            error += 1

    return error


def yaml_save(config, filepath):
    with open(filepath, 'w') as outfile:
        yaml.dump(config, outfile, default_flow_style=False)


print("============================================================================\n\n\n")

name = 'small conv'

model_dir = 'model/' + name + '.h5'
config_dir = 'config/' + name + '.yml'
picture_dir = 'pictures/' + name + '.png'

NB_EPOCH = 3
BATCH_SIZE = 64
VERBOSE = 1
NB_CLASSES = 10
OPTIMIZER = Adam(learning_rate=0.0001, decay=0.000025)
VALIDATION_SPLIT = 0.1

SAFE_CONFIG = 1
COVNET = 1

(x_train, y_train), (x_test, y_test) = mnist.load_data()

RESHAPED = 784

x_test_orig = x_test

x_train = x_train.astype("float32")
x_test = x_test.astype("float32")

if COVNET:
    x_train = x_train[..., np.newaxis]
    x_test = x_test[..., np.newaxis]
else:
    x_train = x_train.reshape(x_train.shape[0], RESHAPED)
    x_test = x_test.reshape(x_test.shape[0], RESHAPED)

# Here only tested with, without the accuracy is bad even without QDense
x_train /= 256
x_test /= 256

y_train = to_categorical(y_train, NB_CLASSES)
y_test = to_categorical(y_test, NB_CLASSES)

x = x_in = Input(x_train.shape[1:-1] + (1,), name="input")
x = QConv2D(
            16, (3, 3),
            kernel_quantizer=quantized_bits(6, 0, alpha=1),
            bias_quantizer=quantized_bits(6, 0, alpha=1),
            name="conv2d_0_m")(x)
x = QActivation("quantized_relu(7,0)", name="act0_m")(x)
x = MaxPool2D()(x)
x = QConv2D(
            16, (3, 3),
            kernel_quantizer=quantized_bits(6, 0, alpha=1),
            bias_quantizer=quantized_bits(6, 0, alpha=1),
            name="conv2d_1_m")(x)
x = QActivation("quantized_relu(7,0)", name="act1_m")(x)
x = MaxPool2D()(x)
x = Flatten()(x)
x = Dropout(0.5)(x)
x = QDense(NB_CLASSES, 
            kernel_quantizer=quantized_bits(6, 0, alpha=1),
            bias_quantizer=quantized_bits(6, 0, alpha=1),
            name="dense")(x)
x = Activation("softmax", name="softmax")(x)

model = Model(inputs=[x_in], outputs=[x])
model.summary()


model.compile(
    loss="categorical_crossentropy", optimizer=OPTIMIZER, metrics=["accuracy"])


history = model.fit(
    x_train, y_train, batch_size=BATCH_SIZE,
    epochs=NB_EPOCH, initial_epoch=1, verbose=VERBOSE,
    validation_split=VALIDATION_SPLIT)

model.save(model_dir)

backend_config = {}
output_dir = '../Output/my_shit_box1'

config = hls4ml.utils.config_from_keras_model(model, granularity='name')
config['Model']['Strategy'] = 'Resource'
config['Model']['ReuseFactor'] = 16
backend_config['Backend'] = 'Vivado'
backend_config['ClockPeriod'] = 5
backend_config['HLSConfig'] = config
backend_config['XilinxPart'] = 'xc7z020clg400-1'
backend_config['OutputDir'] = output_dir
backend_config['ProjectName'] = 'MyProject'
backend_config['IOType'] = 'io_parallel'
backend_config['Interface'] = 'm_axi'
backend_config['AxiWidth'] = str(8)
backend_config['HLSConfig']['LayerName']['softmax']['Strategy'] = 'Stable'
#backend_config['HLSConfig']['LayerName']['act0_m']['Precision'] = 'ap_fixed<7,1,AP_RND,AP_SAT>'
#backend_config['HLSConfig']['LayerName']['act1_m']['Precision'] = 'ap_fixed<7,1,AP_RND,AP_SAT>'
backend_config['HLSConfig']['LayerName']['conv2d_0_m']['ReuseFactor'] = 1000000
backend_config['HLSConfig']['LayerName']['conv2d_1_m']['ReuseFactor'] = 11520
backend_config['HLSConfig']['LayerName']['dense']['ReuseFactor'] = 4608


for layer in backend_config['HLSConfig']['LayerName']:
    backend_config['HLSConfig']['LayerName'][layer]['Trace'] = True

if SAFE_CONFIG:
    yaml_save(config=backend_config, filepath=config_dir)

backend_config['KerasModel'] = model

print_dict(backend_config)
hls_model = hls4ml.converters.keras_to_hls(backend_config)
_ = hls_model.compile()


TEST_CASES = 1000


hls4ml.utils.plot_model(hls_model, show_shapes=True,
                        show_precision=True, to_file=picture_dir)

y_model = model.predict(x_test[0:TEST_CASES])
y_hls = hls_model.predict(x_test[0:TEST_CASES])
acc_qkeras = accuracy_score(np.argmax(y_test[0:TEST_CASES], axis=1), np.argmax(y_model, axis=1))
acc_hls4ml = accuracy_score(np.argmax(y_test[0:TEST_CASES], axis=1), np.argmax(y_hls, axis=1))
rel_diff = abs(acc_qkeras - acc_hls4ml) / acc_qkeras
print('\n')
print('Accuracy qkeras:     {}'.format(acc_qkeras))
print('Accuracy hls4ml:     {}'.format(acc_hls4ml))
print('Relative difference: {}'.format(rel_diff))

hls_model.build()
hls4ml.report.read_vivado_report(output_dir)

@thesps
Copy link
Contributor

thesps commented Nov 12, 2021

I think this is the key difference:
config['IOType'] = 'io_stream' in the working one
backend_config['IOType'] = 'io_parallel' in the not working one.

Try switching to io_stream.

It also looks like you are trying to target a pynq-z2, is that correct?

If so, you would need to change: backend_config['Backend'] = 'Vivado' -> backend_config['Backend'] = 'VivadoAccelerator'
And I would suggest backend_config['Interface'] = 'm_axi' -> backend_config['Interface'] = 'axi_stream'

@HenningCode
Copy link
Author

HenningCode commented Nov 12, 2021

Yes I am trying to target a pynq-z2

If I just change to io_stream it doenst take ages for the Unrolling loop but still fails, with this Error:

ERROR: [XFORM 203-711] Internal stream 'layer14_cpy1.V.data[0].V' failed dataflow checking: it must be produced and consumed exactly once.

I am also getting a ton of these warnings after writing the HLS Project is done, but before my predictions.
WARNING: Hls::stream 'layer14_cpy1' contains leftover data, which may result in RTL simulation hanging.

If I change to the backend to VivadoAccelerator it fails with compilation errors, because some template arguments are wrong.

In file included from ../../../../MyProject_test.cpp:29:0:
../../../../firmware/nnet_utils/nnet_helpers.h:304:6: Anmerkung: candidate: template<class src_T, class dst_T, long unsigned int OFFSET, long unsigned int SIZE> void nnet::copy_data_axi(std::vector<_Tp>, dst_T*)
 void copy_data_axi(std::vector<src_T> src, dst_T dst[SIZE]) {
      ^~~~~~~~~~~~~
../../../../firmware/nnet_utils/nnet_helpers.h:304:6: Anmerkung:   Herleitung/Ersetzung von Templateargument gescheitert:
../../../../MyProject_test.cpp:80:63: Fehler: Templateargument 2 ist ungültig
       nnet::copy_data_axi<float, inputs_t, 0, N_IN>(in, inputs);
                                                                                               ^

If I only change io_stream and axi_stream its the same as with only io_stream changed.

Edit: I can change to VivadoAccelerator backend with example model

@HenningCode
Copy link
Author

I tested some more and this model somehow worked.

def create_QConv2(input_shape,output_shape):  
        model = Sequential()
        model.add(QConv2D(16,kernel_quantizer=quantized_bits(5, 0, alpha=1),
               bias_quantizer=quantized_bits(5, 0, alpha=1), kernel_size=(3, 3),
                        activation='relu',
                        input_shape=input_shape))
        model.add(QConv2D(16, (3, 3),kernel_quantizer=quantized_bits(5, 0, alpha=1),
               bias_quantizer=quantized_bits(5, 0, alpha=1), activation='relu'))
        model.add(MaxPooling2D(pool_size=(2, 2)))
        model.add(Flatten())
        model.add(QDense(128, kernel_quantizer=quantized_bits(5, 0, alpha=1),
               bias_quantizer=quantized_bits(5, 0, alpha=1),activation='relu'))
        model.add(QDense(output_shape, kernel_quantizer=quantized_bits(5, 0, alpha=1),
               bias_quantizer=quantized_bits(5, 0, alpha=1),activation='softmax'))

        model.summary()
        return model

So it seems that there are still issues with activation functions?

@jmduarte
Copy link
Member

Hi @HenningCode,

I think the only problem is one of your layers is named input, which is a reserved name in HLSModel. I've opened a PR to raise a runtime error when this is detected

Here's a version of your script that works (basically just renaming your layer input1: https://gist.github.com/jmduarte/c211ca7d8e43b5b4e11328e97fc20dde

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants