Using C Programming To Call VHDL Implementation - Stack Overflow

Just browsing Stack Overflow? Help us improve your experience. Sign up for research
    1. Home
    2. Questions
    3. Tags
    4. Users
    5. Companies
    6. Labs
    7. Jobs
    8. Discussions
    9. Collectives
    10. Communities for your favorite technologies. Explore all Collectives

  1. Teams

    Ask questions, find answers and collaborate at work with Stack Overflow for Teams.

    Try Teams for free Explore Teams
  2. Teams
  3. Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams

Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

Get early access and see previews of new features.

Learn more about Labs Using C programming to call VHDL implementation Ask Question Asked 9 years, 5 months ago Modified 9 years, 5 months ago Viewed 2k times 2

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! :)

Share Improve this question Follow edited Jun 18, 2015 at 22:13 Josh asked Jun 18, 2015 at 22:07 Josh's user avatar JoshJosh 3633 silver badges16 bronze badges 6
  • Probably not without a TON of work. There's nothing that can be done in software that can't be done in hardware, since eventually everything happens in the hardware anyway, but working with floating point numbers in any HDL is a huge pain. See if your FPGA vendor has some IP or libraries that can help - they may have a floating-point coprocessor that you can use. – skrrgwasme Commented Jun 18, 2015 at 22:10
  • 1 Where is the C code running? How is that processor connected to the FPGA? – Ben Voigt Commented Jun 18, 2015 at 22:22
  • Do you mean a passing data to an actual FPGA running synthsized VHDL code or just some simulation that's running VHDL? – rost0031 Commented Jun 18, 2015 at 22:39
  • Yes, I mean passing data to an actual FPGA running synthsized VHDL code. Sry, I'm just getting started with FPGAs. Want to try something interesting. – Josh Commented Jun 18, 2015 at 23:17
  • 3 You would need the FPGA to provide a register interface and use a driver to transfer the data to the FPGA. Or use DMA. That is definitively not a beginner's job, much less with PCIe. You seem to have a completely wrong idea how FGPA-design actually works. Note that VHDL is not a programming language, but a hardware description language. Try to do some blinking LED wiith an FPGA in VHDL first. The you might get an idea. Much later, you might think about synthesizing VHDL code from a program (I would not use C for that, however - think of e.g. Python, Ruby, etc.). – too honest for this site Commented Jun 18, 2015 at 23:21
| Show 1 more comment

1 Answer 1

Sorted by: Reset to default Highest score (default) Trending (recent votes count more) Date modified (newest first) Date created (oldest first) 4

VHDL does not result in a run time routine, it turns into an actual implementation in HW. To be able to communicate with a VHDL routine to/from a high level lalnguage in a CPU, the CPU and the VHDL module must be connected and the VHDL code must have proper mean to provide data from the CPU.

In your case, there are 2 ways, one is that the VHDL is implemented in a way that the shared data can be accessed by both the CPU and the FPGA logic, in that case, you need to know what that address is. The other way is if the VHDL is providing data via serial port, or USB or ethernet to the CPU, but in both cases, this must be supported by the VHDL routine.

In any case, you need to know a lot more about the FPGA than just making a procedure call.

This article might help you a bit to understand who things works (might not be the right FPGA either, but probably helps anyway).

How to interface FPGAs to microcontrollers

Share Improve this answer Follow edited Jun 19, 2015 at 6:45 answered Jun 19, 2015 at 5:23 FarhadA's user avatar FarhadAFarhadA 8632 gold badges8 silver badges19 bronze badges Add a comment |

Your Answer

Reminder: Answers generated by artificial intelligence tools are not allowed on Stack Overflow. Learn more

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid …

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.

Draft saved Draft discarded

Sign up or log in

Sign up using Google Sign up using Email and Password Submit

Post as a guest

Name Email

Required, but never shown

Post Your Answer Discard

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.

  • The Overflow Blog
  • Your docs are your infrastructure
  • Featured on Meta
  • More network sites to see advertising test [updated with phase 2]
  • We’re (finally!) going to the cloud!
  • Call for testers for an early access release of a Stack Overflow extension...

Linked

0 How to call a VHDL function written in a seperate file to a C program 21 Programming VHDL on Linux? 1 How to generate vhdl code from a schematic in xilinx 2 Xilinx ISE 9.2 and programming FPGA 3 FPGA programming with VHDL and C 1 Encapsulation of a VHDL module in Ise XiliniX 0 Dynamically Configure FPGA From Host Program 0 VHDL Testbench code doesn't work for register 1 Verilog code works very well in Simulation but not on FPGA 1 How to make startup process in VHDL 0 unsynthesizable VHDL code

Hot Network Questions

  • Are there any UTXOs that can not be spent?
  • What's a good way to append a nonce to ciphertext in Python for AES GCM in Python?
  • How important is storytelling when submitting a grant application (or even a science paper)?
  • What is another word for "integrity" or "meaning" (which might be lacking)?
  • Why Adam and Eve were created naked?
  • What is the polymorph reached by letting the chocolate cool down?
  • Publishing corollaries of previously published results
  • How do I find out what kind of access a user has to a SharePoint Online site using PNP PowerShell?
  • A novel about Earth crossing a toxic cloud of cosmic size
  • What is 擦边 as in the case of the athlete champion turned dancer?
  • Sorites paradox and emergence
  • How can I solve my equation with the best numerical precision?
  • Why is it safe to soak an electric motor in isopropyl alcohol but not distilled water?
  • How can I avoid overusing her/she or the character name when describing character action
  • Configure Linux to regularly sync cached data to disk
  • Standard SMD chip resistor with higher power in the same package
  • Is BNF grammar in TeXbook correct?
  • Identifying a TNG episode where Dr. Pulaski instructs another doctor on a sling
  • T47 to BSA bottom bracket adapter - good idea?
  • Table structure with multiple foreign keys and values
  • Group cohomology valued in a bimodule
  • Does length contraction "break the speed limit"?
  • Will a laptop battery that stays connected to its charger be damaged?
  • What does GB Shaw mean when he says "like the butcher's wife in the old catch" here?
more hot questions Question feed Subscribe to RSS Question feed

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

default

Từ khóa » C Vhdl