cachesim
A cache simulator
|
00001 /* -*- mode:c; coding: utf-8 -*- */ 00002 00008 #ifndef STATISTICS_H_INCLUDED 00009 #define STATISTICS_H_INCLUDED 00010 00011 #include "parse_config.h" 00012 00013 #include <stdio.h> 00014 00017 struct StatisticsInfo; 00018 typedef struct StatisticsInfo StatisticsInfo; 00019 00023 struct StatisticsInfo 00024 { 00025 int hit_counter_needed; 00026 int write_back_needed; 00027 int clock_counter; 00028 int read_counter; 00029 int write_counter; 00030 int hit_counter; 00031 int write_back_counter; 00032 }; 00033 00039 StatisticsInfo *statistics_create(ConfigFile *cfg); 00045 StatisticsInfo *statistics_free(StatisticsInfo *info); 00051 void statistics_add_counter(StatisticsInfo *info, int clock_counter); 00056 void statistics_add_read(StatisticsInfo *info); 00061 void statistics_add_write(StatisticsInfo *info); 00066 void statistics_add_hit_counter(StatisticsInfo *info); 00071 void statistics_add_write_back_counter(StatisticsInfo *info); 00077 void statistics_print(StatisticsInfo *info, FILE *f); 00078 00079 #endif 00080 00081 /* 00082 * Local variables: 00083 * c-basic-offset: 4 00084 * End: 00085 */