Forum Discussion
A 256x256 integer buffer requires 256 KB of on-chip memory which is quite big. Furthermore, your buffer needs to be replicated multiple times to allow parallel accesses (the replication factor will be reported in the area report) and hence, you might end up overutilzing the Block RAMs. High-end Stratix V and Arria 10 devices have ~6 MB of on-chip memory. Long compilation time is normal for large designs, or designs with large on-chip buffers. You can consider parameterizing the size of your buffer and playing around with the size to find the best configuration. Also you are unrolling your compute loop 512 times; apart from further increasing the replication factor for your on-chip buffer, your design is also going to run out of DSPs if you are targeting Stratix V.
A constant value/array needs to be initialized with a value that is known at compile-time. You cannot write to a constant buffer at runtime; hence, your second code is not going to work.