EmbDev.net

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


Author: John Porter (njbenann)
Posted on:

Rate this post
0 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
Author: Schlumpf (Guest)
Posted on:

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

Author: Schlumpf (Guest)
Posted on:

Rate this post
0 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..

Author: John Porter (njbenann)
Posted on:

Rate this post
0 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.

Author: P. K. (pek)
Posted on:

Rate this post
0 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

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [vhdl]VHDL code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.