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

Subversion Repositories or1k_old

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 547 to Rev 548
    Reverse comparison

Rev 547 → Rev 548

/trunk/or1ksim/mprofiler.c
42,6 → 42,8
unsigned long cnt[3]; /* Various counters */
} *hash[HASH_SIZE];
 
int cnt[64] = {0};
 
/* Groups size -- how much addresses should be joined together */
int group_bits = 2;
 
107,17 → 109,32
num_read = fread (buf, sizeof (struct mprofentry_struct), BUF_SIZE, f);
for (i = 0; i < num_read; i++) if (buf[i].addr >= start_addr && buf[i].addr <= end_addr) {
int index;
if (mode != MODE_WIDTH) buf[i].type >>= 3;
else buf[i].type &= 0x7;
switch (buf[i].type) {
unsigned t = buf[i].type;
if (t > 64) {
printf ("!");
t = 0;
}
cnt[t]++;
if (mode == MODE_WIDTH) t >>= 3;
else t &= 0x7;
 
switch (t) {
case 1: index = 0; break;
case 2: index = 1; break;
case 4: index = 2; break;
default:
index = 0;
printf ("!!!!");
break;
}
hash_add (buf[i].addr >> group_bits, index);
}
} while (num_read > 0);
{int i;
for (i = 0; i < 64; i++)
printf ("%i:%i\t", i, cnt[i]);
printf ("\n");
}
}
 
static inline int nbits (unsigned long a)
211,7 → 228,6
strcpy (&fmprofname[0], argv[0]);
argv++; argc--;
} else {
printf (": %s", argv[0]);
switch (param) {
case 0:
start_addr = strtoul (argv[0], NULL, 0);

powered by: WebSVN 2.1.0

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