/* * tracegen.c - Running the binary tracegen with valgrind produces * a memory trace of all of the registered transpose functions. * * The beginning and end of each registered transpose function's trace * is indicated by reading from "marker" addresses. These two marker * addresses are recorded in file for later use. */ #include #include #include #include #include #include "cachelab.h" #include /* External variables declared in cachelab.c */ extern trans_func_t func_list[MAX_TRANS_FUNCS]; extern int func_counter; /* External function from trans.c */ extern void registerFunctions(); /* Markers used to bound trace regions of interest */ volatile char MARKER_START, MARKER_END; static int A[256][256]; static int B[256][256]; static int M; static int N; int validate(int fn,int M, int N, int A[N][M], int B[M][N]) { int C[M][N]; memset(C,0,sizeof(C)); correctTrans(M,N,A,C); for(int i=0;i