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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_40/] [or1ksim/] [profiler.c] - Diff between revs 997 and 1308

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

Rev 997 Rev 1308
Line 19... Line 19...
 
 
/* Command line utility, that displays profiling information, generated
/* Command line utility, that displays profiling information, generated
   by or1ksim. (use --profile option at command line, when running or1ksim.  */
   by or1ksim. (use --profile option at command line, when running or1ksim.  */
 
 
#include <stdio.h>
#include <stdio.h>
 
#include <string.h>
 
 
#include "profiler.h"
#include "profiler.h"
#include "sim-config.h"
#include "sim-config.h"
 
 
static struct stack_struct stack[MAX_STACK];
static struct stack_struct stack[MAX_STACK];
 
 
Line 198... Line 200...
      if (prof_func[i].cum_cycles > bestcyc) {
      if (prof_func[i].cum_cycles > bestcyc) {
        bestcyc = prof_func[i].cum_cycles;
        bestcyc = prof_func[i].cum_cycles;
        besti = i;
        besti = i;
      }
      }
    i = besti;
    i = besti;
    PRINTF ("| %-24s|%08X|%8i|%12.1f|%11i,%3.0f%%|\n",
    PRINTF ("| %-24s|%08X|%8li|%12.1f|%11li,%3.0f%%|\n",
            prof_func[i].name, prof_func[i].addr, prof_func[i].calls, ((double)prof_func[i].cum_cycles / prof_func[i].calls), prof_func[i].cum_cycles, (100. * prof_func[i].cum_cycles / prof_cycles));
            prof_func[i].name, prof_func[i].addr, prof_func[i].calls, ((double)prof_func[i].cum_cycles / prof_func[i].calls), prof_func[i].cum_cycles, (100. * prof_func[i].cum_cycles / prof_cycles));
    prof_func[i].cum_cycles = -1;
    prof_func[i].cum_cycles = -1;
  }
  }
  PRINTF ("---------------------------------------------------------------------------\n");
  PRINTF ("---------------------------------------------------------------------------\n");
  PRINTF ("Total %i functions, %i cycles.\n", prof_nfuncs, prof_cycles);
  PRINTF ("Total %i functions, %i cycles.\n", prof_nfuncs, prof_cycles);

powered by: WebSVN 2.1.0

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