windows 11 communication between host/fpga

Questions and discussions about the Xillybus IP core and drivers

windows 11 communication between host/fpga

Postby sillyboy »

Hello,

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;
    }

}

sillyboy
 
Posts: 2
Joined:

Re: windows 11 communication between host/fpga

Postby support »

Hello,

I understand that the FPGA card is connected to one computer through the PCIe interface (which you refer to as "host"), and that you have a laptop too. Hence you can only access the FPGA on the "host" computer. The fact that the laptop is connected to a laptop via a USB blaster card is irrelevant as far as Xillybus is concerned.

If you want to connect with the FPGA board through USB, I suggest using XillyUSB, assuming that your laptop has USB 3.x (it most likely has) and that your FPGA board is supported.

I should also mention that the file name ("xillybus_ourdevice") should be one of the file names that are present on the IP core inside the FPGA. The name "xillybus_ourdevice" indeed appears in section 3.5 of the Programming Guide for Windows, but it's just a generic name. The names of the device files are listed in section 2.2 of the Getting Started guide for Windows (this section also explains how to get a list of these names).

I would also like to point out that among the device files in the demo bundle, only xillybus_mem_8 can be opened for both read and write.

Regards,
Eli
support
 
Posts: 802
Joined:

Re: windows 11 communication between host/fpga

Postby sillyboy »

Thank you for the quick reply.

You mentioned that xillybus is restricted to use from the host device. If this is the case, could you clarify the advantages of employing an FPGA device in this scenario? If I'm operating directly from the host device, I already have access to kernel mode and user mode memory, achievable through any application developed using the Windows API..

My objective is to establish a means to access host memory from a secondary device, specifically my laptop. From my understanding, the driver should facilitate communication between the host machine and the FPGA card, allowing me to read/write memory from the card while being controlled by my laptop.

Please clarify if Xilllybus can help me in this situation.
sillyboy
 
Posts: 2
Joined:

Re: windows 11 communication between host/fpga

Postby support »

Hello,

Please refer to the Principle of Operation page regarding what Xillybus does:

https://xillybus.com/doc/xilinx-pcie-pr ... -operation

Xillybus connects between your application logic on the FPGA and application software on the host. If you want to read and write to the host's physical memory directly, you can indeed to that with PCIe, but Xillybus doesn't have such a feature. For this kind of direct access, you should use the PCIe block directly with your own application logic.

Xillybus may come handy for controlling the logic on the FPGA that performs these actions, as well as to obtain the data it collects and supplying the data for writing into the memory array. Since a PCIe interface is already used to access the host's memory array directly, and the FPGA might not have another PCIe block (or it's difficult to access), XillyUSB can be a solution for connecting with a second computer.

Regards,
Eli
support
 
Posts: 802
Joined:


Return to Xillybus

cron