title: Automated tracing use of variables within source code
body: <p>I'm working with a set of speech processing routines (written in C) meant to be compiled with the mex command on MATLAB. There is this C-function which I'm interested in accelerating using FPGA.</p>
  
  <p>The hardware takes in specified input parameters through input ports, the rest of the inputs as constants to be hard coded, and passes a particular variable some where within the C-function, say <em>foo</em>, to the output port.</p>
  
  <p>I am interested in tracing the computation graph (unsure if this is the right term to use) of <em>foo</em>. i.e. how <em>foo</em> relates to intermediate computed variables, which in turn eventually depends on input parameters and hard coded constants. This is to allow me to flatten the logic so they can be coded using a hardware description language, as well as remove irrevelant logic which does not affect the value of <em>foo</em>. The catch is that some intermediate variables are global, therefore tracing is a headache.</p>
  
  <p>Is there an automated tool which analyzes a given set of C headers and source files and provide a means of tracing how a specified variable is altered, with some kind of dependency graph of all variables used?</p>