Forum Discussion
7 Replies
- HRZ
Frequent Contributor
There is no hardware separation of private memory and local memory on FPGAs. Depending on the size and memory access pattern of the buffer, the compiler might decide to use registers or Block RAMs to implement either storage type. The pac_a10 board employs an Arria 10 GX 1150 FPGA which has 1,708,800 registers (~1.5 MB) and 54,260 Kb of Block RAM (~6.6 MB).
- hiratz
Occasional Contributor
I see. Thank you!
Could I clearly define a variable as a register one or Block RAM?
And does a register variable have a memory address? If so, a pointer to it can be passed to some function as the argument. In a traditional CPU architecture, a register variable has no "memory address".
- HRZ
Frequent Contributor
The decision of what resource to use for implementing buffers is directly made by the compiler. You can use the "__attribute__((register))" attribute in your buffer declaration to force buffers up to a certain size to be implemented using registers instead of Block RAM. However, there is a limit above which the compiler will refuse to perform this conversion and compilation will fail. It is usually best to leave the decision to the compiler.
There is no pointer for on-chip resources (be it register or Block RAM) and size of on-chip buffers must be known at compile-time. However, all on-chip buffers are addressable regardless of whether they are implemented using registers or Block RAM.