Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
公告
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
12748 讨论

clearing fifo and blocking call to fifo

Altera_Forum
名誉分销商 II
1,210 次查看

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
0 项奖励
2 回复数
Altera_Forum
名誉分销商 II
545 次查看

Answering the 2nd question: Loop reading the fifo status until it reports 'data available'. I guess the altera_avalon_fifo_read_fifo() returns the amount read?

0 项奖励
Altera_Forum
名誉分销商 II
545 次查看

It doesn't look like the FIFO supports flushing. By disabling do you mean disable it from accepting streaming data until enabled? If so then it doesn't look like it supports that either. 

 

Normally I build my own FIFOs when I need additional functionality. Luckily they are easy to build so maybe that would be your best bet to do.
0 项奖励
回复