obruendl
New Contributor
9 months agoRAM inference not working for initialized RAM
According to documentation RAM initialization should work in VHDL by simply adding an initialization value to the memory array.
However, In my code (see attached), this is not the case. Without initialization value (resp. with initializing all content to zero) the code infers 8kb RAM - so the syntax seems fine for RAM inference. As soon as I add any other initialization content than zeros, registers are inferred (not RAM).
I have attached my code containing both cases.
With line 109 uncommented, RAM inferrence works:
signal Mem_v : Data_t(Depth_g - 1 downto 0) := (others => (others => '0'));
With line 108 uncommented, RAM inferrence fails:
signal Mem_v : Data_t(Depth_g - 1 downto 0) := (0 => x"1234", 1 => x"5678", others => (others => '0'));
With line 108 uncommented, RAM inferrence fails:
signal Mem_v : Data_t(Depth_g - 1 downto 0) := (0 => x"1234", 1 => x"5678", others => (others => '0'));
Why is RAM inference not working? What can I do to make it work?