Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

Confused about the BRAM read result

Hi,all

I can write data into BRAM correctly, but for read process I feel rather confused about what's going on. In read process, it read data out when condition met, then send it over the RS232 line. I found that the sequence it sends isn't my expectation when all data load is the same. Even more, when I load different data into the RAM, it sends unorderly data.

Any reply welcome!

Here are part of program, data_ram3 is 2-d array which is synthesized as BRAM.

when sd_ram1=>

if loop_ct2/=501 then

second_state<=sd_ram1;

if trans_done_rising='1' then

if pingpang=0 then data_send<=data_ram3(loop_ct2)(12 downto 8); pingpang<=pingpang+1;----need to check the syntax.

elsif pingpang=1 then data_send<=data_ram3(loop_ct2)(7 downto 3); pingpang<=pingpang+1;

else data_send<="00" & data_ram3(loop_ct2)(2 downto 0);loop_ct2<=loop_ct2+1;pingpang<=0;

end if;