Line 58... |
Line 58... |
#include "mprofiler.h"
|
#include "mprofiler.h"
|
#include "mc.h"
|
#include "mc.h"
|
#include "atahost.h"
|
#include "atahost.h"
|
|
|
/* CVS revision number. */
|
/* CVS revision number. */
|
const char rcsrev[] = "$Revision: 1.90 $";
|
const char rcsrev[] = "$Revision: 1.91 $";
|
|
|
/* History of execution */
|
/* History of execution */
|
int histexec[HISTEXEC_LEN];
|
int histexec[HISTEXEC_LEN];
|
|
|
char *sim_commands [] = {
|
char *sim_commands [] = {
|
Line 84... |
Line 84... |
if ((p = malloc(1000)) == NULL)
|
if ((p = malloc(1000)) == NULL)
|
return;
|
return;
|
va_start(ap, format);
|
va_start(ap, format);
|
(void) vsnprintf(p, 1000, format, ap);
|
(void) vsnprintf(p, 1000, format, ap);
|
va_end(ap);
|
va_end(ap);
|
printf("%s", p);
|
PRINTF("%s", p);
|
fflush(stdout);
|
fflush(stdout);
|
free(p);
|
free(p);
|
} else {
|
} else {
|
#if DEBUG
|
#if DEBUG
|
if ((p = malloc(1000)) == NULL)
|
if ((p = malloc(1000)) == NULL)
|
return;
|
return;
|
va_start(ap, format);
|
va_start(ap, format);
|
(void) vsnprintf(p, 1000, format, ap);
|
(void) vsnprintf(p, 1000, format, ap);
|
va_end(ap);
|
va_end(ap);
|
printf("%s\n", p);
|
PRINTF("%s\n", p);
|
fflush(stdout);
|
fflush(stdout);
|
free(p);
|
free(p);
|
#endif
|
#endif
|
}
|
}
|
}
|
}
|
Line 112... |
Line 112... |
signal(SIGINT, ctrl_c);
|
signal(SIGINT, ctrl_c);
|
}
|
}
|
|
|
void version()
|
void version()
|
{
|
{
|
printf ("\n");
|
PRINTF ("\n");
|
printf ("OpenRISC 1000 (OR32) Architectural Simulator, %s\n", rcsrev);
|
PRINTF ("OpenRISC 1000 (OR32) Architectural Simulator, %s\n", rcsrev);
|
printf ("Copyright (C) 1999 Damjan Lampret, lampret@opencores.org\n");
|
PRINTF ("Copyright (C) 1999 Damjan Lampret, lampret@opencores.org\n");
|
printf ("Copyright (C) 2000 Damjan Lampret, lampret@opencores.org\n");
|
PRINTF ("Copyright (C) 2000 Damjan Lampret, lampret@opencores.org\n");
|
printf (" Jimmy Chen-Min Chen, jimmy@ee.nctu.edu.tw\n");
|
PRINTF (" Jimmy Chen-Min Chen, jimmy@ee.nctu.edu.tw\n");
|
printf (" Johan Rydberg, johan.rydberg@insight.se\n");
|
PRINTF (" Johan Rydberg, johan.rydberg@insight.se\n");
|
printf (" Marko Mlinar, markom@opencores.org\n");
|
PRINTF (" Marko Mlinar, markom@opencores.org\n");
|
printf ("Copyright (C) 2001 Simon Srot, simons@opencores.org\n");
|
PRINTF ("Copyright (C) 2001 Simon Srot, simons@opencores.org\n");
|
printf (" Marko Mlinar, markom@opencores.org\n");
|
PRINTF (" Marko Mlinar, markom@opencores.org\n");
|
printf ("Copyright (C) 2002 Marko Mlinar, markom@opencores.org\n");
|
PRINTF ("Copyright (C) 2002 Marko Mlinar, markom@opencores.org\n");
|
printf (" Simon Srot, simons@opencores.org\n");
|
PRINTF (" Simon Srot, simons@opencores.org\n");
|
printf ("Visit http://www.opencores.org for more information about ");
|
PRINTF ("Visit http://www.opencores.org for more information about ");
|
printf ("OpenRISC 1000 and\nother open source cores.\n\n");
|
PRINTF ("OpenRISC 1000 and\nother open source cores.\n\n");
|
printf ("This software comes with ABSOLUTELY NO WARRANTY; for ");
|
PRINTF ("This software comes with ABSOLUTELY NO WARRANTY; for ");
|
printf ("details see COPYING.\nThis is free software, and you ");
|
PRINTF ("details see COPYING.\nThis is free software, and you ");
|
printf ("are welcome to redistribute it under certain\nconditions; ");
|
PRINTF ("are welcome to redistribute it under certain\nconditions; ");
|
printf ("for details see COPYING.\n");
|
PRINTF ("for details see COPYING.\n");
|
}
|
}
|
|
|
void
|
void
|
help()
|
help()
|
{
|
{
|
printf("q - quit simulator\n");
|
PRINTF("q - quit simulator\n");
|
printf("r - display all registers\n");
|
PRINTF("r - display all registers\n");
|
printf("t - execute next instruction\n");
|
PRINTF("t - execute next instruction\n");
|
printf("run <instructions> [<hush>] - execute <instruction> instructions, no reg dump if hush\n");
|
PRINTF("run <instructions> [<hush>] - execute <instruction> instructions, no reg dump if hush\n");
|
printf("pr <r> <value> - patch register <r> with <value>\n");
|
PRINTF("pr <r> <value> - patch register <r> with <value>\n");
|
printf("dm <fromaddr> [<toaddr>] - display memory from <fromaddr> to <toaddr>\n");
|
PRINTF("dm <fromaddr> [<toaddr>] - display memory from <fromaddr> to <toaddr>\n");
|
printf("de <fromaddr> [<toaddr>] - debug insn memory\n");
|
PRINTF("de <fromaddr> [<toaddr>] - debug insn memory\n");
|
printf("pm <addr> <value> - patch memory location <addr> with <value>\n");
|
PRINTF("pm <addr> <value> - patch memory location <addr> with <value>\n");
|
printf("pc <value> - patch PC register with <value>\n");
|
PRINTF("pc <value> - patch PC register with <value>\n");
|
printf("break <addr> - toggle breakpoint at address <addr>\n");
|
PRINTF("break <addr> - toggle breakpoint at address <addr>\n");
|
printf("reset - simulator reset\n");
|
PRINTF("reset - simulator reset\n");
|
printf("hist - execution history\n");
|
PRINTF("hist - execution history\n");
|
printf("stall - stalls the processor and gives control to the debugger\n");
|
PRINTF("stall - stalls the processor and gives control to the debugger\n");
|
printf("stats <num|clear> - execution statistics num or clear it.\n");
|
PRINTF("stats <num|clear> - execution statistics num or clear it.\n");
|
printf("info - configuration info (caches etc.)\n");
|
PRINTF("info - configuration info (caches etc.)\n");
|
printf("dv <fromaddr> [<toaddr>] [<modname>] - dumps memory as verilog (use redirect)\n");
|
PRINTF("dv <fromaddr> [<toaddr>] [<modname>] - dumps memory as verilog (use redirect)\n");
|
printf("dh <fromaddr> [<toaddr>] - dumps memory as hex code (use redirect)\n");
|
PRINTF("dh <fromaddr> [<toaddr>] - dumps memory as hex code (use redirect)\n");
|
printf("<cmd> > <filename> - redirect simulator stdout to <filename> (and not emulated printf)\n");
|
PRINTF("<cmd> > <filename> - redirect simulator stdout to <filename> (and not emulated PRINTF)\n");
|
#if !FAST_SIM
|
#if !FAST_SIM
|
printf("set <section> <item> = <param> - set configuration. See sim.cfg for more information.\n");
|
PRINTF("set <section> <item> = <param> - set configuration. See sim.cfg for more information.\n");
|
printf("debug - toggles simulator debug mode\n");
|
PRINTF("debug - toggles simulator debug mode\n");
|
mp_help ();
|
mp_help ();
|
prof_help ();
|
prof_help ();
|
printf("cuc - enters Custom Unit Compiler command prompt\n");
|
PRINTF("cuc - enters Custom Unit Compiler command prompt\n");
|
#endif
|
#endif
|
printf("help - available commands (this list)\n");
|
PRINTF("help - available commands (this list)\n");
|
}
|
}
|
|
|
void debugmem (unsigned long from, unsigned long to );
|
void debugmem (unsigned long from, unsigned long to );
|
|
|
/* Resets all subunits */
|
/* Resets all subunits */
|
Line 213... |
Line 213... |
}
|
}
|
|
|
if (config.sim.exe_log) {
|
if (config.sim.exe_log) {
|
runtime.sim.fexe_log = fopen(config.sim.exe_log_fn, "wt+");
|
runtime.sim.fexe_log = fopen(config.sim.exe_log_fn, "wt+");
|
if(!runtime.sim.fexe_log) {
|
if(!runtime.sim.fexe_log) {
|
printf("ERROR: Problems opening exe_log file.\n");
|
PRINTF("ERROR: Problems opening exe_log file.\n");
|
exit (1);
|
exit (1);
|
}
|
}
|
}
|
}
|
|
|
if (config.sim.spr_log) {
|
if (config.sim.spr_log) {
|
printf("OPENING SPRLOG\n");
|
PRINTF("OPENING SPRLOG\n");
|
runtime.sim.fspr_log = fopen(config.sim.spr_log_fn, "wt+");
|
runtime.sim.fspr_log = fopen(config.sim.spr_log_fn, "wt+");
|
if (!runtime.sim.fspr_log) {
|
if (!runtime.sim.fspr_log) {
|
printf("ERROR: Problems opening spr_log file.\n");
|
PRINTF("ERROR: Problems opening spr_log file.\n");
|
exit(1);
|
exit(1);
|
}
|
}
|
}
|
}
|
|
|
/* Initialize memory */
|
/* Initialize memory */
|
Line 238... |
Line 238... |
unsigned int val = 0;
|
unsigned int val = 0;
|
|
|
if (config.memory.random_seed == -1) {
|
if (config.memory.random_seed == -1) {
|
runtime.memory.random_seed = time(NULL);
|
runtime.memory.random_seed = time(NULL);
|
/* Print out the seed just in case we ever need to debug */
|
/* Print out the seed just in case we ever need to debug */
|
printf("Seeding random generator with value %d\n", config.memory.random_seed);
|
PRINTF("Seeding random generator with value %d\n", config.memory.random_seed);
|
} else
|
} else
|
runtime.memory.random_seed = config.memory.random_seed;
|
runtime.memory.random_seed = config.memory.random_seed;
|
srandom(runtime.memory.random_seed);
|
srandom(runtime.memory.random_seed);
|
|
|
for (area = dev_list; area; area = area->next)
|
for (area = dev_list; area; area = area->next)
|
Line 301... |
Line 301... |
/* Start VAPI before device initialization. */
|
/* Start VAPI before device initialization. */
|
if (config.vapi.enabled) {
|
if (config.vapi.enabled) {
|
runtime.vapi.enabled = 1;
|
runtime.vapi.enabled = 1;
|
vapi_init ();
|
vapi_init ();
|
if (config.sim.verbose)
|
if (config.sim.verbose)
|
printf ("VAPI started, waiting for clients.\n");
|
PRINTF ("VAPI started, waiting for clients.\n");
|
}
|
}
|
|
|
sim_reset ();
|
sim_reset ();
|
|
|
lock_memory_table ();
|
lock_memory_table ();
|
|
|
/* Wait till all test are connected. */
|
/* Wait till all test are connected. */
|
if (runtime.vapi.enabled) {
|
if (runtime.vapi.enabled) {
|
int numu = vapi_num_unconnected (0);
|
int numu = vapi_num_unconnected (0);
|
if (numu) {
|
if (numu) {
|
printf ("\nWaiting for VAPI tests with ids:\n");
|
PRINTF ("\nWaiting for VAPI tests with ids:\n");
|
vapi_num_unconnected (1);
|
vapi_num_unconnected (1);
|
printf ("\n");
|
PRINTF ("\n");
|
while (numu = vapi_num_unconnected (0)) {
|
while (numu = vapi_num_unconnected (0)) {
|
vapi_check ();
|
vapi_check ();
|
printf ("\rStill waiting for %i VAPI test(s) to connect. ", numu);
|
PRINTF ("\rStill waiting for %i VAPI test(s) to connect. ", numu);
|
usleep (100);
|
usleep (100);
|
}
|
}
|
printf ("\n");
|
PRINTF ("\n");
|
}
|
}
|
printf ("All devices connected \n");
|
PRINTF ("All devices connected \n");
|
}
|
}
|
/* simulator is initialized */
|
/* simulator is initialized */
|
runtime.sim.init = 0;
|
runtime.sim.init = 0;
|
}
|
}
|
|
|
/* Display info about various modules */
|
/* Display info about various modules */
|
void sim_info () {
|
void sim_info () {
|
sprs_status();
|
sprs_status();
|
printf ("\n");
|
PRINTF ("\n");
|
memory_table_status ();
|
memory_table_status ();
|
if (config.immu.enabled) itlb_status(-1);
|
if (config.immu.enabled) itlb_status(-1);
|
if (config.dmmu.enabled) dtlb_status(-1);
|
if (config.dmmu.enabled) dtlb_status(-1);
|
if (config.ic.enabled) ic_info();
|
if (config.ic.enabled) ic_info();
|
if (config.dc.enabled) dc_info();
|
if (config.dc.enabled) dc_info();
|
Line 394... |
Line 394... |
int first_prompt = 1;
|
int first_prompt = 1;
|
|
|
srand(getpid());
|
srand(getpid());
|
init_defconfig();
|
init_defconfig();
|
if (parse_args(argc, argv)) {
|
if (parse_args(argc, argv)) {
|
printf("Usage: %s [options] <filename>\n", argv[0]);
|
PRINTF("Usage: %s [options] <filename>\n", argv[0]);
|
printf("Options:\n");
|
PRINTF("Options:\n");
|
printf(" -v version and copyright note\n");
|
PRINTF(" -v version and copyright note\n");
|
printf(" -i enable interactive command prompt\n");
|
PRINTF(" -i enable interactive command prompt\n");
|
printf(" --nosrv do not launch JTAG proxy server\n"); /* (CZ) */
|
PRINTF(" --nosrv do not launch JTAG proxy server\n"); /* (CZ) */
|
printf(" --srv <n> launch JTAG proxy server on port <n>; [random]\n"); /* (CZ) */
|
PRINTF(" --srv <n> launch JTAG proxy server on port <n>; [random]\n"); /* (CZ) */
|
#if !FAST_SIM
|
#if !FAST_SIM
|
printf(" -f or --file load script file [sim.cfg]\n");
|
PRINTF(" -f or --file load script file [sim.cfg]\n");
|
printf(" --enable-profile enable profiling.\n");
|
PRINTF(" --enable-profile enable profiling.\n");
|
printf(" --enable-mprofile enable memory profiling.\n");
|
PRINTF(" --enable-mprofile enable memory profiling.\n");
|
#endif
|
#endif
|
printf(" --output-cfg prints C structure of current\n");
|
PRINTF(" --output-cfg prints C structure of current\n");
|
printf(" configuration to standard output\n");
|
PRINTF(" configuration to standard output\n");
|
printf("\nor : %s ", argv[0]);
|
PRINTF("\nor : %s ", argv[0]);
|
mp_help ();
|
mp_help ();
|
printf("\nor : %s ", argv[0]);
|
PRINTF("\nor : %s ", argv[0]);
|
prof_help ();
|
prof_help ();
|
exit(-1);
|
exit(-1);
|
}
|
}
|
|
|
#ifdef HAVE_LIBREADLINE
|
#ifdef HAVE_LIBREADLINE
|
Line 430... |
Line 430... |
if (runtime.simcmd.mprofile) config.sim.mprofile = 1;
|
if (runtime.simcmd.mprofile) config.sim.mprofile = 1;
|
|
|
if (!runtime.sim.script_file_specified && config.sim.verbose)
|
if (!runtime.sim.script_file_specified && config.sim.verbose)
|
fprintf (stderr, "WARNING: No config file read, assuming default configuration.\n");
|
fprintf (stderr, "WARNING: No config file read, assuming default configuration.\n");
|
#else
|
#else
|
printf ("\n\tNOTE: running fast sim with fixed configuration!\n\n");
|
PRINTF ("\n\tNOTE: running fast sim with fixed configuration!\n\n");
|
#endif
|
#endif
|
if (runtime.sim.output_cfg) {
|
if (runtime.sim.output_cfg) {
|
output_cfg (stdout);
|
output_cfg (stdout);
|
exit (0);
|
exit (0);
|
}
|
}
|
Line 444... |
Line 444... |
|
|
while(1) {
|
while(1) {
|
if (runtime.sim.iprompt) {
|
if (runtime.sim.iprompt) {
|
if (config.debug.gdb_enabled)
|
if (config.debug.gdb_enabled)
|
{
|
{
|
printf ("(sim) ");
|
PRINTF ("(sim) ");
|
fflush(stdout);
|
fflush(stdout);
|
HandleServerSocket(true); /* block & check_stdin = true */
|
HandleServerSocket(true); /* block & check_stdin = true */
|
}
|
}
|
#ifdef HAVE_LIBREADLINE
|
#ifdef HAVE_LIBREADLINE
|
/* Must disable readline in new mode. It isn't compatible
|
/* Must disable readline in new mode. It isn't compatible
|
Line 457... |
Line 457... |
linestr = readline("(sim) ");
|
linestr = readline("(sim) ");
|
else
|
else
|
linestr = fgets(b2, sizeof b2, stdin);
|
linestr = fgets(b2, sizeof b2, stdin);
|
#else
|
#else
|
if(!config.debug.gdb_enabled)
|
if(!config.debug.gdb_enabled)
|
printf ("(sim) ");
|
PRINTF ("(sim) ");
|
linestr = fgets(b2, sizeof b2, stdin);
|
linestr = fgets(b2, sizeof b2, stdin);
|
#endif
|
#endif
|
} else
|
} else
|
strcpy(linestr = b2, "run -1 hush");
|
strcpy(linestr = b2, "run -1 hush");
|
|
|
Line 489... |
Line 489... |
#endif /* HAVE_LIBREADLINE */
|
#endif /* HAVE_LIBREADLINE */
|
|
|
if (redirstr = strstr(linestr, ">")) {
|
if (redirstr = strstr(linestr, ">")) {
|
*redirstr = '\0';
|
*redirstr = '\0';
|
strtoken(&redirstr[1], item1, 1);
|
strtoken(&redirstr[1], item1, 1);
|
freopen(item1, "w+", stdout);
|
runtime.sim.fout = fopen(item1, "w+");
|
|
if (!runtime.sim.fout) runtime.sim.fout = stdout;
|
}
|
}
|
|
|
if (linestr[0] == '\n')
|
if (linestr[0] == '\n')
|
strcpy (linestr, &prev_str[0]);
|
strcpy (linestr, &prev_str[0]);
|
else
|
else
|
strcpy (&prev_str[0], linestr);
|
strcpy (&prev_str[0], linestr);
|
|
|
strtoken(linestr, item1, 1);
|
strtoken(linestr, item1, 1);
|
if (strcmp(item1, "q") == 0) { /* quit */
|
if (strcmp(item1, "q") == 0) { /* quit */
|
printf ("\n");
|
PRINTF ("\n");
|
sim_done ();
|
sim_done ();
|
} else
|
} else
|
if (strcmp(item1, "help") == 0) /* help */
|
if (strcmp(item1, "help") == 0) /* help */
|
help();
|
help();
|
else
|
else
|
Line 526... |
Line 527... |
to = from + 0x40;
|
to = from + 0x40;
|
}
|
}
|
if (strlen(item3))
|
if (strlen(item3))
|
to = strtoul(item3, NULL, 0);
|
to = strtoul(item3, NULL, 0);
|
dumpmemory(from, to, 0, 1);
|
dumpmemory(from, to, 0, 1);
|
printf("\n");
|
PRINTF("\n");
|
} else
|
} else
|
if (strcmp(item1, "dv") == 0) {/* dump memory as verilog*/
|
if (strcmp(item1, "dv") == 0) {/* dump memory as verilog*/
|
char item2[20];
|
char item2[20];
|
char item3[20];
|
char item3[20];
|
char item4[20];
|
char item4[20];
|
Line 550... |
Line 551... |
if (strlen(item3))
|
if (strlen(item3))
|
to = strtoul(item3, NULL, 0);
|
to = strtoul(item3, NULL, 0);
|
if (!strlen(item4))
|
if (!strlen(item4))
|
strcpy(item4, "or1k_mem");
|
strcpy(item4, "or1k_mem");
|
dumpverilog(item4, from, to);
|
dumpverilog(item4, from, to);
|
printf("\n");
|
PRINTF("\n");
|
} else
|
} else
|
if (strcmp(item1, "dh") == 0) {/* dump memory as hex*/
|
if (strcmp(item1, "dh") == 0) {/* dump memory as hex*/
|
char item2[20];
|
char item2[20];
|
char item3[20];
|
char item3[20];
|
static int from = 0, to = 0;
|
static int from = 0, to = 0;
|
Line 570... |
Line 571... |
to = from + 0x40;
|
to = from + 0x40;
|
}
|
}
|
if (strlen(item3))
|
if (strlen(item3))
|
to = strtoul(item3, NULL, 0);
|
to = strtoul(item3, NULL, 0);
|
dumphex(from, to);
|
dumphex(from, to);
|
printf("\n");
|
PRINTF("\n");
|
} else
|
} else
|
if (strcmp(item1, "pm") == 0) { /* patch memory */
|
if (strcmp(item1, "pm") == 0) { /* patch memory */
|
char item2[20];
|
char item2[20];
|
char item3[20];
|
char item3[20];
|
static int addr = 0;
|
static int addr = 0;
|
Line 628... |
Line 629... |
to = from + 0x40;
|
to = from + 0x40;
|
}
|
}
|
if (strlen(item3))
|
if (strlen(item3))
|
to = strtoul(item3, NULL, 0);
|
to = strtoul(item3, NULL, 0);
|
debugmem(from, to);
|
debugmem(from, to);
|
printf("\n");
|
PRINTF("\n");
|
} else
|
} else
|
if (strcmp(item1, "reset") == 0) { /* reset simulator */
|
if (strcmp(item1, "reset") == 0) { /* reset simulator */
|
sim_reset();
|
sim_reset();
|
} else
|
} else
|
#if !FAST_SIM
|
#if !FAST_SIM
|
Line 642... |
Line 643... |
#endif
|
#endif
|
if (strcmp(item1, "hist") == 0) { /* dump history */
|
if (strcmp(item1, "hist") == 0) { /* dump history */
|
int i;
|
int i;
|
for(i = HISTEXEC_LEN; i; i--)
|
for(i = HISTEXEC_LEN; i; i--)
|
dumpmemory(histexec[i - 1], histexec[i - 1] + 4, 1, 1);
|
dumpmemory(histexec[i - 1], histexec[i - 1] + 4, 1, 1);
|
printf("\n");
|
PRINTF("\n");
|
} else
|
} else
|
if (strcmp(item1, "run") == 0) { /* run */
|
if (strcmp(item1, "run") == 0) { /* run */
|
char item2[20];
|
char item2[20];
|
char item3[20];
|
char item3[20];
|
|
|
Line 669... |
Line 670... |
int i = 0;
|
int i = 0;
|
|
|
strtoken(linestr, item2, 2);
|
strtoken(linestr, item2, 2);
|
if (strcmp(item2, "clear") == 0) {
|
if (strcmp(item2, "clear") == 0) {
|
initstats();
|
initstats();
|
printf("Cleared.\n");
|
PRINTF("Cleared.\n");
|
} else {
|
} else {
|
i = strtoul(item2, NULL, 0);
|
i = strtoul(item2, NULL, 0);
|
printstats(i);
|
printstats(i);
|
}
|
}
|
} else
|
} else
|
Line 701... |
Line 702... |
extern struct section sections[];
|
extern struct section sections[];
|
while (*s != ' ' && *s) s++;
|
while (*s != ' ' && *s) s++;
|
set_config_command (s);
|
set_config_command (s);
|
} else
|
} else
|
#endif /* !FAST_SIM */
|
#endif /* !FAST_SIM */
|
printf("%s: Unknown command.\n", linestr);
|
PRINTF("%s: Unknown command.\n", linestr);
|
|
|
{ /* Needed by execution */
|
{ /* Needed by execution */
|
extern int do_stats;
|
extern int do_stats;
|
do_stats = config.cpu.dependstats || config.cpu.superscalar || config.cpu.dependstats
|
do_stats = config.cpu.dependstats || config.cpu.superscalar || config.cpu.dependstats
|
|| config.sim.history || config.sim.exe_log;
|
|| config.sim.history || config.sim.exe_log;
|
Line 750... |
Line 751... |
if (runtime.sim.cycles >= SCHED_PEEK().time) do_scheduler ();
|
if (runtime.sim.cycles >= SCHED_PEEK().time) do_scheduler ();
|
if (!hush) dumpreg();
|
if (!hush) dumpreg();
|
}
|
}
|
hush = 0;
|
hush = 0;
|
fflush(stdout);
|
fflush(stdout);
|
freopen("/dev/fd/0", "w+", stdout);
|
runtime.sim.fout = stdout;
|
|
|
if (!runtime.sim.iprompt) /* non-interactive quit */
|
if (!runtime.sim.iprompt) /* non-interactive quit */
|
sim_done();
|
sim_done();
|
|
|
#ifdef HAVE_LIBREADLINE
|
#ifdef HAVE_LIBREADLINE
|
Line 854... |
Line 855... |
|
|
extern char *disassembled;
|
extern char *disassembled;
|
void debugmem( unsigned long from, unsigned long to )
|
void debugmem( unsigned long from, unsigned long to )
|
{
|
{
|
int i;
|
int i;
|
printf("starting to dump mem...\n");
|
PRINTF("starting to dump mem...\n");
|
for(i=from; i<to; ) {
|
for(i=from; i<to; ) {
|
struct label_entry *entry;
|
struct label_entry *entry;
|
unsigned int _insn;
|
unsigned int _insn;
|
printf("i=%x :: ", i);
|
PRINTF("i=%x :: ", i);
|
|
|
if (verify_memoryarea(i) && (entry = get_label(i)))
|
if (verify_memoryarea(i) && (entry = get_label(i)))
|
printf("label: %s |", entry->name);
|
PRINTF("label: %s |", entry->name);
|
|
|
iqueue[0].insn = _insn = evalsim_mem32(i);
|
iqueue[0].insn = _insn = evalsim_mem32(i);
|
iqueue[0].insn_index = insn_decode(_insn);
|
iqueue[0].insn_index = insn_decode(_insn);
|
disassemble_insn (_insn);
|
disassemble_insn (_insn);
|
printf("%08x %s\n", _insn, disassembled);
|
PRINTF("%08x %s\n", _insn, disassembled);
|
i += insn_len( iqueue[0].insn_index );
|
i += insn_len( iqueue[0].insn_index );
|
}
|
}
|
}
|
}
|
|
|
No newline at end of file
|
No newline at end of file
|