I've successfully programmed my FPGA using the provided sof bitstream file in the demo bundle. Currently, the FPGA is linked to the host via PCI Express, and I've connected the FPGA to my laptop through a USB Blaster.
I'm now looking to establish a successful handle to the FPGA device from my laptop. I've consulted the manual, but it primarily uses POSIX, and the hello world examples are oriented towards the host side only. How can I communicate directly from my laptop to the FPGA?
When attempting to open a handle to the FPGA device, as shown in the code below, I encounter "Failed to open device" error as in the code. Could you guide me on the proper procedure for achieving this?
- Code: Select all
#include <windows.h>
#include <iostream>
int main() {
HANDLE hDevice;
// Open a handle to the PCI Express card
hDevice = CreateFile(L"\\\\.\\xillybus_ourdevice", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hDevice == INVALID_HANDLE_VALUE) {
std::cerr << "Failed to open device\n";
return 1;
}
}