Line 289... |
Line 289... |
|
|
IFF (config.cpu.dependstats) current->func_unit = it_jump;
|
IFF (config.cpu.dependstats) current->func_unit = it_jump;
|
set_reg32(LINK_REGNO, pc + 8);
|
set_reg32(LINK_REGNO, pc + 8);
|
next_delay_insn = 1;
|
next_delay_insn = 1;
|
if (config.sim.profile) {
|
if (config.sim.profile) {
|
struct mem_entry *entry;
|
|
struct label_entry *tmp;
|
struct label_entry *tmp;
|
if (verify_memoryarea(pcdelay) && (tmp = get_label (pcdelay)))
|
if (verify_memoryarea(pcdelay) && (tmp = get_label (pcdelay)))
|
fprintf (runtime.sim.fprof, "+%08X %08lX %08X %s\n", runtime.sim.cycles, pc + 8, pcdelay, tmp->name);
|
fprintf (runtime.sim.fprof, "+%08llX %08lX %08lX %s\n",
|
|
runtime.sim.cycles, pc + 8, pcdelay, tmp->name);
|
else
|
else
|
fprintf (runtime.sim.fprof, "+%08X %08X %08X @%08X\n", runtime.sim.cycles, pc + 8, pcdelay, pcdelay);
|
fprintf (runtime.sim.fprof, "+%08llX %08lX %08lX @%08lX\n",
|
|
runtime.sim.cycles, pc + 8, pcdelay, pcdelay);
|
}
|
}
|
}
|
}
|
INSTRUCTION (l_jalr) {
|
INSTRUCTION (l_jalr) {
|
IFF (config.cpu.dependstats) current->func_unit = it_jump;
|
IFF (config.cpu.dependstats) current->func_unit = it_jump;
|
pcdelay = PARAM0;
|
pcdelay = PARAM0;
|
Line 308... |
Line 309... |
INSTRUCTION (l_jr) {
|
INSTRUCTION (l_jr) {
|
IFF (config.cpu.dependstats) current->func_unit = it_jump;
|
IFF (config.cpu.dependstats) current->func_unit = it_jump;
|
pcdelay = PARAM0;
|
pcdelay = PARAM0;
|
next_delay_insn = 1;
|
next_delay_insn = 1;
|
if (config.sim.profile)
|
if (config.sim.profile)
|
fprintf (runtime.sim.fprof, "-%08X %08X\n", runtime.sim.cycles, pcdelay);
|
fprintf (runtime.sim.fprof, "-%08llX %08lX\n", runtime.sim.cycles, pcdelay);
|
}
|
}
|
INSTRUCTION (l_rfe) {
|
INSTRUCTION (l_rfe) {
|
IFF (config.cpu.dependstats) current->func_unit = it_exception;
|
IFF (config.cpu.dependstats) current->func_unit = it_exception;
|
pcnext = mfspr(SPR_EPCR_BASE);
|
pcnext = mfspr(SPR_EPCR_BASE);
|
mtspr(SPR_SR, mfspr(SPR_ESR_BASE));
|
mtspr(SPR_SR, mfspr(SPR_ESR_BASE));
|
Line 323... |
Line 324... |
IFF (config.cpu.dependstats) current->func_unit = it_nop;
|
IFF (config.cpu.dependstats) current->func_unit = it_nop;
|
switch (k) {
|
switch (k) {
|
case NOP_NOP:
|
case NOP_NOP:
|
break;
|
break;
|
case NOP_EXIT:
|
case NOP_EXIT:
|
PRINTF("exit(%d)\n", evalsim_reg32 (3));
|
PRINTF("exit(%ld)\n", evalsim_reg32 (3));
|
fprintf(stderr, "@reset : cycles %lld, insn #%lld\n", runtime.sim.reset_cycles, runtime.cpu.reset_instructions);
|
fprintf(stderr, "@reset : cycles %lld, insn #%lld\n",
|
fprintf(stderr, "@exit : cycles %lld, insn #%lld\n", runtime.sim.cycles, runtime.cpu.instructions);
|
runtime.sim.reset_cycles, runtime.cpu.reset_instructions);
|
fprintf(stderr, " diff : cycles %lld, insn #%lld\n", runtime.sim.cycles,
|
fprintf(stderr, "@exit : cycles %lld, insn #%lld\n", runtime.sim.cycles,
|
runtime.sim.reset_cycles, runtime.cpu.instructions - runtime.cpu.reset_instructions);
|
runtime.cpu.instructions);
|
|
fprintf(stderr, " diff : cycles %lld, insn #%lld\n",
|
|
runtime.sim.cycles - runtime.sim.reset_cycles,
|
|
runtime.cpu.instructions - runtime.cpu.reset_instructions);
|
if (config.debug.gdb_enabled)
|
if (config.debug.gdb_enabled)
|
set_stall_state (1);
|
set_stall_state (1);
|
else
|
else
|
runtime.sim.cont_run = 0;
|
runtime.sim.cont_run = 0;
|
break;
|
break;
|
Line 346... |
Line 350... |
stackaddr = evalsim_reg32(4);
|
stackaddr = evalsim_reg32(4);
|
simprintf(stackaddr, evalsim_reg32(3));
|
simprintf(stackaddr, evalsim_reg32(3));
|
debug(5, "simprintf %x\n", stackaddr);
|
debug(5, "simprintf %x\n", stackaddr);
|
break;
|
break;
|
case NOP_REPORT:
|
case NOP_REPORT:
|
PRINTF("report(0x%x);\n", evalsim_reg32(3));
|
PRINTF("report(0x%lx);\n", evalsim_reg32(3));
|
default:
|
default:
|
if (k >= NOP_REPORT_FIRST && k <= NOP_REPORT_LAST)
|
if (k >= NOP_REPORT_FIRST && k <= NOP_REPORT_LAST)
|
PRINTF("report %i (0x%x);\n", k - NOP_REPORT_FIRST, evalsim_reg32(3));
|
PRINTF("report %i (0x%lx);\n", k - NOP_REPORT_FIRST, evalsim_reg32(3));
|
break;
|
break;
|
}
|
}
|
}
|
}
|
INSTRUCTION (l_sfeq) {
|
INSTRUCTION (l_sfeq) {
|
IFF (config.cpu.dependstats) current->func_unit = it_compare;
|
IFF (config.cpu.dependstats) current->func_unit = it_compare;
|
Line 488... |
Line 492... |
IFF (config.cpu.dependstats) current->func_unit = it_mac;
|
IFF (config.cpu.dependstats) current->func_unit = it_mac;
|
lo = mfspr (SPR_MACLO);
|
lo = mfspr (SPR_MACLO);
|
hi = mfspr (SPR_MACHI);
|
hi = mfspr (SPR_MACHI);
|
x = PARAM0;
|
x = PARAM0;
|
y = PARAM1;
|
y = PARAM1;
|
PRINTF ("[%08x,%08x]\t", (unsigned long)(x), (unsigned long)(y));
|
PRINTF ("[%08lx,%08lx]\t", (unsigned long)(x), (unsigned long)(y));
|
l = (ULONGEST)lo | ((LONGEST)hi << 32);
|
l = (ULONGEST)lo | ((LONGEST)hi << 32);
|
l += (LONGEST) x * (LONGEST) y;
|
l += (LONGEST) x * (LONGEST) y;
|
|
|
/* This implementation is very fast - it needs only one cycle for mac. */
|
/* This implementation is very fast - it needs only one cycle for mac. */
|
lo = ((ULONGEST)l) & 0xFFFFFFFF;
|
lo = ((ULONGEST)l) & 0xFFFFFFFF;
|
Line 508... |
Line 512... |
IFF (config.cpu.dependstats) current->func_unit = it_mac;
|
IFF (config.cpu.dependstats) current->func_unit = it_mac;
|
lo = mfspr (SPR_MACLO);
|
lo = mfspr (SPR_MACLO);
|
hi = mfspr (SPR_MACHI);
|
hi = mfspr (SPR_MACHI);
|
x = PARAM0;
|
x = PARAM0;
|
y = PARAM1;
|
y = PARAM1;
|
PRINTF ("[%08x,%08x]\t", (unsigned long)(x), (unsigned long)(y));
|
PRINTF ("[%08lx,%08lx]\t", (unsigned long)(x), (unsigned long)(y));
|
l = (ULONGEST)lo | ((LONGEST)hi << 32);
|
l = (ULONGEST)lo | ((LONGEST)hi << 32);
|
l -= x * y;
|
l -= x * y;
|
|
|
/* This implementation is very fast - it needs only one cycle for msb. */
|
/* This implementation is very fast - it needs only one cycle for msb. */
|
lo = ((ULONGEST)l) & 0xFFFFFFFF;
|
lo = ((ULONGEST)l) & 0xFFFFFFFF;
|