OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_46/] [or1ksim/] [cpu/] [common/] [stats.c] - Diff between revs 518 and 532

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 518 Rev 532
Line 37... Line 37...
struct cachestats_entry ic_stats;       /* instruction cache stats */
struct cachestats_entry ic_stats;       /* instruction cache stats */
struct cachestats_entry dc_stats;       /* data cache stats */
struct cachestats_entry dc_stats;       /* data cache stats */
struct immustats_entry immu_stats;      /* insn mmu stats */
struct immustats_entry immu_stats;      /* insn mmu stats */
struct dmmustats_entry dmmu_stats;      /* data mmu stats */
struct dmmustats_entry dmmu_stats;      /* data mmu stats */
struct raw_stats raw_stats;             /* RAW hazard stats */
struct raw_stats raw_stats;             /* RAW hazard stats */
struct slp_stats slp_stats;             /* SLP stats */
 
 
 
/* Dependency */
/* Dependency */
 
 
int check_depend()
int check_depend()
{
{
Line 127... Line 126...
        memset(fstats, 0, sizeof(fstats));
        memset(fstats, 0, sizeof(fstats));
        memset(&mstats, 0, sizeof(mstats));
        memset(&mstats, 0, sizeof(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));
        memset(&slp_stats, 0, sizeof(slp_stats));
 
}
}
 
 
/* SLP
 
 
 
1: R
 
2:  R
 
3:   R
 
OK
 
 
 
1:     W
 
2: R
 
3: R
 
flush 2 3
 
 
 
1:     R
 
2: W
 
3:  R
 
OK
 
 
 
1: R
 
2:     W
 
3:  R
 
flush 3
 
 
 
flushing: don't flush if written location hasn't change after the write since
 
original read got correct data.
 
 
 
*/
 
 
 
void slp_checkaccess(unsigned long addr, char type)
 
{
 
        if (!config.cpu.slp)
 
                return;
 
 
 
        if (/*(addr < (MEMORY_START + MEMORY_LEN - 4000)) &&  MM1709: we have no knowledge of this anymore */
 
            slp_stats.supercnt && (type == SLP_MEMWRITE)) {
 
                slp_stats.supercalls++;
 
                slp_stats.supercnt = 0;
 
        }
 
}
 
 
 
void slp_func_entry()
 
{
 
        if (!config.cpu.slp)
 
                return;
 
 
 
        if (++slp_stats.curdepth > slp_stats.maxdepth)
 
                slp_stats.maxdepth = slp_stats.curdepth;
 
 
 
        slp_stats.calls++;
 
        slp_stats.supercnt++;
 
}
 
 
 
void slp_func_exit()
 
{
 
        if (!config.cpu.slp)
 
                return;
 
 
 
        slp_stats.curdepth--;
 
}
 
 
 
 
 
void printistats(int which)
void printistats(int which)
{
{
        int i, all = 0, dependall = 0;
        int i, all = 0, dependall = 0;
 
 
        if (!config.cpu.dependstats) {
        if (!config.cpu.dependstats) {
Line 258... Line 196...
        printf("SUM: %d instructions (dynamic, functional units stats)  depend: %d%%\n", all, (dependall * 100) / SD(all));
        printf("SUM: %d instructions (dynamic, functional units stats)  depend: %d%%\n", all, (dependall * 100) / SD(all));
        printf("Byte ADD: %d instructions\n", mstats.byteadd);
        printf("Byte ADD: %d instructions\n", mstats.byteadd);
 
 
}
}
 
 
void printslpstats(int which)
 
{
 
        int i, all = 0, dependall = 0;
 
 
 
        if (!config.cpu.slp) {
 
                printf("SLP analysis disabled. Enable it to see analysis results.\n");
 
                return;
 
        }
 
 
 
        if (which == 6) {
 
                printf("SLP:\n");
 
                printf("maxdepth: %6d  calls: %6d\n", slp_stats.maxdepth, slp_stats.calls);
 
                printf("calls: %6d    supercalls: %6d\n", slp_stats.calls, slp_stats.supercalls);
 
        }
 
 
 
}
 
 
 
void printotherstats(int which)
void printotherstats(int which)
{
{
        int i, all = 0, dependall = 0;
        int i, all = 0, dependall = 0;
 
 
        if (config.cpu.bpb) {
        if (config.cpu.bpb) {
Line 324... Line 245...
}
}
 
 
void printstats(int which)
void printstats(int which)
{
{
        printistats(which);
        printistats(which);
        printslpstats(which);
 
        if (which == 5)
        if (which == 5)
                printotherstats(which);
                printotherstats(which);
}
}
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.