Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
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.
15323 Discussions

How to force use of registers for local variable?

Altera_Forum
Honored Contributor II
817 Views

Hi,  

 

I have a local array which is currently stored in RAM. It's 216 bytes in size (i.e. larger than 64 bytes). The operations on the data stored in this array are very simple and I would like to force the compiler to implement it in registers rather than RAM to see if this gives me a speedup. 

 

How can I do this? Is there an attribute to use when I declare a local variable? 

 

Thanks, 

Hanno
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
87 Views

From "Intel FPGA SDK for OpenCL Programming Guide, Section 11.2": 

 

int __attribute__((register)) a;
Altera_Forum
Honored Contributor II
87 Views

Thank you. I suspected it's that easy but just could not find it.

Reply