My program has the need to intitialize an instance of a RAM on startup, before doing the actual algorithm. I am unsure of how exactly to do this. I have created a ram.vhd file which contains an array of 256 bytes. On startup, I need to put "0" in block zero, "1" in block 1, ..., "255" in block 255. The way I tried to do it was:
state: ram port map(clk, state_addr, state_data_in, state_data_out, state_we);
...
for count in 0 to 255 loop
wait until clk'event and clk = '1';
state_addr <= to_unsigned(count, 8);
state_data_in <= to_unsigned(count, 8);
state_we <= '1';
end loop;
Which I thought would write to the RAM every clock cycle for 256 clock cycles.
However, this will not properly synthesize. I get the error: ERROR:Xst:825 - *file*.vhd line 154: Wait statement in a procedure is not accepted.
Is there a better way to do this that I'm just not thinking of?
Thanks for any insight
state: ram port map(clk, state_addr, state_data_in, state_data_out, state_we);
...
for count in 0 to 255 loop
wait until clk'event and clk = '1';
state_addr <= to_unsigned(count, 8);
state_data_in <= to_unsigned(count, 8);
state_we <= '1';
end loop;
Which I thought would write to the RAM every clock cycle for 256 clock cycles.
However, this will not properly synthesize. I get the error: ERROR:Xst:825 - *file*.vhd line 154: Wait statement in a procedure is not accepted.
Is there a better way to do this that I'm just not thinking of?
Thanks for any insight