Forum Discussion

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

Burst transfer from memory to Nios II

Hello,

I have a hard time understanding how the Nios II handles memory accesses.

In our Nios II design we want to use burst transfers to transfer data from SRAM into the caches of the processor or to on-chip memory. Does the Nios II processor use burst transfers by default or do we have to explicitly enable burst transfers? Is it recommended to use a DMA controller to transfer data from the SRAM to the on-chip memory?

Regards

Martin

13 Replies

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

    Thank you! I think I know what it is now - we wanted one onchip memory for code and data and want to send data stored in this onchip memory. I see we would have to create a second onchip region to do this, which is OK but not as convenient.

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

    Assuming you have enough room in your code on-chip memory then it should be possible to use it for the data storage as well for the SGDMA. You might want to keep those as separate onchip memories for performance reasons though (so that Nios can access one and the SGDMA access the other concurrently).

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

    Or give the nios 'tightly coupled' access and let the SGMA access the other as an Avalon slave.

    If you are using on-chip memory for code/data the performance is better if you use tightly coupled memories. It may well mean that you don't need the instruction or data caches (except you'll need the i-cache to use the JTAG debug and most of the boot options).

    You do want to make sure that the code put into tightly coupled instruction memory is pure (contains no data) - to avoid slow Avalon cycles to it. This probably required you use a non-standard linker script and may be impossible if you are trying to use the default EPCS loader. Also the gcc4 built by Altera puts jump tables (for switch statemants) into the code segment - you'd need to use the gcc3 build (or rebuild the compiler).

    I also got worse code from gcc4!