Forum Discussion

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

Avalon Master write does not write

My sopc modul has 3 Interfaces.

avs_slavereg that holds the registers the nios reads from and writes to to control this modul

avm_readmaster a read only a master that reads data from sdram to feed our ip with data. the addresspointer where this read master reads from is setup by a register inside avs_slavereg

The third interface is the one that makes me more than crazy.

avm_writemaster is the same as the readmaster, but it writes data that are genarated by our ip to sdram. it also has a register inside this sopc modul with the starting address.

the readmaster works perfect.

The Writemaster asserts its avm_writemaster_write with

avm_writemaster_writedata, avm_writemaster_address and avm_writemaster_byteenable set as needed to gain access to sdram.

inside the sopc both masterports have a junction to the sdram.

Our problem is that the writemaster asserts that it wants to write (=1) as we never see a avm_writemaster_waitrequest the avalon switch fabric must have stored this write request inside it. we obay the waitrequest rule.

The write initiated by the writemaster is not always executed. meaning that if the nios2 is in single step / debugging mode the write is more often done and if nios is under free run nearly never.

in other word the more nios has to do, the less writes are executed.

now we are confused.

write is one, address data byteenable is as they should be, waitrequst never occours, inside sopc this master port has a jundtion to sdram but the write is not done ..... so why is the write not performed ?

any idea is greatly welcome.

Michael Schmitt

BTW we use Quartus 5.1 Nios 5.1 all with aktual patches. nios2 is a fast with both caches

http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/wacko.gif

2 Replies

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

    we enabled for both master the access to offchip 8but sram.

    if we write to sram, the writes are executed and offchip sram holds the data :-)

    if we write to sdram, nearly no write is executed :-(

    same master, same source, same compilation, only different target.

    in both cases write is asserted.

    for ext. sram we see waitrequests

    for sdram we never see waitrequests.

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

    today we noticed that when our writemaster writes to external sram and software uses a ldwio command on a nios2 fast cpu core to read the data, the cpu reads old memory content and not that what is realy there.

    disabling the datacache solved these wrong reads.

    again we use ldwio (for 32bit) that should read regardless what is inside the datacache, but here with this fast core we read with ldwio the old content. disabling the datacache inside sopc and regenerate solved that for now.

    has anybody else here implemented a sopc modul with 3 interfaces (1 slave and 2 master) running on a fast core with datacache ? we nearly get crazy about that what is going on here. the external memory delivers the correct data that is written by the master but the software receives with a ldwio the contect before the avalon master had written .... maybe the avalon switch fabric has a problem but where can we look at ?

    Regards.

    Michael Schmitt (still hoping someone can point to the source of this)