void Print_Cache_Statistics_for_one_cache(CDS *cds) { fprintf(stdout, "%s: %d entries of lines of %d bytes; %s, %s, %s\n", cds->name, cds->number_of_cache_entries, cds->cache_line_size, print_sets_and_ways(cds), cds->write_back ? "write-back" : "write-thru", CRP_name(cds)); fprintf(stdout, " %d addresses (%d %s, %d %s, %d %s)\n", cds->number_of_memory_reference, cds->number_of_type[MAT_FETCH], memory_reference_type_name(MAT_FETCH), cds->number_of_type[MAT_LOAD], memory_reference_type_name(MAT_LOAD), cds->number_of_type[MAT_STORE], memory_reference_type_name(MAT_STORE)); fprintf(stdout, " %d hits (%d%%), %d misses, %d memory reads, %d memory writes\n", cds->number_cache_hits, percent(cds->number_cache_hits, cds->number_total_cache_access), cds->number_cache_misses, cds->number_memory_reads, cds->number_memory_writes); if (cds->write_back) fprintf(stdout, " %d dirty cache lines remain\n", number_dirty_lines(cds)); /* victim represents the # of victim cache entries. if you have a victim cache, this will be true. If not, victim = 0 and you do not have a victim cache. Thus, do not print out victim cache data */ if (cds->victim) fprintf(stdout, " %d victim cache hits\n", cds->number_victim_hits); fprintf(stdout, "\n"); }
void debug_print_cache(struct cache *c) { fprintf(debug_file, "%s: Total number of entries: %d\n", c->name, c->number_of_cache_entries); fprintf(debug_file, "%s: %s\n", c->name, print_sets_and_ways(c)); fprintf(debug_file, "%s: Each cache line is %d bytes\n", c->name, c->cache_line_size); fprintf(debug_file, "%s: Cache is %s\n", c->name, c->write_back ? "write-back" : "write-thru"); fprintf(debug_file, "%s: With a %s replacement policy\n", c->name, CRP_name(c)); }
void Print_Cache_Statistics_for_one_cache(struct cache *c) { fprintf(stdout, "%s: %d entries of lines of %d bytes; %s, %s, %s\n", c->name, c->number_of_cache_entries, c->cache_line_size, print_sets_and_ways(c), c->write_back ? "write-back" : "write-thru", CRP_name(c)); fprintf(stdout, "%s: %d accesses, %d hits (%d%%), %d misses, %d miss reads, %d miss writes\n", c->name, c->number_total_cache_access, c->number_cache_hits, percent(c->number_cache_hits, c->number_total_cache_access), c->number_cache_misses, c->number_miss_reads, c->number_miss_writes); if (c->write_back) fprintf(stdout, "%s: %d dirty cache lines remain\n", c->name, number_dirty_lines(c)); }
void Print_Cache_Statistics_for_one_cache(CDS *cds) { fprintf(stdout, "%s: %d entries of lines of %d bytes; %s, %s, %s\n", cds->name, cds->number_of_cache_entries, cds->cache_line_size, print_sets_and_ways(cds), cds->write_back ? "write-back" : "write-thru", CRP_name(cds)); fprintf(stdout, " %d addresses (%d %s, %d %s, %d %s)\n", cds->number_of_memory_reference, cds->number_of_type[MAT_FETCH], memory_reference_type_name(MAT_FETCH), cds->number_of_type[MAT_LOAD], memory_reference_type_name(MAT_LOAD), cds->number_of_type[MAT_STORE], memory_reference_type_name(MAT_STORE)); fprintf(stdout, " %d hits, %d misses, %d memory reads, %d memory writes\n", cds->number_cache_hits, cds->number_cache_misses, cds->number_memory_reads, cds->number_memory_writes); fprintf(stdout, "\n"); }