Speed of writing data from host program to FPGA FIFO

Questions and discussions about the Xillybus IP core and drivers

Speed of writing data from host program to FPGA FIFO

Postby Cristian8 »

Hi,
I am continuously writing 32 bits from the host program to the FPGA FIFO. My Verilog code has to wait a while after it is done clocking the bits out to pins before the FIFO is not empty and it can grab the next 32 bits. I am passing the data into the FPGA FIFO from my host program in the following manner;

Code: Select all
std::ofstream FIFO;
FIFO.open("/dev/xillybus_write_32", std::ofstream::binary);
while(1){
            output32 = 4294967295;
            FIFO.write((char *)&output32, sizeof(output32));
}


Do you know how fast we can write data to the FPGA FIFO using Xillybus, (/dev/xillybus_write_32)? Do you happen to know of any ways to make that process faster? Any help or reference to documentation would be much appreciated. Thank you very much!
Cristian8
 
Posts: 5
Joined:

Re: Speed of writing data from host program to FPGA FIFO

Postby support »

Hello,

The maximal data rate depends on the targeted FPGA, and are listed on this page:

http://xillybus.com/pcie-download

If you don't reach these speeds, please check if it's not the software that slows you down. The process that writes to the FIFO should be well below 100% CPU usage. It's a bit tricky to check this today, with multicore processors, and e.g. the "top" utility showing 100% processor usage if the process takes up all processor power of all cores on some distributions, and 100% if it takes a single core's processing power on other distributions.

If it's not a software issue, I suggest creating a custom IP core at the IP Core Factory, with the default stream names, but explicitly requiring the data rates you need.

A side note about software: I don't know if the ofstream class adds a software-level buffer. If it does, you might write data, and not have it written to the FIFO until the ofstream's buffer is full, or you close the file, or you flush the file object. Again, I don't know about this specific class, but I know such buffering exists if you use fwrite() instead of write() in plain C. This is not an issue to worry about now, as you're surely filling the buffers sooner or later, but you may encounter problems in the future.

Regards,
Eli
support
 
Posts: 802
Joined:


Return to Xillybus

cron