FRONTPANEL: Add compile time logic to enable debugging of protocol between API and simulator.
This commit is contained in:
parent
e69c3adf5f
commit
93ebfeb5ee
1 changed files with 20 additions and 6 deletions
|
@ -111,27 +111,34 @@ printf ("^C to Halt, Commands: BOOT, CONT, EXIT\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
volatile int halt_cpu = 0;
|
volatile int halt_cpu = 0;
|
||||||
|
PANEL *panel, *tape;
|
||||||
|
|
||||||
void halt_handler (int sig)
|
void halt_handler (int sig)
|
||||||
{
|
{
|
||||||
signal (SIGINT, halt_handler); /* Re-establish handler for some platforms that implement ONESHOT signal dispatch */
|
signal (SIGINT, halt_handler); /* Re-establish handler for some platforms that implement ONESHOT signal dispatch */
|
||||||
halt_cpu = 1;
|
halt_cpu = 1;
|
||||||
|
sim_panel_flush_debug (panel);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
PANEL *panel, *tape;
|
|
||||||
FILE *f;
|
FILE *f;
|
||||||
|
|
||||||
/* Create pseudo config file for a test */
|
/* Create pseudo config file for a test */
|
||||||
if ((f = fopen (sim_config, "w"))) {
|
if ((f = fopen (sim_config, "w"))) {
|
||||||
|
#if defined(PANEL_DEBUG)
|
||||||
|
fprintf (f, "set debug -n -a simulator.dbg\n");
|
||||||
|
fprintf (f, "set cpu conhalt\n");
|
||||||
|
fprintf (f, "set remote telnet=2226\n");
|
||||||
|
fprintf (f, "set rem-con debug=XMT;RCV\n");
|
||||||
|
fprintf (f, "set remote notelnet\n");
|
||||||
|
#endif /* defined(PANEL_DEBUG) */
|
||||||
fprintf (f, "set cpu autoboot\n");
|
fprintf (f, "set cpu autoboot\n");
|
||||||
fprintf (f, "set cpu 64\n");
|
fprintf (f, "set cpu 64\n");
|
||||||
fprintf (f, "set cpu conhalt\n");
|
|
||||||
fprintf (f, "set console telnet=buffered\n");
|
fprintf (f, "set console telnet=buffered\n");
|
||||||
fprintf (f, "set console telnet=1923\n");
|
fprintf (f, "set console telnet=1927\n");
|
||||||
fclose (f);
|
fclose (f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,6 +153,11 @@ if (!panel) {
|
||||||
goto Done;
|
goto Done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(PANEL_DEBUG)
|
||||||
|
sim_panel_set_debug_file (panel, "frontpanel.dbg");
|
||||||
|
sim_panel_set_debug_mode (panel, DBG_XMT|DBG_RCV);
|
||||||
|
#endif /* defined(PANEL_DEBUG) */
|
||||||
|
|
||||||
tape = sim_panel_add_device_panel (panel, "TAPE DRIVE");
|
tape = sim_panel_add_device_panel (panel, "TAPE DRIVE");
|
||||||
|
|
||||||
if (!tape) {
|
if (!tape) {
|
||||||
|
@ -250,16 +262,18 @@ while (1) {
|
||||||
if (sim_panel_exec_boot (panel, cmd + 4))
|
if (sim_panel_exec_boot (panel, cmd + 4))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!strcmp("STEP", cmd)) {
|
else if (!strcmp("STEP", cmd)) {
|
||||||
if (sim_panel_exec_step (panel))
|
if (sim_panel_exec_step (panel))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!strcmp("CONT", cmd)) {
|
else if (!strcmp("CONT", cmd)) {
|
||||||
if (sim_panel_exec_run (panel))
|
if (sim_panel_exec_run (panel))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!strcmp("EXIT", cmd))
|
else if (!strcmp("EXIT", cmd))
|
||||||
goto Done;
|
goto Done;
|
||||||
|
else
|
||||||
|
printf ("Huh? %s\r\n", cmd);
|
||||||
}
|
}
|
||||||
while (sim_panel_get_state (panel) == Run) {
|
while (sim_panel_get_state (panel) == Run) {
|
||||||
usleep (100);
|
usleep (100);
|
||||||
|
|
Loading…
Add table
Reference in a new issue