Forum Discussion
Altera_Forum
Honored Contributor
12 years agoCustom FIFO read in Nios IDE
I created a custom fifo in sopc builder and i am trying to read data from fifo. However, i got no idea about how to manipulate it .Is it right if i make a pointer which points at the base address of ...
Altera_Forum
Honored Contributor
12 years agoYou have basically the choice between the IORD/WR macros to directly access hardware, or use pointers to the base address.
If possible it's better to use pointers, as this method is probably more futureproof than the macros, especially if you plan to move to a MMU system one day. There is just one thing to be careful about when using pointers to access hardware: you must avoid using the CPU's data cache. For that the best way is to use the alt_remap_uncached() function (see page 14-47 of this document (http://www.altera.com/literature/hb/nios2/n2sw_nii52010.pdf)) to convert your base address to an uncached pointer.