I have a design that generates 16 bit data words at non predictable intervals (but the average rate is reasonably upper bounded). I need to transfer these words the an application running on the host with a guaranteed delivery time of about 500ms (each word should arrive to the host not later than 500ms after it was generated).
The natural choice to interface with the host seems to be the BufferedPipeOut but I am not sure what is the ‘natural’ way of using the buffered FIFO’s for this purpose.
- The ReadFromPipe() method requires the exact length of the data to read, not an upper bound, right?
2.How can the application figure out the current size of the FIFO data so it issue a read command?
3.What happens if the application specifies in the read request the max size (representing full FIFO) while the FIFO is not full, will it be an error? Will it read just the available data and will indicate the actual size of the data read? Will it block until more data is available to satisfy the requested data size?
I can think of work arounds but none of them is clean, reliable or efficient. For example, having in the hardware a counter that increments on each word written to the FIFO and subtracted by software commands with the number of bytes read by the application.
What is the text book solution for reading from buffered output pipes?
From user perspective, it would be great if the read method would read as much data as avaialble in the fifo and return that count to the caller.
Also, my design uses a single buffered pipe so I presume that the Spartan 1500 has more memory than needed for the 2048 entries of the FIFO. Is it possible to have the BufferedPipeOut parameterized such that I can increase the FIFO depth? (either exact size or specifying x1, x2, x4 if it is easier to implement).
PS, the Verilog example in page 30 should have ep_datain instead of ep_dataout, right?