C code for conversion instead of programming.

R

Rajeev Varshney

Guest
Hello every1,
I have a doubt about C code conversion. Can someone help me regard this. I am in RTL design. and I am getting some calls in that people ask , Howdo you use c? As programming or Conversion.
Can someone please let me know about this. Or refer any document regard it.


where is application for c code conversion for hdl. and any help regard this topic ..I am unable to understand, what actually they ask for.
 
Rajeev Varshney <rajeev.10j@gmail.com> wrote:

I have a doubt about C code conversion. Can someone help me
regard this. I am in RTL design. and I am getting some calls in
that people ask , Howdo you use c? As programming or Conversion.
Can someone please let me know about this.
Or refer any document regard it.

Personally, I don't recommend using C as an HDL, but it might
depend on what you are doing.

verilog uses the C operators, so it is fairly easy for C programmers
who know about digital logic design to learn to write. The
designs I work on are so different from what anyone would do
in C, that I don't see using C.

where is application for c code conversion for hdl. and any
help regard this topic ..I am unable to understand,
what actually they ask for.

What are you actually trying to do? That makes a big difference
in how you should do it.

-- glen
 
On 10/19/2015 4:08 AM, Rajeev Varshney wrote:
Hello every1,
I have a doubt about C code conversion. Can someone help me regard this. I am in RTL design. and I am getting some calls in that people ask , Howdo you use c? As programming or Conversion.
Can someone please let me know about this. Or refer any document regard it.


where is application for c code conversion for hdl. and any help regard this topic ..I am unable to understand, what actually they ask for.

There are C to hardware compilers. But I think, like any HDL, for your
code to be synthesizable it has to be written according to a style
guide. Even in VHDL or Verilog, you can write code that will simulate,
but won't be synthesizable. Much more so in C.

Here is a like to a discussion of C tools for FPGAs.

http://stackoverflow.com/questions/8988629/can-you-program-fpgas-in-c-like-languages

This Wikipedia article has a list of potential tools.

https://en.wikipedia.org/wiki/C_to_HDL

--

Rick
 
rickman <gnuarm@gmail.com> wrote:
On 10/19/2015 4:08 AM, Rajeev Varshney wrote:

I have a doubt about C code conversion. Can someone help me
regard this. I am in RTL design. and I am getting some calls
in that people ask , Howdo you use c?
As programming or Conversion.

(snip)

There are C to hardware compilers. But I think, like any HDL, for your
code to be synthesizable it has to be written according to a style
guide. Even in VHDL or Verilog, you can write code that will simulate,
but won't be synthesizable. Much more so in C.

I have thought that a tool that would compile a program to some
intermediate code, and also generate logic for an efficient
interpreter of that code, could be useful.

That is, a soft processor optimized for the code at hand.

-- glen
 
Hello,


Thanks you for your valueable suggestion.....
After reading your responses, I have question that why people ask for c to hdl.
Also last year I came to know some technology specialist that
upcoming hardware will be based on clanguages.
I s it related to something 7Series FPGA.
 
Am Dienstag, 20. Oktober 2015 05:52:30 UTC+2 schrieb Rajeev Varshney:
> After reading your responses, I have question that why people ask for c to hdl.

You should ask this to the person asking you.

In general you might have a C based simulation model and like to easy exchange pure software with your design model written in C to verify the design will behave like expected. In C you use usually cycle based simulation instead of time based (ns,ps,..) simulation. Cycle based simulation ignores some effects but simulations run significant faster. Additionally there is no simulator providing the same simulation speed, than any C-executeable.
On the contrary ask any specialist who likes to sell you C based hardware design, how to scope with 10 clock domains that are asynchronous to each other in C and how to access existing design IP written in Verilog.

bye Thomas
 
rickman <gnuarm@gmail.com> wrote:

(snip on C as an HDL)
(then I wrote)

I have thought that a tool that would compile a program to some
intermediate code, and also generate logic for an efficient
interpreter of that code, could be useful.

That is, a soft processor optimized for the code at hand.

Perhaps, but how much better than just buying an already optimized hard
IP processor like an ARM or an x86 of some flavor? Sure soft processors
have uses, but the work involved in designing such a tool to
automatically produce machine code and a processor from C code would be
a lot more than can be justified I'd bet, but who knows? It may just be
the lack of a perceived market. Maybe this would be a good university
research project?

