Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

use C to program FPGA

Status
Not open for further replies.

matin-kh

Member level 3
Joined
Nov 9, 2013
Messages
67
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
iran
Activity points
1,955
Hi everyone,
I have a spartan 6 FPGA which I want to program it in C language I searched a lot and finally I found this software:
1-FPGA advantage
2-Codeveloper
3-Altium
which this software compile C to vhdl and after that I can use ISE to program my FPGA but I couldn't find a good site to explain which one of them is better to develop the code and I could not fine an example of them.
and also I informed that there is a software called vivado which xilinx provided it but I understood that it is just for series 7 and it can not use for spartan 6 butt I read also it can be use for spartan 6 but I could not understand how it could be possible.
could you please help me to choose the best software and give me some information about it?
Regards
Matin
 

Hi,

Use a HDL.
An FPGA is no processor that needs software code like C.
It is configurable hardware.

Sooner or later you will come to a HDL, so why loose time with C?

Klaus
 
Are you talking about embedding virtual processor core inside the FPGA and use C programming? Altera virtaul processor is called NIOS, some FPGA even have built in ARM multicore processors.
Of course KlausST is right - there is no way to program the FPFA logic with C language, VHDL is description language, if you want to do some sequences you use completely different approach compared to C.
 
1. FPGA Advantage is just an IDE to maintain project flow through a set of tools. It does not let you compile C for FPGA.
2. I dont even know what this is.
3. Altium is a PCB design tool.

FPGAs are NOT "programmed" in C. You write some form of HDL (hardware design language) or schematics and compile the design for your specific chip. There are tools out there to generate HDL from C, but generally do not give an optimal solution (I found this stack overflow post here listing many C to HDL tools): https://stackoverflow.com/questions/5603285/c-to-hardware-compiler-hll-synthesis
As you suggest Xilinx support C to gates through it's HLS tool, which only supports Vivado.

Writing C for FPGAs still requires good knowledge of FPGA design. From experience, the people who get the C to gates tools to work properly are HDL designers already. So you are much better off learning HDL yourself rather than try a C to gates tool.
 
thank you all. I have learnt VHDL and I can program FPGA in VHDL but my boss has forced me to program it in C because he believes it is easier I told him that I know VHDL and it is easier for me to to use VHDL but he is insisting on his own words!! :)، so I started searching about C language for FPGA but I found nothing good. I think I have to change his mind about this :). thank you for your answer :) .
Regards
Matin
 

Catapult C is about the only one I've heard about that is functional (been around a long time too), besides using Vivado HLS.
Cadence also has their own product Stratus, which I have no idea of how well it works.

Change his mind by getting quotes for Catapult or Stratus. Last time I looked 5+ years ago Catapult was over $20K.

In either case you have to code with a special dialect of C that has information on pipeline and clock information. You can't just take any C software code and compile it into a VHDL description.
 
I have heard about OpenCL being used to describe a digital circuit at a very high level of abstraction, almost like a high level programming language. However, when using tools that do something like that, they are usually not as good as us designing the circuit at a lower level of abstraction. They use more logic and do not get the "best" circuit as the output. But they are improving.

OpenCL has NOTHING to do with OpenGL. Maybe you are looking for OpenCL?

- - - Updated - - -

This question is related to High Level Synthesis; please read this as well:
https://en.wikipedia.org/wiki/High-level_synthesis
 
OpenCL is a slightly different setup. The OpenCL architecture always expects a controlling CPU with slave devices in FPGA. Origionally it required an x86 CPU with PCIe interface but I think it allows ARM CPUs (and maybe others too). The Altera implementation uses Avalon to connect everything.
 
you can try systemC but i don't think there is a good synthesizer for it now :)
good luck
 
Better to bite the bullet....try Verilog/VHDL these are easy to understand. I think you have a software background, you are thinking in terms of C, compilers etc. FPGAs are hardware and have no code as such.

To understand better I suggest you watch some tutorials on youtube, I found the Nandlogic tutorials to be very good and informative, they start from the basic and go on to complicated stuff. You should also consider buying a FPGA development board, I think a cheap one should be good.

You need to get over the software programming approach if you have to understand FPGA design.

I too have a strong software background, I have a Mojo-V3 kit, I started a week ago, and now I can flash LEDs, read push buttons etc using Verilog..

Remember no code is executed in FPGAs, there is no processor inside that is executing code. The program you make in Verilog/VHDL is synthesized to hard wired circuit inside the FPGA.
 
I wanted to let you know about LegUp, which is a high-level synthesis tool that turns C into RTL and supports Xilinx (and Altera) FPGAs.
You can download LegUp at: www.legupcomputing.com (Disclosure: I work on LegUp)
We also have some unique features like using parallel threads in software to express spatial hardware parallelism.
As the above posters mentioned, there is a bit of a learning curve when targeting C to an FPGA but we'd be happy to help you.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top