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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_43/] [or1ksim/] [mprofiler.c] - Diff between revs 1242 and 1308

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

Rev 1242 Rev 1308
Line 23... Line 23...
#if HAVE_CONFIG_H
#if HAVE_CONFIG_H
#include <config.h>
#include <config.h>
#endif
#endif
 
 
#include <stdio.h>
#include <stdio.h>
 
#include <string.h>
 
#include <stdlib.h>
#if HAVE_MALLOC_H
#if HAVE_MALLOC_H
#include <malloc.h>     /* calloc, free */
#include <malloc.h>     /* calloc, free */
#endif
#endif
#include "support/profile.h"
#include "support/profile.h"
#include "mprofiler.h"
#include "mprofiler.h"
Line 141... Line 143...
}
}
 
 
void printout (int mode)
void printout (int mode)
{
{
  unsigned long addr = start_addr & ~((1 << group_bits) - 1);
  unsigned long addr = start_addr & ~((1 << group_bits) - 1);
  PRINTF ("start = %08x (%08x); end = %08x; group_bits = %08x\n", start_addr, addr, end_addr, (1 << group_bits) - 1);
  PRINTF ("start = %08x (%08lx); end = %08x; group_bits = %08x\n", start_addr, addr, end_addr, (1 << group_bits) - 1);
  for (; addr <= end_addr; addr += (1 << group_bits)) {
  for (; addr <= end_addr; addr += (1 << group_bits)) {
    int i;
    int i;
    unsigned long a = hash_get (addr >> group_bits, 0);
    unsigned long a = hash_get (addr >> group_bits, 0);
    unsigned long b = hash_get (addr >> group_bits, 1);
    unsigned long b = hash_get (addr >> group_bits, 1);
    unsigned long c = hash_get (addr >> group_bits, 2);
    unsigned long c = hash_get (addr >> group_bits, 2);
    PRINTF ("%08x:", addr);
    PRINTF ("%08lx:", addr);
    switch (mode) {
    switch (mode) {
      case MODE_DETAIL:
      case MODE_DETAIL:
        if (a) PRINTF (" %10i R", a);
        if (a) PRINTF (" %10li R", a);
        else PRINTF ("            R");
        else PRINTF ("            R");
        if (b) PRINTF (" %10i W", b);
        if (b) PRINTF (" %10li W", b);
        else PRINTF ("            W");
        else PRINTF ("            W");
        if (c) PRINTF (" %10i F", c);
        if (c) PRINTF (" %10li F", c);
        else PRINTF ("            F");
        else PRINTF ("            F");
        break;
        break;
      case MODE_ACCESS:
      case MODE_ACCESS:
        PRINTF (" %10i", a + b + c);
        PRINTF (" %10li", a + b + c);
        break;
        break;
      case MODE_PRETTY:
      case MODE_PRETTY:
        PRINTF (" %10i ", a + b + c);
        PRINTF (" %10li ", a + b + c);
        for (i = 0; i < nbits (a + b + c); i++)
        for (i = 0; i < nbits (a + b + c); i++)
          PRINTF ("#");
          PRINTF ("#");
#if 0
#if 0
        for (; i < 64; i++)
        for (; i < 64; i++)
          PRINTF (".");
          PRINTF (".");
#endif
#endif
        break;
        break;
      case MODE_WIDTH:
      case MODE_WIDTH:
        if (a) PRINTF (" %10i B", a);
        if (a) PRINTF (" %10li B", a);
        else PRINTF ("            B");
        else PRINTF ("            B");
        if (b) PRINTF (" %10i H", b);
        if (b) PRINTF (" %10li H", b);
        else PRINTF ("            H");
        else PRINTF ("            H");
        if (c) PRINTF (" %10i W", c);
        if (c) PRINTF (" %10li W", c);
        else PRINTF ("            W");
        else PRINTF ("            W");
        break;
        break;
    }
    }
    PRINTF ("\n");
    PRINTF ("\n");
    if (addr >= addr + (1 << group_bits)) break; /* Overflow? */
    if (addr >= addr + (1 << group_bits)) break; /* Overflow? */

powered by: WebSVN 2.1.0

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