cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Sthornington2
Visitor
Visitor
1,837 Views
Registered: ‎06-17-2020

Vivado HLS 2020.1 Cosim with C++14 features, difficulties (help!)

Hi folks.  I have Vivado HLS 2020.1 in Linux (Ubuntu) and I'm trying to synthesize and cosim some template-heavy code.  

When synthesizing, it seems as though I must use the C++ standard:

-std=c++0x

in order to compile against the header files in the gcc 4.6.3 subdirectories of the Vivado install.  However, when I want to build and run a cosim (which uses the gcc 6.20 directories), I must use the C++ standard: 

-std=c++14

I cannot synthesize the TL with c++14, and I cannot compile the cosim with c++0x, therefore, I find myself awkwardly changing the std to c++0x, synthesize, change it (in the CFLAGS) to c++14, and run a cosim (without resynthesizing like it warns me about!).  There must be a better way!  Can I run my entire synthesis/csim/cosim toolchain on gcc 6.2.0 or a clang with full c++14 support?

Thanks,

Simon.

0 Kudos
18 Replies
Sthornington2
Visitor
Visitor
1,722 Views
Registered: ‎06-17-2020

Has anyone ever run into this?

0 Kudos
adrianf00
Adventurer
Adventurer
1,639 Views
Registered: ‎06-21-2019

@Sthornington2Have you solved your problem?

I have an issue with 2 different versions of gcc as well (link) and would like to use the newer version for both: simulation and synthesis.

0 Kudos
Sthornington2
Visitor
Visitor
1,633 Views
Registered: ‎06-17-2020

No I never did. Seems to be dead silence from Xilinx, I can only hope they fix it in a patch. I see some TCL flags which refer to using clang, but I can’t get that to work in 2020 either:

0 Kudos
ramananr
Xilinx Employee
Xilinx Employee
1,598 Views
Registered: ‎08-22-2019

Hi @Sthornington2,

Please try setting -std=gnu++14 (since Vitis HLS supports the C++14 standard along with the GCC extensions). Note that this will not be necessary in the forthcoming 2020.2 version of Vitis HLS. 

0 Kudos
Sthornington2
Visitor
Visitor
1,538 Views
Registered: ‎06-17-2020

Sorry, this does not work in synthesis:

 

WARNING: [HLS 200-40] error: invalid value 'gnu++14' in '-std=gnu++14'
0 Kudos
Sthornington2
Visitor
Visitor
1,530 Views
Registered: ‎06-17-2020

Please note that I am using Vivado HLS, does that make a difference?  I could not find any information on the difference between Vivado HLS and Vitis HLS, but the RTL

0 Kudos
ramananr
Xilinx Employee
Xilinx Employee
1,512 Views
Registered: ‎08-22-2019

Yes, the -std=gnu++14 flag idea was specific to Vitis HLS and not for Vivado HLS. Vivado HLS does not support C++14 features. 

0 Kudos
Sthornington2
Visitor
Visitor
1,487 Views
Registered: ‎06-17-2020

I see. Can I convert my project over? Will it still generate Verilog that I can use outside of an “acceleration” workflow? This is to drop straight into a Vivado block diagram.

0 Kudos
ramananr
Xilinx Employee
Xilinx Employee
1,479 Views
Registered: ‎08-22-2019

Yes. There are some differences in behavior between Vitis HLS and Vivado HLS but the overall goal is still the same. Here is a link to the migration guide:

https://www.xilinx.com/support/documentation/sw_manuals/xilinx2020_1/ug1391-vitis-hls-migration-guide.pdf

 

0 Kudos
Sthornington2
Visitor
Visitor
1,437 Views
Registered: ‎06-17-2020


Ported my function to Vitis HLS and it fails synthesis with a major timing error.  I'm not even sure where to start, it's -15ns for the same code ...

0 Kudos
Sthornington2
Visitor
Visitor
1,429 Views
Registered: ‎06-17-2020

I misspoke, it didn’t fail — after importing the modules into Vivado it all worked fine. Bizarre and worrying error about the timing violation though. The bulk of the contribution was a mysterious “blocking on control” something or other for 8+ns... 

0 Kudos
ramananr
Xilinx Employee
Xilinx Employee
1,419 Views
Registered: ‎08-22-2019

Yes, that can happen. HLS is conservative when it comes to timing. It doesn't do all the logic optimizations that Vivado does on the RTL and therefore, the timing numbers from HLS should be taken as a warning/conservative estimate with the expectation that logic synthesis can crunch that number down. 

0 Kudos
aoifem
Moderator
Moderator
1,338 Views
Registered: ‎11-21-2018

Hi @adrianf00 

As this post is generating a lot of views could you mark the answer which helped the most as an 'accepted solution'? This will help the community find the solution faster. 

Aoife
Product Application Engineer - Xilinx Technical Support EMEA


**~ Got a minute? Answer our Vitis HLS survey here! ~**

**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
adrianf00
Adventurer
Adventurer
1,329 Views
Registered: ‎06-21-2019

@aoifemAs I am not the author of the thread, I think I can't accept solution. However, switching from Vivado HLS to Vitis HLS and using -std=gnu++14 flag solved the problem.

0 Kudos
aoifem
Moderator
Moderator
1,323 Views
Registered: ‎11-21-2018

Thanks @adrianf00 

Sorry I tagged the wrong person in the post!

@Sthornington2 

Could you mark an answer as an accepted solution? 

Aoife
Product Application Engineer - Xilinx Technical Support EMEA


**~ Got a minute? Answer our Vitis HLS survey here! ~**

**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
Sthornington2
Visitor
Visitor
1,314 Views
Registered: ‎06-17-2020

That solution only works for Vitis HLS though....

0 Kudos
adamsmitt
Visitor
Visitor
1,305 Views
Registered: ‎10-08-2020

Hi everyone. Interesting thread, but what if it is not Vitis HLS though? Thanks

abuzeng
Newbie
Newbie
1,164 Views
Registered: ‎06-25-2018

add -csimflags=c++14 and -cflags=c++11, may be able to solve the problem

0 Kudos