Line 40... |
Line 40... |
|
|
/* Benchmark multi issue execution */
|
/* Benchmark multi issue execution */
|
int multissue[20];
|
int multissue[20];
|
int supercycles;
|
int supercycles;
|
|
|
|
/* Load and store stalls */
|
|
int loadcycles, storecycles;
|
|
|
|
/* Result forwarding stall cycles */
|
|
int forwardingcycles;
|
|
|
/* Completition queue */
|
/* Completition queue */
|
struct icomplet_entry icomplet[20];
|
struct icomplet_entry icomplet[20];
|
|
|
/* Program counter */
|
/* Program counter */
|
unsigned long pc;
|
unsigned long pc;
|
Line 234... |
Line 240... |
|
|
void reset()
|
void reset()
|
{
|
{
|
cycles = 0;
|
cycles = 0;
|
supercycles = 0;
|
supercycles = 0;
|
|
loadcycles = 0;
|
|
storecycles = 0;
|
|
forwardingcycles = 0;
|
memset(reg, 0, sizeof(reg));
|
memset(reg, 0, sizeof(reg));
|
memset(iqueue, 0, sizeof(iqueue));
|
memset(iqueue, 0, sizeof(iqueue));
|
memset(icomplet, 0, sizeof(icomplet));
|
memset(icomplet, 0, sizeof(icomplet));
|
pctemp = eval_label("_main");
|
pctemp = eval_label("_main");
|
pc = pctemp;
|
pc = pctemp;
|
Line 247... |
Line 256... |
void fetch()
|
void fetch()
|
{
|
{
|
/* Cycles after reset. */
|
/* Cycles after reset. */
|
cycles++;
|
cycles++;
|
|
|
|
/* Simulate instruction cache */
|
|
ic_simulate(pc);
|
|
|
/* Fetch instruction. */
|
/* Fetch instruction. */
|
strcpy(iqueue[0].insn, mem[pc].insn);
|
strcpy(iqueue[0].insn, mem[pc].insn);
|
strcpy(iqueue[0].op1, mem[pc].op1);
|
strcpy(iqueue[0].op1, mem[pc].op1);
|
strcpy(iqueue[0].op2, mem[pc].op2);
|
strcpy(iqueue[0].op2, mem[pc].op2);
|
strcpy(iqueue[0].op3, mem[pc].op3);
|
strcpy(iqueue[0].op3, mem[pc].op3);
|
Line 618... |
Line 630... |
set_operand(cur->op1, 1);
|
set_operand(cur->op1, 1);
|
else
|
else
|
set_operand(cur->op1, 0);
|
set_operand(cur->op1, 0);
|
} else
|
} else
|
if (strcmp(cur->insn, "simrdtsc") == 0) {
|
if (strcmp(cur->insn, "simrdtsc") == 0) {
|
set_operand(cur->op1, supercycles);
|
set_operand(cur->op1, cycles+loadcycles+storecycles+forwardingcycles);
|
} else
|
} else
|
if (strcmp(cur->insn, "simprintf") == 0) {
|
if (strcmp(cur->insn, "simprintf") == 0) {
|
unsigned long stackaddr;
|
unsigned long stackaddr;
|
|
|
stackaddr = eval_reg(FRAME_REG);
|
stackaddr = eval_reg(FRAME_REG);
|
Line 641... |
Line 653... |
addfstats(icomplet[0].func_unit, iqueue[0].func_unit, 1, check_depend());
|
addfstats(icomplet[0].func_unit, iqueue[0].func_unit, 1, check_depend());
|
|
|
/* Dynamic, single stats. */
|
/* Dynamic, single stats. */
|
addsstats(iqueue[0].insn, 1, 0);
|
addsstats(iqueue[0].insn, 1, 0);
|
|
|
|
if (cur->func_unit == store)
|
|
storecycles += 0;
|
|
|
|
if (cur->func_unit == load)
|
|
loadcycles += 0;
|
|
|
|
if (check_depend())
|
|
forwardingcycles += 0;
|
|
|
/* Pseudo multiple issue benchmark */
|
/* Pseudo multiple issue benchmark */
|
if ((multissue[cur->func_unit] == 0) || (check_depend())) {
|
if ((multissue[cur->func_unit] == 0) || (check_depend())) {
|
int i;
|
int i;
|
for (i = 0; i < 20; i++)
|
for (i = 0; i < 20; i++)
|
multissue[i] = 1;
|
multissue[i] = 9;
|
supercycles++;
|
supercycles++;
|
multissue[arith] = 2;
|
multissue[arith] = 9;
|
multissue[store] = 2;
|
multissue[store] = 9;
|
multissue[load] = 2;
|
multissue[load] = 9;
|
}
|
}
|
multissue[cur->func_unit]--;
|
multissue[cur->func_unit]--;
|
|
|
return;
|
return;
|
}
|
}
|
Line 717... |
Line 738... |
{
|
{
|
int i;
|
int i;
|
|
|
printf("\n\nIQ[0]:");
|
printf("\n\nIQ[0]:");
|
dumpmemory(iqueue[0].insn_addr, iqueue[0].insn_addr + 4);
|
dumpmemory(iqueue[0].insn_addr, iqueue[0].insn_addr + 4);
|
printf(" (just executed)\tCYCLE: %u \tSUPERCYCLE: %u\nPC:", cycles, supercycles);
|
printf(" (just executed)\tCYCLES: %u \nSuperscalar CYCLES: %u\n", cycles, supercycles);
|
|
printf("Additional LOAD CYCLES: %u STORE CYCLES: %u\n", loadcycles, storecycles);
|
|
printf("Additional RESULT FORWARDING CYCLES: %u\nPC:", forwardingcycles);
|
dumpmemory(pc, pc + 4);
|
dumpmemory(pc, pc + 4);
|
printf(" (next insn)");
|
printf(" (next insn)");
|
for(i = 0; i < MAX_GPRS; i++) {
|
for(i = 0; i < MAX_GPRS; i++) {
|
if (i % 4 == 0)
|
if (i % 4 == 0)
|
printf("\n");
|
printf("\n");
|