Forum Discussion

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

Creating Memory device for Nios II processor

Hello,

I want to transfer data from my custom component to the processor. Ideally it would be possible to access the data using pointer. Normally I would have to use IORD and IOWR macros to circumvent the caching of the processor.

I plan to implement the interface as an Avalon MM slave interface. If I add a new memory device in the "Linker Script" section will it it possible to access the region using pointers then?

Can I declare the interface as an memory device in the TCL script of my component?

Are there any prerequisites to use the interface as a memory device, e.g.:

-must the interface expose both a read write port (I only want to read data from the interface)

-does the interface have to support pipelined transfers, bursting?

Best regards

Martin

11 Replies

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

    Short update if anyone stumbles upon this thread. I've attached my module as a memory device to the Nios II processor. The magic is that you have to define the device as a memory device in the _hw.tcl script.

    Before reading from the device you have to flush the processor read cache for that memory region:

    
    alt_dcache_flush_no_writeback((void *) <address of burst IF>, <length of burst IF memory region in bytes>);
    
    Regards

    Martin