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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_47/] [or1ksim/] [cpu/] [common/] [stats.c] - Diff between revs 1244 and 1308

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

Rev 1244 Rev 1308
Line 24... Line 24...
#include "abstract.h"
#include "abstract.h"
#include "stats.h"
#include "stats.h"
#include "sim-config.h"
#include "sim-config.h"
#include "sprs.h"
#include "sprs.h"
#include "spr_defs.h"
#include "spr_defs.h"
 
#include "execute.h"
 
#include "opcode/or32.h"
 
#include "debug.h"
 
 
struct branchstat {
struct branchstat {
        int taken;
        int taken;
        int nottaken;
        int nottaken;
        int forward;
        int forward;
Line 133... Line 136...
  memset(&raw_stats, 0, sizeof(raw_stats));
  memset(&raw_stats, 0, sizeof(raw_stats));
}
}
 
 
void printotherstats(int which)
void printotherstats(int which)
{
{
  int i, all = 0, dependall = 0;
 
 
 
  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;
Line 152... Line 153...
    bnf.nottaken = or1k_mstats.bnf[0][0] + or1k_mstats.bf[0][1];
    bnf.nottaken = or1k_mstats.bnf[0][0] + or1k_mstats.bf[0][1];
    bnf.forward = or1k_mstats.bnf[0][1] + or1k_mstats.bf[1][1];
    bnf.forward = or1k_mstats.bnf[0][1] + or1k_mstats.bf[1][1];
    bnf.backward = or1k_mstats.bnf[0][0] + or1k_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 (%ld%%) taken,", bf.taken, (bf.taken * 100) / SD(bf_all));
    PRINTF(" %d (%d%%) not taken,", bf.nottaken, (bf.nottaken * 100) / SD(bf_all));
    PRINTF(" %d (%ld%%) not taken,", bf.nottaken, (bf.nottaken * 100) / SD(bf_all));
    PRINTF(" %d (%d%%) forward,", bf.forward, (bf.forward * 100) / SD(bf_all));
    PRINTF(" %d (%ld%%) forward,", bf.forward, (bf.forward * 100) / SD(bf_all));
    PRINTF(" %d (%d%%) backward\n", bf.backward, (bf.backward * 100) / SD(bf_all));
    PRINTF(" %d (%ld%%) backward\n", bf.backward, (bf.backward * 100) / SD(bf_all));
    PRINTF("bf: %d (%d%%) taken,", bnf.taken, (bnf.taken * 100) / SD(bnf_all));
    PRINTF("bf: %d (%ld%%) taken,", bnf.taken, (bnf.taken * 100) / SD(bnf_all));
    PRINTF(" %d (%d%%) not taken,", bnf.nottaken, (bnf.nottaken * 100) / SD(bnf_all));
    PRINTF(" %d (%ld%%) not taken,", bnf.nottaken, (bnf.nottaken * 100) / SD(bnf_all));
    PRINTF(" %d (%d%%) forward,", bnf.forward, (bnf.forward * 100) / SD(bnf_all));
    PRINTF(" %d (%ld%%) forward,", bnf.forward, (bnf.forward * 100) / SD(bnf_all));
    PRINTF(" %d (%d%%) backward\n", bnf.backward, (bnf.backward * 100) / SD(bnf_all));
    PRINTF(" %d (%ld%%) 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 %ld%%\n", config.bpb.sbp_bnf_fwd ? "forward" : "backward",
      (or1k_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 %ld%%\n", config.bpb.sbp_bf_fwd ? "forward" : "backward",
      (or1k_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", or1k_mstats.bpb.hit, (or1k_mstats.bpb.correct * 100) / SD(or1k_mstats.bpb.hit), or1k_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");
 
 

powered by: WebSVN 2.1.0

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