Line 32... |
Line 32... |
#include "abstract.h"
|
#include "abstract.h"
|
#include "trace.h"
|
#include "trace.h"
|
#include "execute.h"
|
#include "execute.h"
|
|
|
/* CVS revision number. */
|
/* CVS revision number. */
|
static const char rcsrev[] = "$Revision: 1.1.1.1 $";
|
static const char rcsrev[] = "$Revision: 1.2 $";
|
|
|
/* 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 89... |
Line 89... |
printf("dm <fromaddr> [<toaddr>] - display memory from <fromaddr> to <toaddr>\n");
|
printf("dm <fromaddr> [<toaddr>] - display memory from <fromaddr> to <toaddr>\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("brk <addr> - toggle breakpoint at address <addr>\n");
|
printf("brk <addr> - toggle breakpoint at address <addr>\n");
|
printf("hist - execution history\n");
|
printf("hist - execution history\n");
|
|
printf("stats <num|clear> - execution statistics num or clear it.\n");
|
|
printf("info - configuration info (caches etc.)\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");
|
printf("help - available commands (this list)\n");
|
printf("help - available commands (this list)\n");
|
}
|
}
|
|
|
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
Line 106... |
Line 108... |
printf("Usage: %s <filename>\n", argv[0]);
|
printf("Usage: %s <filename>\n", argv[0]);
|
exit(-1);
|
exit(-1);
|
}
|
}
|
|
|
version();
|
version();
|
|
init_defconfig();
|
signal(SIGINT, ctrl_c);
|
signal(SIGINT, ctrl_c);
|
initstats();
|
initstats();
|
loadcode(argv[1]);
|
loadcode(argv[1]);
|
reset();
|
reset();
|
while(1) {
|
while(1) {
|
Line 204... |
Line 207... |
else
|
else
|
hush = 0;
|
hush = 0;
|
cont_run = strtoul(item2, NULL, 0);
|
cont_run = strtoul(item2, NULL, 0);
|
} else
|
} else
|
if (strcmp(item1, "stats") == 0) { /* stats */
|
if (strcmp(item1, "stats") == 0) { /* stats */
|
printstats();
|
char item2[20];
|
|
int i = 0;
|
|
|
|
strtoken(linestr, item2, 2);
|
|
if (strcmp(item2, "clear") == 0) {
|
|
initstats();
|
|
printf("Cleared.\n");
|
|
} else {
|
|
i = strtoul(item2, NULL, 0);
|
|
printstats(i);
|
|
}
|
|
} else
|
|
if (strcmp(item1, "info") == 0) { /* configuration info */
|
|
bpb_info();
|
|
btic_info();
|
|
ic_info();
|
|
dc_info();
|
}
|
}
|
|
|
while(cont_run) {
|
while(cont_run) {
|
cont_run--;
|
cont_run--;
|
fetch();
|
fetch();
|