URL
https://opencores.org/ocsvn/or2k/or2k/trunk
Subversion Repositories or2k
Compare Revisions
- This comparison shows the changes necessary to convert path
/
- from Rev 24 to Rev 25
- ↔ Reverse comparison
Rev 24 → Rev 25
/or2k/trunk/analysis-bin/insnanalysis/or1k-32-insn.c
20,14 → 20,6
|
#include "insn-lists.h" |
|
// Enable debug printf'ing straight to stdout -- will be a LOT of output |
#define DEBUG_PRINT 0 |
|
// Choose the output format, uncomment only one |
//#define DISPLAY_STRING |
#define DISPLAY_CSV |
|
|
// Variable to keep track of unique instructions we have |
int num_setup_insns; |
int num_seen_insns; |
1007,7 → 999,7
void or1k_32_collect_stats(uint32_t insn, |
struct or1k_32_instruction_properties * insn_props) |
{ |
// Add this instruction's occurance to our data |
// Add this instruction's occurrence to our data |
insn_lists_add(insn, insn_props); |
|
// n-tuple groupings stats recording here! |
1106,7 → 1098,7
or1k_32_insn_lists_init_insn(insn, insn_props); |
} |
|
// Increment occurance count |
// Increment occurrence count |
((or1k_32_insns[insn_props->insn_index])->count)++; |
|
// Add branch target value information, if instruction has it |
1308,7 → 1300,7
|
#ifdef DISPLAY_CSV |
fprintf(stream,"\"Most frequent instructions, descending\",\n"); |
fprintf(stream,"\"Instruction\",\"Occurances\",\"Frequency\",\n"); |
fprintf(stream,"\"Instruction\",\"Occurrences\",\"Frequency\",\n"); |
#endif |
|
while (instructions_to_print) |
1464,7 → 1456,7
"Insn: \"%s\" statistics (%d times (%f%%))\n", |
#endif |
#ifdef DISPLAY_CSV |
"\"Insn:\",\"%s\",\"occurances:\",%d,%f\n", |
"\"Instruction:\",\"%s\",\"occurrences:\",%d,%f\n", |
#endif |
insn_info->insn_string, |
insn_info->count, |
1484,7 → 1476,7
"Branch values:\n" |
#endif |
#ifdef DISPLAY_CSV |
"\"branch distance\",\"occurances\"\n" |
"\"branch distance\",\"occurrences\"\n" |
#endif |
); |
i = 0; |
1747,7 → 1739,7
largest_indx = (set_count_copy[set_count2 + 1] > |
set_count_copy[largest_indx + 1]) ? |
set_count2 : largest_indx; |
// largest_indx is the index of the set with the highest occurance, so |
// largest_indx is the index of the set with the highest occurrence, so |
// let's print it out, but first get a pointer to the set's data |
set = (int*)ntuplelist[largest_indx+1]; |
|
1767,7 → 1759,7
#endif |
or1k_32_insns[(set[set_count2])]->insn_string); |
|
// now print out the occurances |
// now print out the occurrences |
fprintf(stream, |
#ifdef DISPLAY_STRING |
"\t%d\ttimes (%f%%)\n", |
1815,18 → 1807,39
{ |
if (or1k_32_insns[insn_index] != NULL) |
{ |
or1k_32_insn_top_n(or1k_32_insns[insn_index],stream,10); |
or1k_32_generate_groupings_stats(or1k_32_insns[insn_index],stream); |
#ifdef DISPLAY_STRING |
fprintf(stream, "\t---\t---\t---\t---\n"); |
#endif |
#ifdef DISPLAY_CSV |
fprintf(stream, ",\n"); |
#endif |
or1k_32_insn_top_n(or1k_32_insns[insn_index],stream,10); |
or1k_32_generate_groupings_stats(or1k_32_insns[insn_index],stream); |
|
} |
} |
|
#ifdef DISPLAY_STRING |
fprintf(stream, "\t---\t---\t---\t---\n"); |
#endif |
#ifdef DISPLAY_CSV |
fprintf(stream, ",\n"); |
#endif |
|
|
// print out most frequent n-tuple |
int ntuple; |
for(ntuple=2;ntuple<5;ntuple++) |
or1k_32_most_freq_ntuple(ntuple, stream, 10); |
|
|
#ifdef DISPLAY_STRING |
fprintf(stream, "\t---\t---\t---\t---\n"); |
#endif |
#ifdef DISPLAY_CSV |
fprintf(stream, ",\n"); |
#endif |
|
|
// Do most frequent instruction analysis -- note this trashes instruction |
// frequency count - should be fixed |
/or2k/trunk/analysis-bin/insnanalysis/or1k-32-insn.h
6,7 → 6,14
*/ |
|
|
// Enable debug printf'ing straight to stdout -- will be a LOT of output |
#define DEBUG_PRINT 0 |
|
// Choose the output format, uncomment only one |
//#define DISPLAY_STRING |
#define DISPLAY_CSV |
|
|
// Struct for information about the register to be confugred |
// Set to 1 to enable |
struct or1k_32_instruction_properties |
/or2k/trunk/analysis-bin/insnanalysis/insnanalysis.c
126,8 → 126,6
fprintf(stderr, "\r%d%%", percent); |
percent_of_percent = 0; |
} |
|
|
} |
|
fclose(fp); |
134,8 → 132,12
|
fprintf(stderr, "\rDone\n", percent); |
#ifdef DISPLAY_STRING |
printf("\rSaw %d instructions\n", insns_seen_total); |
fprintf(stdout, "Saw %d instructions\n", insns_seen_total); |
#endif |
#ifdef DISPLAY_CSV |
fprintf(stdout, "\"File:\",\"%s\",\"Num insns:\",%d,\n", |
argv[1], insns_seen_total); |
#endif |
generate_stats(stdout); |
|
insn_lists_free(); |