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 agoIf you have a data cache then this won't work. On the first loop iteration the CPU will read from your FIFO, but for the next iterations it will just read the value again from the cache instead of accessing your FIFO. Something like this would be better (not tested)
#include <sys/alt_cache.h>
alt_16 *my_fifo = alt_remap_uncached((void*)CUSTOM_FIFO_IP_BASE,sizeof(alt_16));
for(counter = 0 ;counter < 255 ;counter++)
{
write_buffer = *my_fifo ;
}