Forum Discussion
Hi, thanks for your comments,
1. by powered on FPGA, I mean compatible BSP is flashed on the device and library installed on the host machine. 'aocl diagnos'e is able to find the device and run data transfer tests.
2. Can you provide more on host-side API calls that could transfer host to DDR, DDR to DDR and not necessarily DDR to FPGA on chip memory? We want to copy appropriate data first through our pipeline interface and then load a relevant .aocx image according to metadata. This will provide flexibility to load different designs based on metadata.
3 & 4. Okay, if data transfers between host and device are initiated from the host side, could you point any such examples of API calls/protocol. e.g. data transfer test without loading .aocx
Atul
The host-side APIs are standard OpenCL APIs; namely, you can create buffers in the FPGA DDR memory using the clCreateBuffer() API, copy data from host DDR to FPGA DDR using clEnqueueWriteBuffer(), and copy data from FPGA DDR back to host DDR using clEnqueueReadBuffer(). I recommend studying existing OpenCL books/guides since these APIs are common to all OpenCL-capable devices and are not limited to Intel FPGAs.
To perform data transfer from host to device or vice versa, you need to create a "context", then a "queue", then create host buffers using standard C/C++ APIs (malloc or new), then create device buffers using clCreateBuffer(), and then use clEnqueueWriteBuffer() and clEnqueueReadBuffer() to transfer data between host buffers residing in host DDR and device buffers residing in FPGA DDR. None of these APIs depend on a valid "program" or "kernel" and as such, they can all be called without an aocx file.
Slides 54 and onward in the following documentation might be helpful in understanding the flow:
Intel's FPGA SDK for OpenCL guides can also be found below:
https://www.intel.com/content/www/us/en/docs/programmable/683846/21-4/overview.html
- Atul_Ghalame4 years ago
New Contributor
Thanks for these details, we'll try and get back if we need further help.
Atul