URL
https://opencores.org/ocsvn/or2k/or2k/trunk
Subversion Repositories or2k
Compare Revisions
- This comparison shows the changes necessary to convert path
/or2k/trunk
- from Rev 20 to Rev 21
- ↔ Reverse comparison
Rev 20 → Rev 21
/analysis-bin/insnanalysis/or1k-32-insn.c
1550,8 → 1550,9
fprintf(stream, "%s\t", or1k_32_insns[(set[set_count2])]->insn_string); |
|
// now print out the occurances |
fprintf(stream, "\t%d\ttimes\n", set[n]); |
|
fprintf(stream, "\t%d\ttimes (%f%%)\n", set[n], |
(float)((float)set[n]/(float)insn_info->count)*100.0f); |
|
// done printing this one out.. let's clear its count |
set_count_copy[largest_indx + 1] = -1; |
|
1589,11 → 1590,13
{ |
or1k_32_insn_top_x(or1k_32_insns[insn_index],stream,10); |
or1k_32_generate_groupings_stats(or1k_32_insns[insn_index],stream); |
fprintf(stream, "\t---\t---\t---\t---\n"); |
} |
} |
|
// Do most frequent instruction analysis -- note this trashes instruction |
// frequency count - should be fixed |
fprintf(stream, "Individual instruction frequency:\n"); |
or1k_32_most_freq_insn(stream); |
|
} |
/analysis-bin/insnanalysis/or1k-32-insn.h
60,7 → 60,7
|
// Set maximum instructions in a row we'll keep track of, starting at pairs |
#define OR1K_MAX_GROUPINGS_ANALYSIS 4 |
#define OR1K_MAX_ENTRIES_PER_GROUP 50 |
#define OR1K_MAX_ENTRIES_PER_GROUP 300 |
// Format of grouping data: |
// |
// 1st dimension: A list for each n-tuple group we're keeping track of |
/analysis-bin/insnanalysis/insnanalysis.c
56,12 → 56,33
exit(1); |
} |
|
int filesize_bytes, filesize_insns; |
// Determine filesize |
if ( fseek(fp, 0, SEEK_END)) |
{ |
fclose(fp); |
fprintf(stderr, "Error detecting filesize\n"); |
return -1; |
} |
|
filesize_bytes = ftell(fp); |
filesize_insns = filesize_bytes / INSN_SIZE_BYTES; |
|
// Reset pointer |
rewind(fp); |
|
|
|
instruction * insn = (instruction *)insn_buff; |
|
instruction_properties insn_props; |
|
// Do initial analysis - frequency of each instruction |
// Go through the file, collect stats about instructions |
|
// What is one-percent of instructions |
float file_one_percent = ((float)filesize_insns / 100.0f ); |
float percent_of_percent=0; int percent; |
|
insn_lists_init(); |
|
while(!feof(fp)) { |
80,10 → 101,7
|
if (analyse_insn(*insn, &insn_props) == 0) |
{ |
/* |
print_insn(&insn_props); |
printf("\n"); |
*/ |
|
insns_seen_total++; |
|
collect_stats(*insn, &insn_props); |
96,12 → 114,22
|
do{ } while(0); |
} |
|
// Progress indicator |
percent_of_percent += 1.0f; |
if (percent_of_percent >= file_one_percent) |
{ |
percent++; |
fprintf(stderr, "\r%d%%", percent); |
percent_of_percent = 0; |
} |
|
|
} |
|
fclose(fp); |
|
printf("Saw %d instructions\n", insns_seen_total); |
printf("\rSaw %d instructions\n", insns_seen_total); |
|
generate_stats(stdout); |
|