I am wondering if i could see the loop unrolled form of a C program. For example i have the following for loop
// The following code mimics functionality of a logic circuit whose
//inputs are a,b,c and d
//output f
//At every for loop iteration, fresh values of a,b,c and d are input
//to the code whereas k value is used from the previous iteration.
bool k = 0;
bool a,b,c,d;
bool g,h,n,j,f;
for(i = 1; i < 100; i++)
{
h = !(a | b); //nor gate
g = (b & c); //and gate
n = !(c & d); //nand gate
f = (k==0) ? h : g; //mux
j = n ^ f; //xor gate
k = j;
}
The question is that "is it possible to see the loop unrolled form of this program in a readable format". I am interested in seeing how the gcc compiler expresses h99, g99, n99, f99, j99 and k99 (values of h, g, n, f, j and k in the 99th loop iteration) if it can do so? Or what should be done to see expressions for h99, g99, n99, f99, j99 and k99 in terms of the inputs a99,b99,c99,d99 down to a1,b1,c1 and d1?
In nutshell, i want to do symbolic simulation at every iteration "i" i.e., express the outputs hi, gi, ni, fi, ji and ki in terms of inputs ai,bi,ci,di down to a1,b1,c1 and d1.
Please let me know if you have any questions.