CGRAME / CGRA-ME-ISSUES

CGRA-ME is an open-source framework for modelling and exploring coarse grain reconfigurable architectures and CAD.
2 stars 0 forks source link

How to tell what the input node is referring #5

Open KelvinChung2000 opened 4 months ago

KelvinChung2000 commented 4 months ago

We can see three input nodes using the benchmarks/microbench/simple/pre-gen-graph_loop.dot. I assume they are for the base address for the array a, b, and c. How can I tell which input matches which variable?

The simple.c

#include <stdio.h>

// Simple loop with an array
int main() {
    int i;

#define N 4
    volatile int a[N] = {1,2,3,4};
    volatile int b[N] = {5,6,7,8};
    volatile int c[N] = {0};

    for (i = 0; i < N; i++) {
    //DFGLoop: loop
        c[i] = a[i] + b[i];
    }

    int sum = 0;
    for (i = 0; i < N; i++) {
        printf("c[%d] = %d\n", i, c[i]);
        sum += c[i];
    }

    return sum;
}

The dataflow graph: pre-gen-graph_loop