EmbDev.net

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


von James Y. (Company: Naval Undersea Warfare Center) (newport_j)


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

von rs@unfoo.net (Guest)


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

von Dose (Guest)


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

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

von ah8 (Guest)


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

von Kiran Barkat (Guest)


Attached files:

Rate this post
useful
not useful
Need data flow graph

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.