Line 39... |
Line 39... |
"branch", "jump", "load", "store", "movimm", "move", "extend", "nop", "mac" };
|
"branch", "jump", "load", "store", "movimm", "move", "extend", "nop", "mac" };
|
|
|
struct dstats_entry dstats[DSTATS_LEN]; /* dependency stats */
|
struct dstats_entry dstats[DSTATS_LEN]; /* dependency stats */
|
struct sstats_entry sstats[SSTATS_LEN]; /* single stats */
|
struct sstats_entry sstats[SSTATS_LEN]; /* single stats */
|
struct fstats_entry fstats[FSTATS_LEN]; /* functional units stats */
|
struct fstats_entry fstats[FSTATS_LEN]; /* functional units stats */
|
struct mstats_entry mstats = {0}; /* misc units stats */
|
struct mstats_entry or1k_mstats = {0}; /* misc units stats */
|
struct cachestats_entry ic_stats = {0}; /* instruction cache stats */
|
struct cachestats_entry ic_stats = {0}; /* instruction cache stats */
|
struct cachestats_entry dc_stats = {0}; /* data cache stats */
|
struct cachestats_entry dc_stats = {0}; /* data cache stats */
|
struct immustats_entry immu_stats = {0}; /* insn mmu stats */
|
struct immustats_entry immu_stats = {0}; /* insn mmu stats */
|
struct dmmustats_entry dmmu_stats = {0}; /* data mmu stats */
|
struct dmmustats_entry dmmu_stats = {0}; /* data mmu stats */
|
struct raw_stats raw_stats = {0}; /* RAW hazard stats */
|
struct raw_stats raw_stats = {0}; /* RAW hazard stats */
|
Line 125... |
Line 125... |
sstats[i].insn = -1;
|
sstats[i].insn = -1;
|
memset(dstats, 0, sizeof(dstats));
|
memset(dstats, 0, sizeof(dstats));
|
for (i = 0; i < DSTATS_LEN; i++)
|
for (i = 0; i < DSTATS_LEN; i++)
|
dstats[i].insn1 = dstats[i].insn2 = -1;
|
dstats[i].insn1 = dstats[i].insn2 = -1;
|
memset(fstats, 0, sizeof(fstats));
|
memset(fstats, 0, sizeof(fstats));
|
memset(&mstats, 0, sizeof(mstats));
|
memset(&or1k_mstats, 0, sizeof(or1k_mstats));
|
memset(&ic_stats, 0, sizeof(ic_stats));
|
memset(&ic_stats, 0, sizeof(ic_stats));
|
memset(&dc_stats, 0, sizeof(dc_stats));
|
memset(&dc_stats, 0, sizeof(dc_stats));
|
memset(&raw_stats, 0, sizeof(raw_stats));
|
memset(&raw_stats, 0, sizeof(raw_stats));
|
}
|
}
|
|
|
Line 140... |
Line 140... |
PRINTF ("\n");
|
PRINTF ("\n");
|
if (config.bpb.enabled) {
|
if (config.bpb.enabled) {
|
struct branchstat bf;
|
struct branchstat bf;
|
struct branchstat bnf;
|
struct branchstat bnf;
|
long bf_all, bnf_all;
|
long bf_all, bnf_all;
|
bf.taken = mstats.bf[1][0] + mstats.bf[1][1];
|
bf.taken = or1k_mstats.bf[1][0] + or1k_mstats.bf[1][1];
|
bf.nottaken = mstats.bf[0][0] + mstats.bf[0][1];
|
bf.nottaken = or1k_mstats.bf[0][0] + or1k_mstats.bf[0][1];
|
bf.forward = mstats.bf[0][1] + mstats.bf[1][1];
|
bf.forward = or1k_mstats.bf[0][1] + or1k_mstats.bf[1][1];
|
bf.backward = mstats.bf[0][0] + mstats.bf[1][0];
|
bf.backward = or1k_mstats.bf[0][0] + or1k_mstats.bf[1][0];
|
bf_all = bf.forward + bf.backward;
|
bf_all = bf.forward + bf.backward;
|
|
|
bnf.taken = mstats.bnf[1][0] + mstats.bf[1][1];
|
bnf.taken = or1k_mstats.bnf[1][0] + or1k_mstats.bf[1][1];
|
bnf.nottaken = mstats.bnf[0][0] + mstats.bf[0][1];
|
bnf.nottaken = or1k_mstats.bnf[0][0] + or1k_mstats.bf[0][1];
|
bnf.forward = mstats.bnf[0][1] + mstats.bf[1][1];
|
bnf.forward = or1k_mstats.bnf[0][1] + or1k_mstats.bf[1][1];
|
bnf.backward = mstats.bnf[0][0] + mstats.bf[1][0];
|
bnf.backward = or1k_mstats.bnf[0][0] + or1k_mstats.bf[1][0];
|
bnf_all = bnf.forward + bnf.backward;
|
bnf_all = bnf.forward + bnf.backward;
|
|
|
PRINTF("bnf: %d (%d%%) taken,", bf.taken, (bf.taken * 100) / SD(bf_all));
|
PRINTF("bnf: %d (%d%%) taken,", bf.taken, (bf.taken * 100) / SD(bf_all));
|
PRINTF(" %d (%d%%) not taken,", bf.nottaken, (bf.nottaken * 100) / SD(bf_all));
|
PRINTF(" %d (%d%%) not taken,", bf.nottaken, (bf.nottaken * 100) / SD(bf_all));
|
PRINTF(" %d (%d%%) forward,", bf.forward, (bf.forward * 100) / SD(bf_all));
|
PRINTF(" %d (%d%%) forward,", bf.forward, (bf.forward * 100) / SD(bf_all));
|
Line 162... |
Line 162... |
PRINTF(" %d (%d%%) not taken,", bnf.nottaken, (bnf.nottaken * 100) / SD(bnf_all));
|
PRINTF(" %d (%d%%) not taken,", bnf.nottaken, (bnf.nottaken * 100) / SD(bnf_all));
|
PRINTF(" %d (%d%%) forward,", bnf.forward, (bnf.forward * 100) / SD(bnf_all));
|
PRINTF(" %d (%d%%) forward,", bnf.forward, (bnf.forward * 100) / SD(bnf_all));
|
PRINTF(" %d (%d%%) backward\n", bnf.backward, (bnf.backward * 100) / SD(bnf_all));
|
PRINTF(" %d (%d%%) backward\n", bnf.backward, (bnf.backward * 100) / SD(bnf_all));
|
|
|
PRINTF("StaticBP bnf(%s): correct %d%%\n", config.bpb.sbp_bnf_fwd ? "forward" : "backward",
|
PRINTF("StaticBP bnf(%s): correct %d%%\n", config.bpb.sbp_bnf_fwd ? "forward" : "backward",
|
(mstats.bnf[0][config.bpb.sbp_bnf_fwd] * 100) / SD(bnf_all));
|
(or1k_mstats.bnf[0][config.bpb.sbp_bnf_fwd] * 100) / SD(bnf_all));
|
PRINTF("StaticBP bf(%s): correct %d%%\n", config.bpb.sbp_bf_fwd ? "forward" : "backward",
|
PRINTF("StaticBP bf(%s): correct %d%%\n", config.bpb.sbp_bf_fwd ? "forward" : "backward",
|
(mstats.bnf[1][config.bpb.sbp_bf_fwd] * 100) / SD(bf_all));
|
(or1k_mstats.bnf[1][config.bpb.sbp_bf_fwd] * 100) / SD(bf_all));
|
PRINTF("BPB: hit %d (correct %d%%), miss %d\n", mstats.bpb.hit, (mstats.bpb.correct * 100) / SD(mstats.bpb.hit), mstats.bpb.miss);
|
PRINTF("BPB: hit %d (correct %d%%), miss %d\n", or1k_mstats.bpb.hit, (or1k_mstats.bpb.correct * 100) / SD(or1k_mstats.bpb.hit), or1k_mstats.bpb.miss);
|
} else
|
} else
|
PRINTF("BPB simulation disabled. Enable it to see BPB analysis\n");
|
PRINTF("BPB simulation disabled. Enable it to see BPB analysis\n");
|
|
|
if (config.bpb.btic) {
|
if (config.bpb.btic) {
|
PRINTF("BTIC: hit %d(%d%%), miss %d\n", mstats.btic.hit, (mstats.btic.hit * 100) / SD(mstats.btic.hit + mstats.btic.miss), mstats.btic.miss);
|
PRINTF("BTIC: hit %d(%d%%), miss %d\n", or1k_mstats.btic.hit, (or1k_mstats.btic.hit * 100) / SD(or1k_mstats.btic.hit + or1k_mstats.btic.miss), or1k_mstats.btic.miss);
|
} else
|
} else
|
PRINTF("BTIC simulation disabled. Enabled it to see BTIC analysis\n");
|
PRINTF("BTIC simulation disabled. Enabled it to see BTIC analysis\n");
|
|
|
if (config.ic.enabled) {
|
if (config.ic.enabled) {
|
PRINTF("IC read: hit %d(%d%%), miss %d\n", ic_stats.readhit, (ic_stats.readhit * 100) / SD(ic_stats.readhit + ic_stats.readmiss), ic_stats.readmiss);
|
PRINTF("IC read: hit %d(%d%%), miss %d\n", ic_stats.readhit, (ic_stats.readhit * 100) / SD(ic_stats.readhit + ic_stats.readmiss), ic_stats.readmiss);
|
Line 284... |
Line 284... |
default:
|
default:
|
PRINTF ("Please specify a stats group (1-6).\n");
|
PRINTF ("Please specify a stats group (1-6).\n");
|
break;
|
break;
|
}
|
}
|
#if 0
|
#if 0
|
PRINTF("Byte ADD: %d instructions\n", mstats.byteadd);
|
PRINTF("Byte ADD: %d instructions\n", or1k_mstats.byteadd);
|
#endif
|
#endif
|
}
|
}
|
|
|
No newline at end of file
|
No newline at end of file
|