Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
12409 Discussions

HLS Best Practices for Parameter Passing

Altera_Forum
Honored Contributor II
1,049 Views

Hello, I am new to using HLS and I am used to the object oriented programming that can be done in C++.  

 

What is the closest analog to making class or a struct so that many parameters can be passed into a component without cluttering the component function's definition? 

 

I have many different components that require similar, but not exactly the same inputs. Would I be losing efficiency if I pass in a single, overarching struct that includes all of these parameters? 

 

Thanks for the input!
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
108 Views

Hi, 

 

You can use structs to group together parameters to pass into a component. 

However, there are sometimes area penalties. if you have a struct containing members of different widths, the smaller members may be padded. 

 

Note that there is ultimately very little change in the overall design. In fact, if you ground the extra ‘padding’ bits when integrating your component with a full system, Quartus should optimize away the extra bits. 

 

Let me know if this has helped resolve the issue you are facing or if you need any further assistance. 

 

Best Regards, 

Anand Raj Shankar 

(This message was posted on behalf of Intel Corporation)
Reply