EmbDev.net

Forum: FPGA, VHDL & Verilog Using C programming to call VHDL implementation


von John P. (njbenann)


Rate this post
useful
not useful
I'm thinking about writing a C function which basically passes an 
array/vector of real numbers to a VHDL implementation as an argument and 
the VHDL code does some computation using the array in a FPGA and 
returns the result back to the C function. So, my question - How do I go 
about writing a C function to call the VHDL implementation? Can anyone 
guide me in the right direction like a tutorial,API or anything?

Any help will be appreciated. Thanks! :)

: Edited by User
von Schlumpf (Guest)


Rate this post
useful
not useful
Well, you know what is left from your VHDL in the FPGA after 
synthesizing it?

von Schlumpf (Guest)


Rate this post
useful
not useful
But anyway:
in VHDL you have to DESCRIBE a hardware that computes the numbers.
Additional you have to describe the hardware of a interface (SPI, 
parallel, CAN, whatever) to interchange data between controller and 
FPGA.

After that 90% of the work is done.
And then you can write the C function that sends and receives data to 
and from the FPGA via the interface you implemented in the FPGA.

Sorry, but it seems that you have no clue of embedded systems..

von John P. (njbenann)


Rate this post
useful
not useful
Thank you!
Yes, I'm just getting started with FPGAs. So, I have no clue about 
embedded systems. Want to try something interesting.

von P. K. (pek)


Rate this post
useful
not useful
Schlumpf wrote:
> After that 90% of the work is done.
> And then you can write the C function that sends and receives data to
> and from the FPGA via the interface you implemented in the FPGA.

Nirmal Benann wrote:
> Want to try something interesting.

If you 'just' want to try something interesting, maybe it's a good idea 
to start with a soft or hard processor (Soc) directly located on your 
FPGA. The processor where your C program runs in this case is 'closer' 
to the FPGA, interfacing (hopefully) supported by the tool chain.

Running your C program on the PC, you Need to care about your local 
Drivers, too (USB, ETH, whatever) and Schlumpfs '90% of the work is 
done' may not quite be true.

: Edited by User
Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.