# HLS synthesis fails due to error: too many template arguments for class template 'stream'

**URL:** <https://discuss.pynq.io/t/hls-synthesis-fails-due-to-error-too-many-template-arguments-for-class-template-stream/1496>\
**Category:** Support\
**Created:** [July 15, 2020, 1:21pm UTC](https://discuss.pynq.io/t/hls-synthesis-fails-due-to-error-too-many-template-arguments-for-class-template-stream/1496 "2020-07-15T13:21:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Noah\_Keller](https://avatars.discourse-cdn.com/v4/letter/n/9de0a6/32.png) [@Noah\_Keller](https://discuss.pynq.io/u/Noah_Keller)\
**Post date:** [July 15, 2020, 1:21pm UTC](https://discuss.pynq.io/t/hls-synthesis-fails-due-to-error-too-many-template-arguments-for-class-template-stream/1496/1 "2020-07-15T13:21:14Z")

</div>

I am currently learning how to use the HLS Design flow works. For that I’ve followed the provided example from this GitHub Page: [https://github.com/Xilinx/PYNQ-HelloWorld/tree/master/boards/ip/hls](https://github.com/Xilinx/PYNQ-HelloWorld/tree/master/boards/ip/hls)

But during the synthesis I bump into this error.

```auto
in file included from ../vitis_lib/vision/L1/include/common/xf_common.hpp:20:
../vitis_lib/vision/L1/include/common/xf_structs.hpp:436:10: error: too many template arguments for class template 'stream'
    hls::stream<DATATYPE, XFCVDEPTH> data;

```

My best guess is that I probably miss some packages that I need during the synthesis.  
I really want to understand it but I don’t have any experience with HLS or C++.  
I’ve tried to rebuild the IP in an Ubuntu 16.04.6 VM and Vivado 2019.2 and tried to build it in Windows 10 Vivado 2019.2. Both failed with the same error.

I already posted the question on [GitHub](https://github.com/Xilinx/PYNQ-HelloWorld/issues/17) and on the [Xilinx Forum](https://forums.xilinx.com/t5/High-Level-Synthesis-HLS/Vivado-HLS-compilation-error-when-trying-to-rebuild-an-IP-from/m-p/1127149) but unfortunately didn’t get an answer. I hope this question is not too stupid… 😕

Thank you very much in advance! 😌

[C\_Synthesis.log](https://discuss.pynq.io/uploads/short-url/iAaORgGRbG1g6GEskEGmxx8Q4Re.log) (5.8 KB)  
[resize\_accel\_csim.log](https://discuss.pynq.io/uploads/short-url/nBLhzZu2ppdws3FaZsMzplyt5sO.log) (13.3 KB)

---

<div class="post-metadata">

**Author:** ![rock](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/rock/32/32_2.png) [@rock](https://discuss.pynq.io/u/rock)\
**Post date:** [July 15, 2020, 5:17pm UTC](https://discuss.pynq.io/t/hls-synthesis-fails-due-to-error-too-many-template-arguments-for-class-template-stream/1496/2 "2020-07-15T17:17:40Z")

</div>

I need to know what exactly you did. Did you just go to `resize` folder and run `make`? I think I have tested that and it worked fine.

---

<div class="post-metadata">

**Author:** ![Noah\_Keller](https://avatars.discourse-cdn.com/v4/letter/n/9de0a6/32.png) [@Noah\_Keller](https://discuss.pynq.io/u/Noah_Keller)\
**Post date:** [July 15, 2020, 6:54pm UTC](https://discuss.pynq.io/t/hls-synthesis-fails-due-to-error-too-many-template-arguments-for-class-template-stream/1496/3 "2020-07-15T18:54:00Z")

</div>

Hey @rock thank you very much answering me! 😌  
I am sorry that I didn’t make msyself clearer. 😔

And yes I’ve just run the `make` command. I’ve also cloned the Vitis Libraries Repository and named it “vitis\_lib”. In the Vitis Libraries Repository I’ve also checked if they had done changes on the code that might causes the error, but the last change was 9 months ago. So I think that couldn’t cause the error.

I saw in the make file that it calls the Vivado HLS. It is my first time using HLS, so I didn’t configure anything or installed additional packages.

Do you need to install some packages or need to run a certain setup before using Vivado HLS?  
Or any other clue what I might doing wrong?

Thank you very much for helping me!!

---

<div class="post-metadata">

**Author:** ![rock](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/rock/32/32_2.png) [@rock](https://discuss.pynq.io/u/rock)\
**Post date:** [July 15, 2020, 7:06pm UTC](https://discuss.pynq.io/t/hls-synthesis-fails-due-to-error-too-many-template-arguments-for-class-template-stream/1496/4 "2020-07-15T19:06:59Z")

</div>

I think you should just do:

```auto
git clone --recursive https://github.com/Xilinx/PYNQ-HelloWorld.git

```

Then the IP is ready to be built inside `boards/ip/hls/resize`. Run `make` there.

---

<div class="post-metadata">

**Author:** ![Noah\_Keller](https://avatars.discourse-cdn.com/v4/letter/n/9de0a6/32.png) [@Noah\_Keller](https://discuss.pynq.io/u/Noah_Keller)\
**Post date:** [July 15, 2020, 7:38pm UTC](https://discuss.pynq.io/t/hls-synthesis-fails-due-to-error-too-many-template-arguments-for-class-template-stream/1496/5 "2020-07-15T19:38:31Z")

</div>

It workd @rock 😍 😍 😍  
You are really awesome 😱

I am soo thankful. I struggled soo much and searched for quite a long time to figure out a solution. 😭

I would have never imagened that manually cloning the Vitis Libraries Repository and name it manually “vitis\_lib” would through such a weird error.  
And I also didn’t know that `git clone --recursive` would also clone the linked repositorys!

I hope this post is also relevant for other people who want to try to rebuild the resize ip 😌

Just for my own curiosity:  
Do you have any idea, why this strange error occured? Because even if I manually git clone the vitis libraries repository why should it throw such a weird error in the HLS synthesis?

---

<div class="post-metadata">

**Author:** ![dimiter](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dimiter](https://discuss.pynq.io/u/dimiter)\
**Post date:** [November 10, 2020, 5:59pm UTC](https://discuss.pynq.io/t/hls-synthesis-fails-due-to-error-too-many-template-arguments-for-class-template-stream/1496/6 "2020-11-10T17:59:44Z")

</div>

Repeating the exact same procedure as of Nov 10 2020 on Ubuntu 18.04, Vivado 2020.1,

```auto
git clone --recursive https://github.com/Xilinx/PYNQ-HelloWorld.git
cd PYNQ-HelloWorld/boards/ip/hls/resize
make

```

fails with the following:

```
ERROR: [HLS 200-70] Compilation errors found: In file included from xf_resize_accel.cpp:1:
xf_resize_accel.cpp:34:4: error: use of undeclared identifier 'xf'
   xf::cv::Mat<TYPE, HEIGHT, WIDTH, NPC_T> &_src,
   ^
xf_resize_accel.cpp:34:15: error: expected ')'
   xf::cv::Mat<TYPE, HEIGHT, WIDTH, NPC_T> &_src,
              ^
xf_resize_accel.cpp:33:17: note: to match this '('
void axis2xfMat (axis_t *src,
                ^
xf_resize_accel.cpp:38:18: error: use of undeclared identifier 'src_rows'
 for (int i=0; i<src_rows; i++) {
                 ^
xf_resize_accel.cpp:39:19: error: use of undeclared identifier 'src_cols'
  for (int j=0; j<src_cols; j++) {
                  ^
xf_resize_accel.cpp:42:2: error: use of undeclared identifier '_src'; did you mean 'src'?
 _src.data[i*src_cols+j] = src[i*src_cols+j].data;
 ^~~~
 src
xf_resize_accel.cpp:33:26: note: 'src' declared here
void axis2xfMat (axis_t *src,
                         ^
xf_resize_accel.cpp:42:6: error: member reference type 'axis_t *' is a pointer; maybe you meant to use '->'?
 _src.data[i*src_cols+j] = src[i*src_cols+j].data;
 ~~~~ ^
     ->
xf_resize_accel.cpp:42:14: error: use of undeclared identifier 'src_cols'
 _src.data[i*src_cols+j] = src[i*src_cols+j].data;
             ^
xf_resize_accel.cpp:42:34: error: use of undeclared identifier 'src_cols'
 _src.data[i*src_cols+j] = src[i*src_cols+j].data;
                                 ^
xf_resize_accel.cpp:48:18: error: use of undeclared identifier 'xf'
void xfMat2axis (xf::cv::Mat<TYPE, NEWHEIGHT, NEWWIDTH, NPC_T> &_dst,
                 ^
xf_resize_accel.cpp:48:6: error: variable has incomplete type 'void'
void xfMat2axis (xf::cv::Mat<TYPE, NEWHEIGHT, NEWWIDTH, NPC_T> &_dst,
     ^
xf_resize_accel.cpp:48:30: error: use of undeclared identifier 'TYPE'
void xfMat2axis (xf::cv::Mat<TYPE, NEWHEIGHT, NEWWIDTH, NPC_T> &_dst,
                             ^
xf_resize_accel.cpp:50:31: error: expected ';' after top level declarator
   int dst_rows, int dst_cols) {
                              ^
                              ;
12 errors generated.
Failed during preprocessing.
    while executing
"source script.tcl"
    ("uplevel" body line 1)
    invoked from within
"uplevel \#0 [list source $arg] "

INFO: [Common 17-206] Exiting vivado_hls at Tue Nov 10 12:57:25 2020...

```

---

<div class="post-metadata">

**Author:** ![rock](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/rock/32/32_2.png) [@rock](https://discuss.pynq.io/u/rock)\
**Post date:** [November 10, 2020, 6:25pm UTC](https://discuss.pynq.io/t/hls-synthesis-fails-due-to-error-too-many-template-arguments-for-class-template-stream/1496/7 "2020-11-10T18:25:52Z")

</div>

That should be 2019.2. I have not adjusted the flow based on 2020.1 yet.
