04-16-2014 07:21 PM
Hi,
I am using the Ni7842 RIO board. I have implemented a data acquisition block on my FPGA (target device) and filling up a FIFO to transfer data from target to host machine.I have set up the FIFO to a size of 10k. The number of samples that I am trying to acquire is 16K on three channels simultaneously.
I am reading data from the DMA FIFO implemented on a host machine through the C API support provided for the board. I setup the FIFO for read in three steps by making calls to methods:
-ConfigureFIFO - to configure FIFO depth
-Read FIFO - to read elements into host DMA - This is executed in a loop reading chunks of 1k datapoints at every iteration (the datatype is I16 so it is 2kb that is being read)
-Stop FIFO
Does the memory allocated on the host DMA through configureFIFO method call need to be released explicitly by calling ReleaseFIFO? Note that AcquireFIFO is not being called here.
Please advice.
Thanks!
Solved! Go to Solution.
04-17-2014 01:57 PM
NiFpga_ReleaseFifoElements only applies to previously acquired FIFO elements. Therefore, if no elements are Acquired there should be no reason to call Release.
04-17-2014 02:12 PM
I appreciate you quick reply Jeff!
We monitored the host system for any potential memory leak and saw a jump of approximately 96KB in primary memory usage when we run this application which acquires 32KB * 3 channels through FPGA. Ofcourse there are other processes running parallelly that might be contributing to this. But I was curious as to what happens when I call configureFIFO to allocate DMA FIFO depth on the host. Do you release this memory if allocated on stopping FIFO?
Thanks,
PG
04-18-2014 10:58 AM
I believe all the memory is de-allocated upon calling NiFpga_Finalize but I have not been able to find specific documentation to confirm that.
There is a FIFO specific example included with the FPGA C API that my be of interest to you if you have not already looked at it.
04-18-2014 03:14 PM
Thanks Jeff!
I made sure we are calling the Finalize method to unload the library and looks like we are. Just a request, could you please consider documenting the memory allocation and de-allocation of the DMA FIFO during read/write FIFO operations and/or including examples for the same the next time a new version of the C API is released? I am sure a lot of users would appreciate that.
Thanks for the prompt responses again!
Regards,
PG