Skip to content

io_stream implementation of concatenate 1d and 2d #541

Closed
@lgrothh

Description

@lgrothh

Hello, when trying to convert a CNN model (Conv1D) set to io_type=io_stream that is also using concatenate to concatenate the outputs of two Dense Layers, I get the Following message from Vivado:

The Message
[...]

Writing HLS project
Done
firmware/myproject.cpp: In function ‘void myproject(hls::stream<nnet::array<ap_fixed<16, 6>, 2> >&, hls::stream<nnet::array<ap_fixed<16, 6>, 22> >&, short unsigned int&, short unsigned int&)’:
firmware/myproject.cpp:980:72: error: cannot convert ‘hls::stream<nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 128> >’ to ‘nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 128>*’
  980 |     nnet::concatenate1d<layer150_t, layer152_t, layer153_t, config153>(layer150_out, layer152_out, layer153_out); // concatenate_5
      |                                                                        ^~~~~~~~~~~~
      |                                                                        |
      |                                                                        hls::stream<nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 128> >
In file included from firmware/parameters.h:18,
                 from firmware/myproject.cpp:22:
firmware/nnet_utils/nnet_merge.h:154:14: note:   initializing argument 1 of ‘void nnet::concatenate1d(input1_T*, input2_T*, res_T*) [with input1_T = nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 128>; input2_T = nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 128>; res_T = nnet::array<ap_fixed<16, 6>, 256>; CONFIG_T = config153]’
  154 |     input1_T data1[CONFIG_T::n_elem1_0],
      |     ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
firmware/myproject.cpp:1036:72: error: cannot convert ‘hls::stream<nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16> >’ to ‘nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16>*’
 1036 |     nnet::concatenate1d<layer157_t, layer159_t, layer168_t, config168>(layer157_out, layer159_out, layer168_out); // concatenate_6
      |                                                                        ^~~~~~~~~~~~
      |                                                                        |
      |                                                                        hls::stream<nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16> >
In file included from firmware/parameters.h:18,
                 from firmware/myproject.cpp:22:
firmware/nnet_utils/nnet_merge.h:154:14: note:   initializing argument 1 of ‘void nnet::concatenate1d(input1_T*, input2_T*, res_T*) [with input1_T = nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16>; input2_T = nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16>; res_T = nnet::array<ap_fixed<16, 6>, 32>; CONFIG_T = config168]’
  154 |     input1_T data1[CONFIG_T::n_elem1_0],
      |     ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
firmware/myproject.cpp:1040:72: error: cannot convert ‘hls::stream<nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16> >’ to ‘nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16>*’
 1040 |     nnet::concatenate1d<layer161_t, layer163_t, layer169_t, config169>(layer161_out, layer163_out, layer169_out); // concatenate_7
      |                                                                        ^~~~~~~~~~~~
      |                                                                        |
      |                                                                        hls::stream<nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16> >
In file included from firmware/parameters.h:18,
                 from firmware/myproject.cpp:22:
firmware/nnet_utils/nnet_merge.h:154:14: note:   initializing argument 1 of ‘void nnet::concatenate1d(input1_T*, input2_T*, res_T*) [with input1_T = nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16>; input2_T = nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16>; res_T = nnet::array<ap_fixed<16, 6>, 32>; CONFIG_T = config169]’
  154 |     input1_T data1[CONFIG_T::n_elem1_0],
      |     ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
firmware/myproject.cpp:1044:72: error: cannot convert ‘hls::stream<nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16> >’ to ‘nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16>*’
 1044 |     nnet::concatenate1d<layer165_t, layer167_t, layer170_t, config170>(layer165_out, layer167_out, layer170_out); // concatenate_8
      |                                                                        ^~~~~~~~~~~~
      |                                                                        |
      |                                                                        hls::stream<nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16> >
In file included from firmware/parameters.h:18,
                 from firmware/myproject.cpp:22:
firmware/nnet_utils/nnet_merge.h:154:14: note:   initializing argument 1 of ‘void nnet::concatenate1d(input1_T*, input2_T*, res_T*) [with input1_T = nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16>; input2_T = nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16>; res_T = nnet::array<ap_fixed<16, 6>, 32>; CONFIG_T = config170]’
  154 |     input1_T data1[CONFIG_T::n_elem1_0],
      |     ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
