EmbDev.net

Forum: FPGA, VHDL & Verilog gnerating data flow diagrams from c code


Author: James Yunker (Company: Naval Undersea Warfare Center) (newport_j)
Posted on:

Rate this post
0 useful
not useful
I have asked this question on other Forums but to no avail. I am looking 
for software preferably supported on a Linux system that can take c code 
and generate data flow graphs or diagrams. I know how to generate 
control flow graphs or diagrams (CFG) from c code. I just do not know 
how to generate data flow diagrams from c code. That is a hard one.

Any help appreciated.

Thanks in advance.

Also, please note I said generate the diagrams from code. I know of many 
software packages that can draw the diagrams once an analyst has 
inspected the code and given a rough outline of the DFG. That is easy.

My code is just too complicated and too many lines to do this by 
inspection ands then draw with graphic or drawing tools.

I need to generate the data flow graphs or diagrams.

Any help appreciated.

Respectfully

Author: rs@unfoo.net (Guest)
Posted on:

Rate this post
0 useful
not useful
James Yunker wrote:
> I am looking
> for software preferably supported on a Linux system that can take c code
> and generate data flow graphs or diagrams.

Generating a correct and complete data flow graph probably amounts to 
solving turings halting problem. in other words, it is not possible 
except for special cases.

There are some tools that should be able to generate data flow graphs 
from the running program, but as I won't have anything to do with "Naval 
Undersea Warfare" I will help you there.

Author: Dose (Guest)
Posted on:

Rate this post
0 useful
not useful
Perhaps some UML tools have this as reengineering function.

If you have some founded please report this in the forum.

Author: ah8 (Guest)
Posted on:

Rate this post
0 useful
not useful
As long as you need only C it's fairly simple to build a parser for it. 
I did it once (for lack of a better tool) an it is essentially just 
copying the C grammar into a yacc file. Once you have that you can 
extract any information the compiler has. (It's much harder to analyse 
C++ since there is no yacc grammar for it. The C++ grammar is not 
context free to the level, that yacc requires, I can't recall right now, 
which Chomsky level that would be.)

Getting a complete data flow is tricky, though. While it's fairly simple 
to extract the call hierarchy and hence the data passed down it, there 
are also global variables and pointers. However, depending on your 
precise requirements you can still learn a great deal about your 
program.

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.