by support »
Hello,
First of all, section 4.7 of the said guide refers to the software RAM FIFO. There's a very slim chance that you actually need it. It's much easier to read and write directly to the device files (or objects in Windows) and let the DMA buffers do the cushioning.
Speaking of guidelines in the documentation, I suggest looking at section 5 of the Getting started with Xillybus on a Windows host, which discusses best practices for high bandwidth applications. In particular section 5.5 encourages multi-threading programming.
Now to your question: Yes, multi-threading is a good idea. If your application can be organized fairly naturally, so each Xillybus stream has its own thread that either writes or reads from it, that will be beneficial. And as I just mentioned, skip the thing with the RAM FIFO, at least at first.
For example, if you have some part of your program that prepares data that need to be transmitted to the FPGA and then transmits it, a simple loop in a dedicated thread will most likely do the job well: When the time comes to write the data, just use _write() (but be sure to check the return value and possibly re-invoke _write() if not all data has been written, as suggested in the programming guide). Try this first. Odds are that you won't need to go any further.
Regards,
Eli
Hello,
First of all, section 4.7 of the said guide refers to the software RAM FIFO. There's a very slim chance that you actually need it. It's much easier to read and write directly to the device files (or objects in Windows) and let the DMA buffers do the cushioning.
Speaking of guidelines in the documentation, I suggest looking at section 5 of the Getting started with Xillybus on a Windows host, which discusses best practices for high bandwidth applications. In particular section 5.5 encourages multi-threading programming.
Now to your question: Yes, multi-threading is a good idea. If your application can be organized fairly naturally, so each Xillybus stream has its own thread that either writes or reads from it, that will be beneficial. And as I just mentioned, skip the thing with the RAM FIFO, at least at first.
For example, if you have some part of your program that prepares data that need to be transmitted to the FPGA and then transmits it, a simple loop in a dedicated thread will most likely do the job well: When the time comes to write the data, just use _write() (but be sure to check the return value and possibly re-invoke _write() if not all data has been written, as suggested in the programming guide). Try this first. Odds are that you won't need to go any further.
Regards,
Eli