firmware/myproject.cpp:1056:72: error: cannot convert ‘hls::stream<nnet::array<ap_fixed<16, 6>, 32> >’ to ‘nnet::array<ap_fixed<16, 6>, 32>*’
 1056 |     nnet::concatenate1d<layer168_t, layer169_t, layer173_t, config173>(layer168_out, layer169_out, layer173_out); // concatenate_10
      |                                                                        ^~~~~~~~~~~~
      |                                                                        |
      |                                                                        hls::stream<nnet::array<ap_fixed<16, 6>, 32> >
In file included from firmware/parameters.h:18,
                 from firmware/myproject.cpp:22:
firmware/nnet_utils/nnet_merge.h:154:14: note:   initializing argument 1 of ‘void nnet::concatenate1d(input1_T*, input2_T*, res_T*) [with input1_T = nnet::array<ap_fixed<16, 6>, 32>; input2_T = nnet::array<ap_fixed<16, 6>, 32>; res_T = nnet::array<ap_fixed<16, 6>, 64>; CONFIG_T = config173]’
  154 |     input1_T data1[CONFIG_T::n_elem1_0],
      |     ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
firmware/myproject.cpp:1060:72: error: cannot convert ‘hls::stream<nnet::array<ap_fixed<16, 6>, 32> >’ to ‘nnet::array<ap_fixed<16, 6>, 32>*’
 1060 |     nnet::concatenate1d<layer170_t, layer172_t, layer174_t, config174>(layer170_out, layer172_out, layer174_out); // concatenate_11
      |                                                                        ^~~~~~~~~~~~
      |                                                                        |
      |                                                                        hls::stream<nnet::array<ap_fixed<16, 6>, 32> >
In file included from firmware/parameters.h:18,
                 from firmware/myproject.cpp:22:
firmware/nnet_utils/nnet_merge.h:154:14: note:   initializing argument 1 of ‘void nnet::concatenate1d(input1_T*, input2_T*, res_T*) [with input1_T = nnet::array<ap_fixed<16, 6>, 32>; input2_T = nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16>; res_T = nnet::array<ap_fixed<16, 6>, 48>; CONFIG_T = config174]’
  154 |     input1_T data1[CONFIG_T::n_elem1_0],
      |     ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
firmware/myproject.cpp:1064:72: error: cannot convert ‘hls::stream<nnet::array<ap_fixed<16, 6>, 64> >’ to ‘nnet::array<ap_fixed<16, 6>, 64>*’
 1064 |     nnet::concatenate1d<layer173_t, layer174_t, layer175_t, config175>(layer173_out, layer174_out, layer175_out); // concatenate_12
      |                                                                        ^~~~~~~~~~~~
      |                                                                        |
      |                                                                        hls::stream<nnet::array<ap_fixed<16, 6>, 64> >
In file included from firmware/parameters.h:18,
                 from firmware/myproject.cpp:22:
firmware/nnet_utils/nnet_merge.h:154:14: note:   initializing argument 1 of ‘void nnet::concatenate1d(input1_T*, input2_T*, res_T*) [with input1_T = nnet::array<ap_fixed<16, 6>, 64>; input2_T = nnet::array<ap_fixed<16, 6>, 48>; res_T = nnet::array<ap_fixed<16, 6>, 112>; CONFIG_T = config175]’
  154 |     input1_T data1[CONFIG_T::n_elem1_0],
      |     ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
firmware/nnet_utils/nnet_merge.h: In instantiation of ‘void nnet::concatenate1d(input1_T*, input2_T*, res_T*) [with input1_T = nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 128>; input2_T = nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 128>; res_T = nnet::array<ap_fixed<16, 6>, 256>; CONFIG_T = config153]’:
firmware/myproject.cpp:980:112:   required from here
firmware/nnet_utils/nnet_merge.h:159:17: error: no match for ‘operator=’ (operand types are ‘nnet::array<ap_fixed<16, 6>, 256>’ and ‘nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 128>’)
  159 |         res[ii] = data1[ii];
      |         ~~~~~~~~^~~~~~~~
