/* Author : Rick van der Zwet * S-number : 0433373 * Version : $Id: memory.h 363 2007-12-03 06:07:31Z rick $ * Copyright : FreeBSD Licence * Description : Small libary to include most common functions * cycles, header */ #ifndef COMMON_H #define COMMON_H #define FALSE 0 #define TRUE 1 /* Memory transfer time in cycles */ #define TRANSFER 1 /* BUS2 output captured in a struct */ struct bus2_t { unsigned char type; /* Read/Write */ unsigned int size; /* Number of words requested */ unsigned int address; /* Memory location */ unsigned int rcount; /* Number of registers accessed meanwhile */ unsigned int icount; /* Number of instructions accessed meanwhile */ }; /* Made a struct for the results to make it more general */ struct result_t { long int cycles; /* Total needed cycles */ long int incache; /* Total words fetched from cache */ long int misses; /* Cache misses */ long int conflicts; /* Bank conflics occured */ }; /* Print of struct bus2_t mainly for debugging purposes */ void fprintfbus2(FILE * output, struct bus2_t * line); /* Push the bus2 lines into a bus2 struct */ int fscanfbus2(struct bus2_t * line); /* Set statictics of input to output */ void setstats(struct bus2_t * line, struct result_t * output); /* Result printer */ void printfresult(FILE * output, struct result_t * result); #endif /* COMMON_H */