Altera_Forum
Honored Contributor
14 years agoclearing fifo and blocking call to fifo
Hi,
I have an avalon-ST source streaming data into a onchip FIFO (ST input & MM output). Currently the Nios reads blocks of data using a call to 'altera_avalon_fifo_read_fifo()' and places it into an array to perform a computation. At the first call, the FIFO is already filled up. After processing a block or two it catches up and I am reading zero between valid data samples. First question - is there a way to empty the contents of my onchip FIFO without reading out the data? Alternatively, can the FIFO be disabled by default until the Nios enables it through a status register? Second question - without using interrupts, can I make a blocking call to read the fifo? In other words, how can I force the Nios to wait until the FIFO has a new data sample? Thanks, -J