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
Member level 3
Joined
Nov 9, 2013
Messages
66
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
iran
Activity points
1,938
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
 

KlausST

Super Moderator
Staff member
Advanced Member level 7
Joined
Apr 17, 2014
Messages
23,237
Helped
4,738
Reputation
9,497
Reaction score
5,125
Trophy points
1,393
Activity points
153,911
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
 

luben111

Advanced Member level 1
Advanced Member level 1
Joined
Mar 2, 2002
Messages
489
Helped
111
Reputation
223
Reaction score
107
Trophy points
1,323
Location
UK
Activity points
3,921
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.
 

TrickyDicky

Advanced Member level 7
Advanced Member level 7
Joined
Jun 7, 2010
Messages
7,109
Helped
2,080
Reputation
4,179
Reaction score
2,045
Trophy points
1,393
Activity points
39,763
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.
 

matin-kh

Member level 3
Member level 3
Joined
Nov 9, 2013
Messages
66
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
iran
Activity points
1,938
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
 

ads-ee

Super Moderator
Staff member
Advanced Member level 7
Joined
Sep 10, 2013
Messages
7,938
Helped
1,822
Reputation
3,654
Reaction score
1,806
Trophy points
1,393
Location
USA
Activity points
60,160
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.
 

matrixofdynamism

Advanced Member level 2
Advanced Member level 2
Joined
Apr 17, 2011
Messages
573
Helped
24
Reputation
48
Reaction score
23
Trophy points
1,298
Activity points
7,465
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
 

TrickyDicky

Advanced Member level 7
Advanced Member level 7
Joined
Jun 7, 2010
Messages
7,109
Helped
2,080
Reputation
4,179
Reaction score
2,045
Trophy points
1,393
Activity points
39,763
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.
 

mr_byte31

Full Member level 5
Full Member level 5
Joined
Oct 19, 2005
Messages
295
Helped
10
Reputation
20
Reaction score
8
Trophy points
1,298
Activity points
3,241
you can try systemC but i don't think there is a good synthesizer for it now :)
good luck
 

arbj2

Full Member level 3
Full Member level 3
Joined
Apr 10, 2012
Messages
166
Helped
10
Reputation
20
Reaction score
10
Trophy points
1,298
Activity points
2,697
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.
 

acanis

Newbie level 1
Newbie level 1
Joined
Jul 20, 2017
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
7
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

Top