title: How to call a VHDL function written in a seperate file to a C program
body: <p>Say I have a function written in VHDL and I want to call it from C and execute it in the C program. How would I do that?</p>
  
  <p>A simple example would be helpful. I searched and found <a href="https://books.google.lk/books?id=uAIwcAKo_VIC&amp;pg=PA319&amp;lpg=PA319&amp;dq=linking%20C%20and%20HDL%20files&amp;source=bl&amp;ots=e02fP1FN2B&amp;sig=CGLceDC1pXzJkP1ZM1ALXkVxFeY&amp;hl=en&amp;sa=X&amp;ved=0ahUKEwizoJ-IheTMAhUHuRQKHaJwCnMQ6AEINjAE#v=onepage&amp;q=linking%20C%20and%20HDL%20files&amp;f=false" rel="nofollow">this book</a>, but it only shows how to call C functions from VHDL, not the other way round.</p>
  
  <p>Can I include the VHDL code i want to implement in a device driver?.Using a tool like xilinx XPS a device driver can be made and the bitstream can be downloaded to an FPGA to make the hardware configurations .So in the end the C files will run in the microblaze and the VHDL implementation will be in the FPGA as a device driver.Can I call the driver then to the C file? because what i wanna do is to implement part of a C code in VHDL the rest of course in C and offload it to an FPGA and check whether the latency is reduced.Im using the pppd source code for this project.</p>