Forum Discussion
obruendl: I had a similar problem today. In my design, multiple DPRAMs are instatiated using a "for ... generate" loop, similar to your example.
Without initialization, the memories are inferred in RAM, but when i add an initialization function, only the MSB of these memories gets infered and the rest is implemented as registers.
Modifying the code as suggested above is not a solution for me, because the number of memories depends on a generic in my design, so i need the generate loop.
Then i found a solution: I added a separate entity for the DPRAM, including the initialization function and instantiated the DPRAM as component multiple times in the "for ... generate" loop. With this modification all memory bits were inferred in RAM without any problem.
Maybe this could also be a solution for your project.