EmbDev.net

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


von Fito (Guest)


Rate this post
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

von Basti Sch. (Guest)


Rate this post
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

von Nikolaos K. (Company: http://www.nkavvadias.com) (nikolaos_k)


Rate this post
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

von Thomas R. (Company: abaxor engineering) (abaxor)


Rate this post
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

von Morbus (Guest)


Rate this post
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.

von Hocko (Guest)


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

i never tried

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.