Line 327... |
Line 327... |
}
|
}
|
|
|
static void options_cmd (int func_no, cuc_func *f)
|
static void options_cmd (int func_no, cuc_func *f)
|
{
|
{
|
int b, i;
|
int b, i;
|
char tmp[20];
|
char tmp[30];
|
char *name = prof_func[func_no].name;
|
char *name = prof_func[func_no].name;
|
printf ("--------------------------------------------------------\n");
|
printf ("---------------------------------------------------------------------------\n");
|
printf ("|%-16s|pre/unrolled|shared| time | gates | old_time = %i \n",
|
printf ("|%-26s|pre/unrolled|shared| time | gates |old_time|\n",
|
strstrip (tmp, name, 16), f->orig_time);
|
strstrip (tmp, name, 26));
|
printf ("| BASE |%4i / %4i | %4i |%8i|%8.f|\n", 1, 1, 0,
|
printf ("| BASE |%4i / %4i | %4i |%8i|%8.f|%8i|\n", 1, 1, 0,
|
f->timings.new_time, f->timings.size);
|
f->timings.new_time, f->timings.size, f->orig_time);
|
for (b = 0; b < f->num_bb; b++) {
|
for (b = 0; b < f->num_bb; b++) {
|
/* Print out results */
|
/* Print out results */
|
for (i = 1; i < f->bb[b].ntim; i++) { /* First one is base option */
|
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;
|
int time = f->bb[b].tim[i].new_time - f->timings.new_time;
|
double size = f->bb[b].tim[i].size - f->timings.size;
|
double size = f->bb[b].tim[i].size - f->timings.size;
|
printf ("| ");
|
printf ("| ");
|
print_option (b, i);
|
print_option (b, i);
|
printf (" |%4i / %4i | %4i |%+8i|%+8.f|\n",
|
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,
|
f->bb[b].tim[i].preroll, f->bb[b].tim[i].unroll, f->bb[b].tim[i].nshared,
|
time, size);
|
time, size);
|
}
|
}
|
}
|
}
|
}
|
}
|
Line 541... |
Line 541... |
prof_func[i].cum_cycles = -prof_func[i].cum_cycles;
|
prof_func[i].cum_cycles = -prof_func[i].cum_cycles;
|
}
|
}
|
for (i = 0; i < prof_nfuncs; i++)
|
for (i = 0; i < prof_nfuncs; i++)
|
prof_func[i].cum_cycles = -prof_func[i].cum_cycles;
|
prof_func[i].cum_cycles = -prof_func[i].cum_cycles;
|
printf ("-----------------------------------------------------------------------------\n");
|
printf ("-----------------------------------------------------------------------------\n");
|
printf ("Total %i cycles (was %i), total added gates = %i.\n", ntime, prof_cycles, size);
|
printf ("Total %i cycles (was %i), total added gates = %i. Speed factor %.1f\n", ntime, prof_cycles, size, 1. * prof_cycles / ntime);
|
} else if (strncmp (tmp1, "d", 1) == 0 || strncmp (tmp1, "debug", 5) == 0) {
|
} else if (strncmp (tmp1, "d", 1) == 0 || strncmp (tmp1, "debug", 5) == 0) {
|
/* debug command */
|
/* debug command */
|
sscanf (tmp1, "%*s %i", &cuc_debug);
|
sscanf (tmp1, "%*s %i", &cuc_debug);
|
if (cuc_debug < 0) cuc_debug = 0;
|
if (cuc_debug < 0) cuc_debug = 0;
|
if (cuc_debug > 9) cuc_debug = 9;
|
if (cuc_debug > 9) cuc_debug = 9;
|
Line 626... |
Line 626... |
for (i = 0; i < prof_nfuncs; i++)
|
for (i = 0; i < prof_nfuncs; i++)
|
if (func[i]) {
|
if (func[i]) {
|
options_cmd (i, func[i]);
|
options_cmd (i, func[i]);
|
any = 1;
|
any = 1;
|
}
|
}
|
if (any) printf ("--------------------------------------------------------\n");
|
if (any) printf ("---------------------------------------------------------------------------\n");
|
else printf ("Sorry. No available options.\n");
|
else printf ("Sorry. No available options.\n");
|
} else if (strcmp (tmp1, "") == 0) {
|
} else if (strcmp (tmp1, "") == 0) {
|
/* Ignore empty string */
|
/* Ignore empty string */
|
} else {
|
} else {
|
/* help command */
|
/* help command */
|