Intel® High Level Design
Support for Intel® High Level Synthesis Compiler, DSP Builder, OneAPI for Intel® FPGAs, Intel® FPGA SDK for OpenCL™
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.
506 Discussions

HLS component invocation question

Gopikrishnan
Novice
452 Views

1. Can I call another component from within a component similar to instantiating another rtl module within a module?

2. 

Gopikrishnan_0-1623090811657.png

In the above code snippet I am calling the test twice from the main module. The second time I want to accumulate the sum with the sum from the previous call. But it is not happening. The sum register value is automatically set to 0 every time when component test is called. It's not holding the value from the previous call. Is there any way to achieve this?

0 Kudos
4 Replies
HRZ
Valued Contributor II
433 Views

Try declaring "sum" as "static".

BoonBengT_Intel
Moderator
411 Views

Hi @Gopikrishnan,

 

Thank you for posting in Intel community forum and hope all is well.
Please find the response to your doubts as followed 1) yes I believe you can do so, but per my understanding you would like to prevent too much nested layer of component calling as it might impact the performance, 1-2 layers should be ok. 2) as mention by HRZ, declaring the sum as static will allocate it for lifetime of the program and will be shared.
Please do try and let us know if that fits your needs.

 

Best Wishes
BB

Gopikrishnan
Novice
407 Views

Hello @BoonBengT_Intel 

 

I tried declaring the variable as static and it worked. Right now I've decided not to nest the components so I won't try it now. 

Thanks for the response

BoonBengT_Intel
Moderator
394 Views

Hi @Gopikrishnan,

 

Good to know that it is working now, thread will be transitioned to community support where community users will further help you with doubts in this thread.
Thanks for your questions and as always pleasure having you here.

 

Best Wishes
BB

Reply