cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
xil_tour
Explorer
Explorer
921 Views
Registered: ‎06-14-2018

Why is C++ used for HLS ?

Jump to solution

Hi,

wasn't C sufficient ?

I can't really see what C++ brings here what C can't do.

Is object paradigm closer to hardware development ?

I'm just curious.

0 Kudos
1 Solution

Accepted Solutions
u4223374
Advisor
Advisor
908 Views
Registered: ‎04-26-2015

C++ has a couple of features that are really useful. Two that spring to mind are parameterized types (which is why the ap_fixed library only exists for C++; it's not feasible to implement in C) and function templates (which Xilinx uses in almost all of their libraries).

 

The "big" feature of C++, however (object oriented programming) does not seem very useful in HLS, since it relies pretty heavily on dynamic memory allocation (which HLS doesn't support).

 

I've generally just used C plus templates and parameterized types in .cpp files, which keeps HLS happy and seems to work very nicely.

View solution in original post

3 Replies
u4223374
Advisor
Advisor
909 Views
Registered: ‎04-26-2015

C++ has a couple of features that are really useful. Two that spring to mind are parameterized types (which is why the ap_fixed library only exists for C++; it's not feasible to implement in C) and function templates (which Xilinx uses in almost all of their libraries).

 

The "big" feature of C++, however (object oriented programming) does not seem very useful in HLS, since it relies pretty heavily on dynamic memory allocation (which HLS doesn't support).

 

I've generally just used C plus templates and parameterized types in .cpp files, which keeps HLS happy and seems to work very nicely.

View solution in original post

xil_tour
Explorer
Explorer
850 Views
Registered: ‎06-14-2018

Ok, thanks for your answer.

0 Kudos
drjohnsmith
Teacher
Teacher
836 Views
Registered: ‎07-09-2009

Also, a less engineering answer,

which might have infulanced.

a) people think of C as 'old' C++ as new,

b) People like new

c) People think they can write C++

<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>
0 Kudos