Forum Discussion

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

use 2 srams at the same time

hi:

I have writen some fixed data (1.2.3...) into a sram,then I want to read the data from it and write the data into the other sram at the same time.I write the code as below:

begin

SR1_wr_n<=1;

SR1_addr<=SR2_addr+1;

SR2_wr_n<=0;

SR2_addr<=SRAM_addr+1;

end

assign SR2_DQ = (~SR2_wr_n)? SR1_DQ;16'bzzzz;

then I look at the signaltapII waveform:

I am sure I have write sram 1 correctly,but when I read the data from it,the data at adress1 should be 1,2,3...but it is 0422h,0423h,0424h...

I am not sure if the method I used the two srams is right,that is ,reading one sram and write the other sram at the same time??

I give the attachment~

thanks very much!

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Please first try writing and reading only one sram properly. Make the display type according to your requirement, like HEX, Decimal, binary etc...

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    thanks for you answer!!~

    I have find the reason,that is ,I have mistake the adress of SRAM