I haven't looked in detail how the usual soft processors work.

It wouldn't seem so hard to compile the C, see which instructions
the code actually used, then remove instructions from the soft
processor that weren't used. That should be much less work than
the synthesis tools themselves.

-- glen
 
On 10/19/2015 6:25 PM, glen herrmannsfeldt wrote:
rickman <gnuarm@gmail.com> wrote:
On 10/19/2015 4:08 AM, Rajeev Varshney wrote:

I have a doubt about C code conversion. Can someone help me
regard this. I am in RTL design. and I am getting some calls
in that people ask , Howdo you use c?
As programming or Conversion.

(snip)

There are C to hardware compilers. But I think, like any HDL, for your
code to be synthesizable it has to be written according to a style
guide. Even in VHDL or Verilog, you can write code that will simulate,
but won't be synthesizable. Much more so in C.

I have thought that a tool that would compile a program to some
intermediate code, and also generate logic for an efficient
interpreter of that code, could be useful.

That is, a soft processor optimized for the code at hand.

Perhaps, but how much better than just buying an already optimized hard
IP processor like an ARM or an x86 of some flavor? Sure soft processors
have uses, but the work involved in designing such a tool to
automatically produce machine code and a processor from C code would be
a lot more than can be justified I'd bet, but who knows? It may just be
the lack of a perceived market. Maybe this would be a good university
research project?

--

Rick
 
On Monday, October 19, 2015 at 11:52:30 PM UTC-4, Rajeev Varshney wrote:
Hello,


Thanks you for your valueable suggestion.....
After reading your responses, I have question that why people ask for c to hdl.
Also last year I came to know some technology specialist that
upcoming hardware will be based on clanguages.
I s it related to something 7Series FPGA.

It's not necessary in C. Some other high level programming languages are possible as well, for example SystemC (there is also a standardization effort on the synthesizable subset going on). The reason to model in such kind of languages is mainly 1) speed up simulation 2) start SoC verification early.. Now that you have the verified C model ready, it's normal to think why not convert it to HDL automatically.

High level synthesis is a trend. Eventually it will arrive just like how design methodology evolved from gate level to RTL. Many large companies are trying that and some of them been benefited from HLS already (excuse me but I cannot expose the names of the customers). If you're looking for more information, you can keep an eye on 1) Stratus from Cadence, mainly focused on SystemC 2) Catapult C from Calypto (now acquired by Mentor)

By the way, the opposite direction also exists - that is to convert a synthesizable HDL to C/C++ automatically. In that case the goal is merely speedup. One such example is ARM Cortex cores. They provide you cycle-accurate C++ models which are derived from RTL (the process is largely done by compiler tools from Synopsys)

Michael
 
On 10/20/2015 5:49 AM, glen herrmannsfeldt wrote:
rickman <gnuarm@gmail.com> wrote:

(snip on C as an HDL)
(then I wrote)

I have thought that a tool that would compile a program to some
intermediate code, and also generate logic for an efficient
interpreter of that code, could be useful.

That is, a soft processor optimized for the code at hand.

Perhaps, but how much better than just buying an already optimized hard
IP processor like an ARM or an x86 of some flavor? Sure soft processors
have uses, but the work involved in designing such a tool to
automatically produce machine code and a processor from C code would be
a lot more than can be justified I'd bet, but who knows? It may just be
the lack of a perceived market. Maybe this would be a good university
research project?

I haven't looked in detail how the usual soft processors work.

It wouldn't seem so hard to compile the C, see which instructions
the code actually used, then remove instructions from the soft
processor that weren't used. That should be much less work than
the synthesis tools themselves.

Removing instructions from a processor usually doesn't accomplish much
unless it is a big ugly brute maybe. Most of the logic in soft
processors is data path and instruction fetch rather than instruction
decode. So unless removing instructions allow you to reduce some part
of the data path it doesn't accomplish a lot. At least that has been my
experience. But then most of my work has been with processors of my own
design with some examination of a few RISC CPUs like MicroBlaze and
LatticeMico32. My designs were all stack processors which were intended
to minimize the logic used as a primary goal.

--

Rick
 

Welcome to EDABoard.com

Sponsor

Back
Top