10-09-2009 12:14 AM
Hi,
I was wondering if there is any official or documented way to convert the project settings of my existing Visual C++ 2008 project so that it can call the C to FPGA interface.
This way we can take existing programs written in C/C++ and accelerate them by using FPGAs and the C interface to FPGA,
Thanks,
John Stratoudakis
john@aleconsultants.com
www.WallStreetFPGA.com
10-09-2009 12:50 PM
Hi John,
Are you wanting to use the C-Interface to FPGA with LabWindows/CVI or the Visual Studio IDE? LabVIEW FPGA allows your you to easily create a header file that contains type enum definitions for the memory that you have configured in the LabVIEW FPGA code. You can download the LabVIEW FPGA bit stream to the FPGA hardware from your C host application through the NI-RIO driver layer. You can also perform data operations on the FPGA hardware through the NI-RIO driver layer by passing the type enum definitions for the memory you predefined in the LabVIEW FPGA code. There is a C-Interface to LabVIEW FPGA FAQ and a C-Interface Tutorial that will help to get started with this. In summary, you can interface with the FPGA hardware through the NI-RIO driver layer by passing information about the memory address that is defined in the auto-generated C-Interface to LabVIEW FPGA.
-Adri Kruger
LabWindows/CVI and Measurement Studio
Product Manager
10-09-2009 02:17 PM
I am trying to use the C-Interface to FPGA from inside the Visual Studio IDE. The reason I wish to use the C-Interface to FPGA is to be able to convert an existing Visual C++ Project from a simple Visual C++ Project to one that can also access the C-Interface to FPGA.
When I figure out all of the changes that I have to make to my existing Visual C++ Project to have it be able to call the C-Interface to FPGA I will post the results here.
Thanks
10-09-2009 03:20 PM
John,
You can do this with your existing Visual Studio C++ applications. The C-API Generator in LabVIEW FPGA will provide you with a header file similar to this one that I generated based on LabVIEW FPGA code I developed.
I have indicated a few areas in the file that are important for interfacing with the FPGA-based hardware.
This is a sample of the C host application code that you can develop that communicates with the FPGA-based hardware through the NI-RIO driver layer.
This example shows how you can reads from a FIFO of signed 16-bit integers. The function that I am calling is included in the NI-RIO driver (NiFpga.h header file) and is defined as follows:
In my code I am reading a DMA FIFO on the FPGA-based hardware by making to this function call through the NI-RIO driver and passing the type enum for the FIFO memory that I defined in the LabVIEW FPGA VI.
Let me know if you have any additional questions about this interface.
Adri Kruger
LabWindows/CVI and Measurement Studio
Product Manager