Line 49... |
Line 49... |
#include "gdbcomm.h"
|
#include "gdbcomm.h"
|
#include "debug_unit.h"
|
#include "debug_unit.h"
|
#include "coff.h"
|
#include "coff.h"
|
|
|
/* CVS revision number. */
|
/* CVS revision number. */
|
const char rcsrev[] = "$Revision: 1.58 $";
|
const char rcsrev[] = "$Revision: 1.59 $";
|
|
|
/* Continuos run versus single step tracing switch. */
|
/* Continuos run versus single step tracing switch. */
|
int cont_run;
|
int cont_run;
|
|
|
/* History of execution */
|
/* History of execution */
|
Line 605... |
Line 605... |
printf("%s: Unknown command.\n", linestr);
|
printf("%s: Unknown command.\n", linestr);
|
|
|
/* MM: 'run -1' means endless execution. */
|
/* MM: 'run -1' means endless execution. */
|
while(cont_run != 0) {
|
while(cont_run != 0) {
|
int debug_slowdown = DEBUG_SLOWDOWN;
|
int debug_slowdown = DEBUG_SLOWDOWN;
|
|
extern int mem_cycles;
|
|
|
if (cpu_stalled) {
|
if (cpu_stalled) {
|
printf ("!");
|
printf ("!");
|
if(GDB_ENABLED) {
|
if(GDB_ENABLED) {
|
BlockJTAG();
|
BlockJTAG();
|
Line 616... |
Line 617... |
} else
|
} else
|
fprintf (stderr, "WARNING: CPU stalled and gdb connection not enabled.");
|
fprintf (stderr, "WARNING: CPU stalled and gdb connection not enabled.");
|
continue;
|
continue;
|
}
|
}
|
|
|
|
/* Each cycle has counter of mem_cycles; this value is joined with cycles
|
|
at the end of the cycle; no sim originated memory accesses should be
|
|
performed inbetween. */
|
|
mem_cycles = 0;
|
if (!testsprbits(SPR_PMR, SPR_PMR_DME | SPR_PMR_SME)) {
|
if (!testsprbits(SPR_PMR, SPR_PMR_DME | SPR_PMR_SME)) {
|
pic_clock();
|
pic_clock();
|
if (cont_run > 0) cont_run--;
|
if (cont_run > 0) cont_run--;
|
if(fetch()) {
|
if(fetch()) {
|
printf ("Breakpoint hit.\n");
|
printf ("Breakpoint hit.\n");
|
Line 627... |
Line 632... |
break;
|
break;
|
}
|
}
|
decode_execute(&iqueue[0]);
|
decode_execute(&iqueue[0]);
|
update_pc();
|
update_pc();
|
analysis();
|
analysis();
|
if (!hush)
|
|
dumpreg();
|
|
|
|
|
|
dc_clock();
|
dc_clock();
|
ic_clock();
|
ic_clock();
|
if (!testsprbits(SPR_PMR, SPR_PMR_SME)) tick_clock();
|
if (!testsprbits(SPR_PMR, SPR_PMR_SME)) tick_clock();
|
}
|
}
|
|
|
pm_clock();
|
pm_clock();
|
if (config.uarts_enabled) uart_clock();
|
if (config.uarts_enabled) uart_clock();
|
if (config.dmas_enabled) dma_clock();
|
if (config.dmas_enabled) dma_clock();
|
if (config.ethernets_enabled) eth_clock();
|
if (config.ethernets_enabled) eth_clock();
|
if (config.gpios_enabled) gpio_clock();
|
if (config.gpios_enabled) gpio_clock();
|
if (config.sim.exe_log) dump_exe_log();
|
|
if (config.vapi.enabled) vapi_check();
|
if (config.vapi.enabled) vapi_check();
|
if (GDB_ENABLED) {// && ((debug_slowdown--) <= 0)) {
|
if (GDB_ENABLED) {// && ((debug_slowdown--) <= 0)) {
|
debug_slowdown = DEBUG_SLOWDOWN;
|
debug_slowdown = DEBUG_SLOWDOWN;
|
HandleServerSocket(false); /* block & check_stdin = false */
|
HandleServerSocket(false); /* block & check_stdin = false */
|
debug (1, ".");
|
debug (1, ".");
|
}
|
}
|
if (DEBUG_ENABLED)
|
if (DEBUG_ENABLED)
|
if (testsprbits(SPR_DMR1, SPR_DMR1_ST)) set_stall_state (1);
|
if (testsprbits(SPR_DMR1, SPR_DMR1_ST)) set_stall_state (1);
|
|
cycles += mem_cycles;
|
|
if (!hush) dumpreg();
|
|
if (config.sim.exe_log) dump_exe_log();
|
}
|
}
|
hush = 0;
|
hush = 0;
|
fflush(stdout);
|
fflush(stdout);
|
freopen("/dev/fd/0", "w+", stdout);
|
freopen("/dev/fd/0", "w+", stdout);
|
|
|