URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
Compare Revisions
- This comparison shows the changes necessary to convert path
/
- from Rev 903 to Rev 904
- ↔ Reverse comparison
Rev 903 → Rev 904
/trunk/or1ksim/cuc/cuc.h
79,7 → 79,15
#define REF_BB(r) ((r) / MAX_INSNS) |
#define REF_I(r) ((r) % MAX_INSNS) |
#define INSN(ref) bb[REF_BB(ref)].insn[REF_I(ref)] |
|
#ifndef MIN |
# define MIN(x,y) ((x) < (y) ? (x) : (y)) |
#endif |
|
#ifndef MAX |
# define MAX(x,y) ((x) > (y) ? (x) : (y)) |
#endif |
|
#define log(x...) fprintf (flog, x) |
|
#define cucdebug(x,s...) {if ((x) <= cuc_debug) printf (s);} |
/trunk/or1ksim/cuc/memory.c
158,6 → 158,7
printf ("\n"); |
#endif |
|
/* Assign memory types */ |
for (i = 0; i < f->nmsched; i++) { |
cuc_insn *a = &f->INSN(f->msched[i]); |
f->mtype[i] = !II_IS_LOAD(a->index) ? MT_WRITE : 0; |
165,6 → 166,50
if (a->type & IT_SIGNED) f->mtype[i] |= MT_SIGNED; |
} |
|
/* Check if they address the same location, so we can join them */ |
if (otype == MO_WEAK || otype == MO_NONE) { |
for (i = 1, j = 1; i < f->nmsched; i++) |
/* Exclude memory stores and different memory types */ |
if (f->mtype[i - 1] == f->mtype[i] && !(f->mtype[i] & MT_WRITE)) { |
cuc_insn *a = &f->INSN(f->msched[i - 1]); |
cuc_insn *b = &f->INSN(f->msched[i]); |
if ((a->opt[1] & OPT_REF) && f->INSN(a->op[1]).index == II_ADD |
&&(b->opt[1] & OPT_REF) && f->INSN(b->op[1]).index == II_ADD) { |
a = &f->INSN(a->op[1]); |
b = &f->INSN(b->op[1]); |
/* Not in usual form? */ |
if (a->opt[1] != b->opt[1] || a->op[1] != b->op[1] |
|| a->opt[2] != OPT_CONST || b->opt[2] != OPT_CONST) goto keep; |
|
//printf ("%i %i, ", a->op[2], b->op[2]); |
|
/* Check if they are the same => do not copy */ |
if (a->op[2] == b->op[2] |
&& REF_BB(f->msched[i - 1]) == REF_BB(f->msched[i])) { |
/* yes => remove actual instruction */ |
int t1 = MIN (f->msched[i - 1], f->msched[i]); |
int t2 = MAX (f->msched[i - 1], f->msched[i]); |
int b, i, j; |
cucdebug (2, "Removing %x_%x and using %x_%x instead.\n", |
REF_BB(t2), REF_I(t2), REF_BB(t1), REF_I(t1)); |
change_insn_type (&f->INSN(t2), II_NOP); |
/* Update references */ |
for (b = 0; b < f->num_bb; b++) |
for (i = 0; i < f->bb[b].ninsn; i++) |
for (j = 0; j < MAX_OPERANDS; j++) |
if (f->bb[b].insn[i].opt[j] & OPT_REF && f->bb[b].insn[i].op[j] == t2) |
f->bb[b].insn[i].op[j] = t1; |
|
} else goto keep; |
} |
} else { |
keep: |
f->msched[j] = f->msched[i]; |
f->mtype[j++] = f->mtype[i]; |
} |
f->nmsched = j; |
} |
|
if (config.cuc.enable_bursts) { |
//printf ("\n"); |
for (i = 1; i < f->nmsched; i++) { |
/trunk/or1ksim/cuc/cuc.c
331,10 → 331,10
int b, i; |
char tmp[30]; |
char *name = prof_func[func_no].name; |
printf ("---------------------------------------------------------------------------\n"); |
printf ("|%-26s|pre/unrolled|shared| time | gates |old_time|\n", |
strstrip (tmp, name, 26)); |
printf ("| BASE |%4i / %4i | %4i |%8i|%8.f|%8i|\n", 1, 1, 0, |
printf ("-----------------------------------------------------------------------------\n"); |
printf ("|%-28s|pre/unrolled|shared| time | gates |old_time|\n", |
strstrip (tmp, name, 28)); |
printf ("| BASE |%4i / %4i | %4i |%8i|%8.f|%8i|\n", 1, 1, 0, |
f->timings.new_time, f->timings.size, f->orig_time); |
for (b = 0; b < f->num_bb; b++) { |
/* Print out results */ |
341,7 → 341,7
for (i = 1; i < f->bb[b].ntim; i++) { /* First one is base option */ |
int time = f->bb[b].tim[i].new_time - f->timings.new_time; |
double size = f->bb[b].tim[i].size - f->timings.size; |
printf ("| "); |
printf ("| "); |
print_option (b, i); |
printf (" |%4i / %4i | %4i |%+8i|%+8.f| |\n", |
f->bb[b].tim[i].preroll, f->bb[b].tim[i].unroll, f->bb[b].tim[i].nshared, |
628,7 → 628,7
options_cmd (i, func[i]); |
any = 1; |
} |
if (any) printf ("---------------------------------------------------------------------------\n"); |
if (any) printf ("-----------------------------------------------------------------------------\n"); |
else printf ("Sorry. No available options.\n"); |
} else if (strcmp (tmp1, "") == 0) { |
/* Ignore empty string */ |