EmbDev.net

Forum: FPGA, VHDL & Verilog c-code function into VHDL?


Author: Fito (Guest)
Posted on:

Rate this post
0 useful
not useful
i have to calculates lots of constants, dependant only of 1 generic 
value. I can do that in C or in Octave (Matlab-like language).

I don know how to load those constants, i've been doing it "by hand" in 
the VHDL header, first calculating them, and them putting them into 
matrixes in an array type. Can i implement the c-code (or matlab code) 
into the vhdl code like some kind of function? Have in mind that i'm not 
asking for sinthetizing this secuential code for calculation, i'm just 
looking for the ability to know the number of components and length of 
signals by every "layer" in my design.

Thanks a lot

Author: Basti Sch. (Guest)
Posted on:

Rate this post
0 useful
not useful
Hi Fito,
you might need to store your constants in a textfile and overwrite your 
constants(generics) with this values. Look for the textIO package.

Regards

Author: Nikolaos Kavvadias (Company: http://www.nkavvadias.com) (nikolaos_k)
Posted on:

Rate this post
0 useful
not useful
Hi Fito

check out my solution:

http://www.nkavvadias.com/hercules/

and for free testing:

http://www.nkavvadias.com/cgi-bin/herc.cgi

These links provide access to the HercuLeS high-level synthesis tool. So 
you can try automatically synthesizing your C code to VHDL with Herc.

Best regards
Nikolaos Kavvadias
Research Scientist

Author: Thomas Reinemann (Company: abaxor engineering) (abaxor)
Posted on:

Rate this post
0 useful
not useful
Fito wrote:
> i have to calculates lots of constants, dependant only of 1 generic
> value. I can do that in C or in Octave (Matlab-like language).

Write a function in C/Octave, which generates a valid VHDL file, 
containing your constants. Add this file to your project.

Tom

Author: Morbus (Guest)
Posted on:

Rate this post
0 useful
not useful
Maybe myHDL (http://www.myhdl.org/doku.php) could solve your problem, 
but it might be quite a change.
For simulation, some people have done interesting stuff with the GHDL 
simulator by interfacing it with C routines 
(http://www.fpgarelated.com/showarticle/20.php). But not sure if that 
helps, as you're speaking of constants. I'm just using those extensions 
to pull configuration values out of .INI files.

Author: Hocko (Guest)
Posted on:

Rate this post
0 useful
not useful
once, there used to be a prog named "c to vhdl" I got from the internet

i never tried

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [vhdl]VHDL code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.