08-10-2011 09:50 AM
Greetings,
I'm accessing a FlexRIO 7954R card using the Linux C API generated from an FPGA bitfile that supports several 422 channels. Data from each serial port is queued in a FIFO and retrieved with calls to NiFpga_ReadFifoU32(). When I call the ReadFifoU32 function with a non zero timeout I see my thread wait the appropriate amount of time before returning when no data was in the FIFO but the CPU utilization goes to 100%. Is ReadFifoU32 simply busy waiting during the specified timeout period? If so, is there a method in the C API that will actually block the calling thread?
Thanks,
Dave
08-11-2011 12:39 PM
Hi daowens.
Long story short, this is expected behavior to a certain degree. Typically speaking, the host will poll the FIFO as fast as possible. There is a KnowledgeBase article that speaks to a similar situation with the interaction between an FPGA target and an RT target that may provide you with further information.
AE KB 4X1GBJDK: Why is My Real-Time CPU at 100% When Reading from a DMA FIFO (FPGA)?
I hope this information helps.
Regards,
Michael G.