by support »
Hello,
write() accepts a pointer to a buffer, with no knowledge on how the data in it is organized. It's therefore meaningless that the buffer was defined as char array in the C program.
When the Xillybus stream is 32 bit wide, the driver treats the data as an array of unsigned int. In other words, it groups the buffer into segments of 4 bytes each, and makes a 32-bit word of each. If you happened to define the buffer as unsigned int my_buffer[32], and fill it with integers in your programs, the same integers will appear on the FPGA side in the respective *_data vector (treated as a plain 32-bit word).
But this stream could also be used to efficiently transport data in any other format, given that you handle the packing and unpacking properly. Which is usually quite simple. For example, if you use an asymmetric FIFO on the FPGA side (8 bits wide on one side, 32 bits on the side going to the Xillybus core) the reorganization of the data will turn out right.
Regards,
Eli
Hello,
write() accepts a pointer to a buffer, with no knowledge on how the data in it is organized. It's therefore meaningless that the buffer was defined as char array in the C program.
When the Xillybus stream is 32 bit wide, the driver treats the data as an array of unsigned int. In other words, it groups the buffer into segments of 4 bytes each, and makes a 32-bit word of each. If you happened to define the buffer as unsigned int my_buffer[32], and fill it with integers in your programs, the same integers will appear on the FPGA side in the respective *_data vector (treated as a plain 32-bit word).
But this stream could also be used to efficiently transport data in any other format, given that you handle the packing and unpacking properly. Which is usually quite simple. For example, if you use an asymmetric FIFO on the FPGA side (8 bits wide on one side, 32 bits on the side going to the Xillybus core) the reorganization of the data will turn out right.
Regards,
Eli