EEVblog Electronics Community Forum
A Free & Open Forum For Electronics Enthusiasts & Professionals
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
This topic
This board
Entire forum
Google
Bing
Home
Help
Search
About us
Links
Login
Register
EEVblog Electronics Community Forum
»
Electronics
»
Microcontrollers
»
Translating C code to Verilog
« previous
next »
Print
Search
Pages: [
1
]
Go Down
Author
Topic: Translating C code to Verilog (Read 2167 times)
0 Members and 1 Guest are viewing this topic.
jeremy
Super Contributor
Posts: 1079
Country:
Translating C code to Verilog
«
on:
February 14, 2014, 10:56:49 am »
Hi all,
Does anyone have any good resources on taking algorithms implemented in C and translating them to HDL? I know there are lots of tools out there which offer various degrees of automated translation, but I am interested in doing it myself.
Logged
AlfBaz
Super Contributor
Posts: 2184
Country:
Re: Translating C code to Verilog
«
Reply #1 on:
February 14, 2014, 11:08:13 am »
I'm by no means a vhdl expert but I suggest you just take it on. I managed to implement bresenham's line drawing algorithm from C code without to much trouble
Logged
dannyf
Super Contributor
Posts: 8221
Country:
Re: Translating C code to Verilog
«
Reply #2 on:
February 14, 2014, 02:57:14 pm »
I usually do two things:
1) Understand what the original code was doing, and how it did it. Then replicate the approach and structure in the target language; This works better if the original code is well designed and documented.
2) Write you own. Essentially replicating the functionality of the original code without replicating the code itself. This works better if you find it unproductive trying to understand a poorly written and documented piece of code.
Logged
================================
https://dannyelectronics.wordpress.com/
tszaboo
Super Contributor
Posts: 7364
Country:
Current job: ATEX product design
Re: Translating C code to Verilog
«
Reply #3 on:
February 14, 2014, 04:32:36 pm »
You put a soft processor on your FPGA, then you run the code on that.
C code is sequential, HDL is concurrent. They are the least alike.
Logged
Print
Search
Pages: [
1
]
Go Up
« previous
next »
Share me
Smf
EEVblog Electronics Community Forum
»
Electronics
»
Microcontrollers
»
Translating C code to Verilog
There was an error while thanking
Thanking...
EEVblog Main Site
EEVblog on Youtube
EEVblog on Twitter
EEVblog on Facebook
EEVblog on Odysee