Forum Discussion
Altera_Forum
Honored Contributor
8 years agoWhen you define a global variable as __constant, the compiler automatically creates a constant cache on the FPGA with a predefined size of 16 kB, and preloads data onto it (Best Practices Guide, 1.8.3.1 Constant Cache Memory). You do not need to copy the content of the constant variable to local memory manually. However, I am not sure how parallel accesses are handled in this case; I would expect the compiler would also replicate the cache to handle all parallel accesses, but Altera's documents do not address this case. You can write a simple test program and see how the compiler will behave with multiple parallel accesses to the constant cache.
P.S. I don't think "__constant volatile" makes sense and this could prevent generation of the constant cache; you should only use constant for correct behavior.