In file included from firmware/defines.h:6,
                 from firmware/myproject.h:27,
                 from firmware/myproject.cpp:21:
firmware/nnet_utils/nnet_types.h:26:12: note: candidate: ‘nnet::array<T, N>& nnet::array<T, N>::operator=(const nnet::array<T, N>&) [with T = ap_fixed<16, 6>; unsigned int N = 256]’
   26 |     array& operator=(const array &other) {
      |            ^~~~~~~~
firmware/nnet_utils/nnet_types.h:26:35: note:   no known conversion for argument 1 from ‘nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 128>’ to ‘const nnet::array<ap_fixed<16, 6>, 256>&’
   26 |     array& operator=(const array &other) {
      |                      ~~~~~~~~~~~~~^~~~~
In file included from firmware/parameters.h:18,
                 from firmware/myproject.cpp:22:
firmware/nnet_utils/nnet_merge.h:162:39: error: no match for ‘operator=’ (operand types are ‘nnet::array<ap_fixed<16, 6>, 256>’ and ‘nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 128>’)
  162 |         res[CONFIG_T::n_elem1_0 + ii] = data2[ii];
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
In file included from firmware/defines.h:6,
                 from firmware/myproject.h:27,
                 from firmware/myproject.cpp:21:
firmware/nnet_utils/nnet_types.h:26:12: note: candidate: ‘nnet::array<T, N>& nnet::array<T, N>::operator=(const nnet::array<T, N>&) [with T = ap_fixed<16, 6>; unsigned int N = 256]’
   26 |     array& operator=(const array &other) {
      |            ^~~~~~~~
firmware/nnet_utils/nnet_types.h:26:35: note:   no known conversion for argument 1 from ‘nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 128>’ to ‘const nnet::array<ap_fixed<16, 6>, 256>&’
   26 |     array& operator=(const array &other) {
      |                      ~~~~~~~~~~~~~^~~~~
In file included from firmware/parameters.h:18,
                 from firmware/myproject.cpp:22:
firmware/nnet_utils/nnet_merge.h: In instantiation of ‘void nnet::concatenate1d(input1_T*, input2_T*, res_T*) [with input1_T = nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16>; input2_T = nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16>; res_T = nnet::array<ap_fixed<16, 6>, 32>; CONFIG_T = config168]’:
firmware/myproject.cpp:1036:112:   required from here
firmware/nnet_utils/nnet_merge.h:159:17: error: no match for ‘operator=’ (operand types are ‘nnet::array<ap_fixed<16, 6>, 32>’ and ‘nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16>’)
  159 |         res[ii] = data1[ii];
      |         ~~~~~~~~^~~~~~~~
In file included from firmware/defines.h:6,
                 from firmware/myproject.h:27,
                 from firmware/myproject.cpp:21:
firmware/nnet_utils/nnet_types.h:26:12: note: candidate: ‘nnet::array<T, N>& nnet::array<T, N>::operator=(const nnet::array<T, N>&) [with T = ap_fixed<16, 6>; unsigned int N = 32]’
   26 |     array& operator=(const array &other) {
      |            ^~~~~~~~
firmware/nnet_utils/nnet_types.h:26:35: note:   no known conversion for argument 1 from ‘nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16>’ to ‘const nnet::array<ap_fixed<16, 6>, 32>&’
   26 |     array& operator=(const array &other) {
      |                      ~~~~~~~~~~~~~^~~~~
In file included from firmware/parameters.h:18,
                 from firmware/myproject.cpp:22:
firmware/nnet_utils/nnet_merge.h:162:39: error: no match for ‘operator=’ (operand types are ‘nnet::array<ap_fixed<16, 6>, 32>’ and ‘nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16>’)
  162 |         res[CONFIG_T::n_elem1_0 + ii] = data2[ii];
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
In file included from firmware/defines.h:6,
                 from firmware/myproject.h:27,
                 from firmware/myproject.cpp:21:
firmware/nnet_utils/nnet_types.h:26:12: note: candidate: ‘nnet::array<T, N>& nnet::array<T, N>::operator=(const nnet::array<T, N>&) [with T = ap_fixed<16, 6>; unsigned int N = 32]’
   26 |     array& operator=(const array &other) {
      |            ^~~~~~~~
firmware/nnet_utils/nnet_types.h:26:35: note:   no known conversion for argument 1 from ‘nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16>’ to ‘const nnet::array<ap_fixed<16, 6>, 32>&’
   26 |     array& operator=(const array &other) {
      |                      ~~~~~~~~~~~~~^~~~~
In file included from firmware/parameters.h:18,
                 from firmware/myproject.cpp:22:
firmware/nnet_utils/nnet_merge.h: In instantiation of ‘void nnet::concatenate1d(input1_T*, input2_T*, res_T*) [with input1_T = nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16>; input2_T = nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16>; res_T = nnet::array<ap_fixed<16, 6>, 32>; CONFIG_T = config169]’:
firmware/myproject.cpp:1040:112:   required from here
firmware/nnet_utils/nnet_merge.h:159:17: error: no match for ‘operator=’ (operand types are ‘nnet::array<ap_fixed<16, 6>, 32>’ and ‘nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16>’)
  159 |         res[ii] = data1[ii];
      |         ~~~~~~~~^~~~~~~~
In file included from firmware/defines.h:6,
                 from firmware/myproject.h:27,
                 from firmware/myproject.cpp:21:
firmware/nnet_utils/nnet_types.h:26:12: note: candidate: ‘nnet::array<T, N>& nnet::array<T, N>::operator=(const nnet::array<T, N>&) [with T = ap_fixed<16, 6>; unsigned int N = 32]’
   26 |     array& operator=(const array &other) {
      |            ^~~~~~~~
firmware/nnet_utils/nnet_types.h:26:35: note:   no known conversion for argument 1 from ‘nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16>’ to ‘const nnet::array<ap_fixed<16, 6>, 32>&’
   26 |     array& operator=(const array &other) {
      |                      ~~~~~~~~~~~~~^~~~~
In file included from firmware/parameters.h:18,
                 from firmware/myproject.cpp:22:
firmware/nnet_utils/nnet_merge.h:162:39: error: no match for ‘operator=’ (operand types are ‘nnet::array<ap_fixed<16, 6>, 32>’ and ‘nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16>’)
  162 |         res[CONFIG_T::n_elem1_0 + ii] = data2[ii];
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
In file included from firmware/defines.h:6,
                 from firmware/myproject.h:27,
                 from firmware/myproject.cpp:21:
firmware/nnet_utils/nnet_types.h:26:12: note: candidate: ‘nnet::array<T, N>& nnet::array<T, N>::operator=(const nnet::array<T, N>&) [with T = ap_fixed<16, 6>; unsigned int N = 32]’
   26 |     array& operator=(const array &other) {
      |            ^~~~~~~~
firmware/nnet_utils/nnet_types.h:26:35: note:   no known conversion for argument 1 from ‘nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16>’ to ‘const nnet::array<ap_fixed<16, 6>, 32>&’
   26 |     array& operator=(const array &other) {
      |                      ~~~~~~~~~~~~~^~~~~
In file included from firmware/parameters.h:18,
                 from firmware/myproject.cpp:22:
firmware/nnet_utils/nnet_merge.h: In instantiation of ‘void nnet::concatenate1d(input1_T*, input2_T*, res_T*) [with input1_T = nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16>; input2_T = nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16>; res_T = nnet::array<ap_fixed<16, 6>, 32>; CONFIG_T = config170]’:
firmware/myproject.cpp:1044:112:   required from here
firmware/nnet_utils/nnet_merge.h:159:17: error: no match for ‘operator=’ (operand types are ‘nnet::array<ap_fixed<16, 6>, 32>’ and ‘nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16>’)
  159 |         res[ii] = data1[ii];
      |         ~~~~~~~~^~~~~~~~
In file included from firmware/defines.h:6,
                 from firmware/myproject.h:27,
                 from firmware/myproject.cpp:21:
firmware/nnet_utils/nnet_types.h:26:12: note: candidate: ‘nnet::array<T, N>& nnet::array<T, N>::operator=(const nnet::array<T, N>&) [with T = ap_fixed<16, 6>; unsigned int N = 32]’
   26 |     array& operator=(const array &other) {
      |            ^~~~~~~~
firmware/nnet_utils/nnet_types.h:26:35: note:   no known conversion for argument 1 from ‘nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16>’ to ‘const nnet::array<ap_fixed<16, 6>, 32>&’
   26 |     array& operator=(const array &other) {
      |                      ~~~~~~~~~~~~~^~~~~
In file included from firmware/parameters.h:18,
                 from firmware/myproject.cpp:22:
firmware/nnet_utils/nnet_merge.h:162:39: error: no match for ‘operator=’ (operand types are ‘nnet::array<ap_fixed<16, 6>, 32>’ and ‘nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16>’)
  162 |         res[CONFIG_T::n_elem1_0 + ii] = data2[ii];
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
In file included from firmware/defines.h:6,
                 from firmware/myproject.h:27,
                 from firmware/myproject.cpp:21:
firmware/nnet_utils/nnet_types.h:26:12: note: candidate: ‘nnet::array<T, N>& nnet::array<T, N>::operator=(const nnet::array<T, N>&) [with T = ap_fixed<16, 6>; unsigned int N = 32]’
   26 |     array& operator=(const array &other) {
      |            ^~~~~~~~
firmware/nnet_utils/nnet_types.h:26:35: note:   no known conversion for argument 1 from ‘nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16>’ to ‘const nnet::array<ap_fixed<16, 6>, 32>&’
   26 |     array& operator=(const array &other) {
      |                      ~~~~~~~~~~~~~^~~~~
In file included from firmware/parameters.h:18,
                 from firmware/myproject.cpp:22:
firmware/nnet_utils/nnet_merge.h: In instantiation of ‘void nnet::concatenate1d(input1_T*, input2_T*, res_T*) [with input1_T = nnet::array<ap_fixed<16, 6>, 32>; input2_T = nnet::array<ap_fixed<16, 6>, 32>; res_T = nnet::array<ap_fixed<16, 6>, 64>; CONFIG_T = config173]’:
firmware/myproject.cpp:1056:112:   required from here
firmware/nnet_utils/nnet_merge.h:159:17: error: no match for ‘operator=’ (operand types are ‘nnet::array<ap_fixed<16, 6>, 64>’ and ‘nnet::array<ap_fixed<16, 6>, 32>’)
  159 |         res[ii] = data1[ii];
      |         ~~~~~~~~^~~~~~~~
In file included from firmware/defines.h:6,
                 from firmware/myproject.h:27,
                 from firmware/myproject.cpp:21:
firmware/nnet_utils/nnet_types.h:26:12: note: candidate: ‘nnet::array<T, N>& nnet::array<T, N>::operator=(const nnet::array<T, N>&) [with T = ap_fixed<16, 6>; unsigned int N = 64]’
   26 |     array& operator=(const array &other) {
      |            ^~~~~~~~
firmware/nnet_utils/nnet_types.h:26:35: note:   no known conversion for argument 1 from ‘nnet::array<ap_fixed<16, 6>, 32>’ to ‘const nnet::array<ap_fixed<16, 6>, 64>&’
   26 |     array& operator=(const array &other) {
      |                      ~~~~~~~~~~~~~^~~~~
In file included from firmware/parameters.h:18,
                 from firmware/myproject.cpp:22:
firmware/nnet_utils/nnet_merge.h:162:39: error: no match for ‘operator=’ (operand types are ‘nnet::array<ap_fixed<16, 6>, 64>’ and ‘nnet::array<ap_fixed<16, 6>, 32>’)
  162 |         res[CONFIG_T::n_elem1_0 + ii] = data2[ii];
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
In file included from firmware/defines.h:6,
                 from firmware/myproject.h:27,
                 from firmware/myproject.cpp:21:
firmware/nnet_utils/nnet_types.h:26:12: note: candidate: ‘nnet::array<T, N>& nnet::array<T, N>::operator=(const nnet::array<T, N>&) [with T = ap_fixed<16, 6>; unsigned int N = 64]’
   26 |     array& operator=(const array &other) {
      |            ^~~~~~~~
firmware/nnet_utils/nnet_types.h:26:35: note:   no known conversion for argument 1 from ‘nnet::array<ap_fixed<16, 6>, 32>’ to ‘const nnet::array<ap_fixed<16, 6>, 64>&’
   26 |     array& operator=(const array &other) {
      |                      ~~~~~~~~~~~~~^~~~~
In file included from firmware/parameters.h:18,
                 from firmware/myproject.cpp:22:
firmware/nnet_utils/nnet_merge.h: In instantiation of ‘void nnet::concatenate1d(input1_T*, input2_T*, res_T*) [with input1_T = nnet::array<ap_fixed<16, 6>, 32>; input2_T = nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16>; res_T = nnet::array<ap_fixed<16, 6>, 48>; CONFIG_T = config174]’:
firmware/myproject.cpp:1060:112:   required from here
firmware/nnet_utils/nnet_merge.h:159:17: error: no match for ‘operator=’ (operand types are ‘nnet::array<ap_fixed<16, 6>, 48>’ and ‘nnet::array<ap_fixed<16, 6>, 32>’)
  159 |         res[ii] = data1[ii];
      |         ~~~~~~~~^~~~~~~~
In file included from firmware/defines.h:6,
                 from firmware/myproject.h:27,
                 from firmware/myproject.cpp:21:
firmware/nnet_utils/nnet_types.h:26:12: note: candidate: ‘nnet::array<T, N>& nnet::array<T, N>::operator=(const nnet::array<T, N>&) [with T = ap_fixed<16, 6>; unsigned int N = 48]’
   26 |     array& operator=(const array &other) {
      |            ^~~~~~~~
firmware/nnet_utils/nnet_types.h:26:35: note:   no known conversion for argument 1 from ‘nnet::array<ap_fixed<16, 6>, 32>’ to ‘const nnet::array<ap_fixed<16, 6>, 48>&’
   26 |     array& operator=(const array &other) {
      |                      ~~~~~~~~~~~~~^~~~~
In file included from firmware/parameters.h:18,
                 from firmware/myproject.cpp:22:
firmware/nnet_utils/nnet_merge.h:162:39: error: no match for ‘operator=’ (operand types are ‘nnet::array<ap_fixed<16, 6>, 48>’ and ‘nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16>’)
  162 |         res[CONFIG_T::n_elem1_0 + ii] = data2[ii];
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
In file included from firmware/defines.h:6,
                 from firmware/myproject.h:27,
                 from firmware/myproject.cpp:21:
firmware/nnet_utils/nnet_types.h:26:12: note: candidate: ‘nnet::array<T, N>& nnet::array<T, N>::operator=(const nnet::array<T, N>&) [with T = ap_fixed<16, 6>; unsigned int N = 48]’
   26 |     array& operator=(const array &other) {
      |            ^~~~~~~~
firmware/nnet_utils/nnet_types.h:26:35: note:   no known conversion for argument 1 from ‘nnet::array<ap_fixed<16, 6, AP_RND, AP_SAT>, 16>’ to ‘const nnet::array<ap_fixed<16, 6>, 48>&’
   26 |     array& operator=(const array &other) {
      |                      ~~~~~~~~~~~~~^~~~~
In file included from firmware/parameters.h:18,
                 from firmware/myproject.cpp:22:
firmware/nnet_utils/nnet_merge.h: In instantiation of ‘void nnet::concatenate1d(input1_T*, input2_T*, res_T*) [with input1_T = nnet::array<ap_fixed<16, 6>, 64>; input2_T = nnet::array<ap_fixed<16, 6>, 48>; res_T = nnet::array<ap_fixed<16, 6>, 112>; CONFIG_T = config175]’:
firmware/myproject.cpp:1064:112:   required from here
firmware/nnet_utils/nnet_merge.h:159:17: error: no match for ‘operator=’ (operand types are ‘nnet::array<ap_fixed<16, 6>, 112>’ and ‘nnet::array<ap_fixed<16, 6>, 64>’)
  159 |         res[ii] = data1[ii];
      |         ~~~~~~~~^~~~~~~~
In file included from firmware/defines.h:6,
                 from firmware/myproject.h:27,
                 from firmware/myproject.cpp:21:
firmware/nnet_utils/nnet_types.h:26:12: note: candidate: ‘nnet::array<T, N>& nnet::array<T, N>::operator=(const nnet::array<T, N>&) [with T = ap_fixed<16, 6>; unsigned int N = 112]’
   26 |     array& operator=(const array &other) {
      |            ^~~~~~~~
firmware/nnet_utils/nnet_types.h:26:35: note:   no known conversion for argument 1 from ‘nnet::array<ap_fixed<16, 6>, 64>’ to ‘const nnet::array<ap_fixed<16, 6>, 112>&’
   26 |     array& operator=(const array &other) {
      |                      ~~~~~~~~~~~~~^~~~~
In file included from firmware/parameters.h:18,
                 from firmware/myproject.cpp:22:
firmware/nnet_utils/nnet_merge.h:162:39: error: no match for ‘operator=’ (operand types are ‘nnet::array<ap_fixed<16, 6>, 112>’ and ‘nnet::array<ap_fixed<16, 6>, 48>’)
  162 |         res[CONFIG_T::n_elem1_0 + ii] = data2[ii];
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
In file included from firmware/defines.h:6,
                 from firmware/myproject.h:27,
                 from firmware/myproject.cpp:21:
firmware/nnet_utils/nnet_types.h:26:12: note: candidate: ‘nnet::array<T, N>& nnet::array<T, N>::operator=(const nnet::array<T, N>&) [with T = ap_fixed<16, 6>; unsigned int N = 112]’
   26 |     array& operator=(const array &other) {
      |            ^~~~~~~~
firmware/nnet_utils/nnet_types.h:26:35: note:   no known conversion for argument 1 from ‘nnet::array<ap_fixed<16, 6>, 48>’ to ‘const nnet::array<ap_fixed<16, 6>, 112>&’
   26 |     array& operator=(const array &other) {
      |                      ~~~~~~~~~~~~~^~~~~
g++: error: myproject.o: No such file or directory
Traceback (most recent call last):
  File "./test_model_hack.py", line 83, in <module>
    hls_model.compile()
  File "/home/lukas/.local/lib/python3.8/site-packages/hls4ml/model/hls_model.py", line 546, in compile
    self._top_function_lib = ctypes.cdll.LoadLibrary(lib_name)
  File "/usr/lib/python3.8/ctypes/__init__.py", line 451, in LoadLibrary
    return self._dlltype(name)
  File "/usr/lib/python3.8/ctypes/__init__.py", line 373, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: firmware/myproject-6384cF9c.so: cannot open shared object file: No such file or directory

I noticed that #372 implements io_stream concatenation only for 3d inputs, not 1d and 2d. Can this be added? I tried manually creating the project and added the following. Synthesis is running but I have not tested it yet:

template<class input1_T, class input2_T, class res_T, typename CONFIG_T>
void concatenate1d(
    hls::stream<input1_T> &data1,
    hls::stream<input2_T> &data2,
    hls::stream<res_T> &res)
{
    ConcatLoopHeight1: for (int i = 0; i < CONFIG_T::n_elem1_0; i++) {
            #pragma HLS PIPELINE II=1

            input1_T in_data1 = data1.read();
            res_T out_data;
            #pragma HLS DATA_PACK variable=out_data

            ConcatPackInput1: for (int k = 0; k < input1_T::size; k++) {
                #pragma HLS UNROLL
                out_data[k] = in_data1[k];
            }

            res.write(out_data);
    }
    ConcatLoopHeight2: for (int i = 0; i < CONFIG_T::n_elem2_0; i++) {
            #pragma HLS PIPELINE II=1

            input2_T in_data2 = data2.read();
            res_T out_data;
            #pragma HLS DATA_PACK variable=out_data

            ConcatPackInput2: for (int k = 0; k < input2_T::size; k++) {
                #pragma HLS UNROLL
                out_data[k] = in_data2[k];
            }

            res.write(out_data);
    }
}

I would love some help with this,
Best Regards

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions