03-13-2018 01:32 AM
HI ,
Just a simple question about DMA channel.
When im configuring an taget to host or host to target DMA ,
Data type is U16 , and requested num of elements is 1023 .
does it mean that the whole size of the fifo is 2Kbytes , each cell of the fifo is U16 data (2 bits ) ?
what exactly is element ?
Thank you.
Solved! Go to Solution.
03-13-2018 06:00 AM
Usually "element" means "the basic Unit under discussion". If you have a device that gives you Units of a 16-bit unsigned integer, then your Unit occupies two bytes. Note, however, the first word in this response ...
Bob Schor
03-13-2018 06:22 AM - edited 03-13-2018 06:35 AM
The number of requested elements and the size of the individual FIFO reads are unrelated technically.
When you initialise a DMA FIFO, you can request a specific size before starting any Read operation. This will be a multiple of the element data size (in your case 2 Bytes). If you request a FIFO size of 8192 elements, then it will occupy 2x8192 Bytes. Also note that LV cannot always comply with the requested number of elements, but I've never come across a case where it set a different size than I wanted.
LV typically defaults to one million elements for a FIFO IIRC. Two factors are important here.
1) The size of the FIFO is required so that LV can do background transfers into a buffer, even if you're not currently reading
2) it's a good idea to have the size an integer multiple of your read size due to behaviour when overflowing the receive buffer
To add to the confusion, there's a Buffer size on the RT and on the FPGA side. Both are completely independent of each other. There's a great article on this somewhere..... HERE.
Edit: Clarification due to some mixing up of terms on my part.
03-13-2018 06:23 AM
@Cobmetal wrote:
does it mean that the whole size of the fifo is 2Kbytes , each cell of the fifo is U16 data (2 bits ) ?
The data size of the fifo is 2Kbytes, each element of the fifo is U16 data (2 bytes (16 bits)).