VAX780: Added idle support for SysVR2

A new idle mode (SYSV) is now available:

    sim> SET CPU IDLE=SYSV
This commit is contained in:
Mark Pizzolato 2014-09-04 14:08:59 -07:00
parent 0dff1076a0
commit 26cf38804b
2 changed files with 16 additions and 5 deletions

View file

@ -491,7 +491,7 @@ REG cpu_reg[] = {
MTAB cpu_mod[] = { MTAB cpu_mod[] = {
{ UNIT_CONH, 0, "HALT to SIMH", "SIMHALT", NULL, NULL, NULL, "Set HALT to trap to simulator" }, { UNIT_CONH, 0, "HALT to SIMH", "SIMHALT", NULL, NULL, NULL, "Set HALT to trap to simulator" },
{ UNIT_CONH, UNIT_CONH, "HALT to console", "CONHALT", NULL, NULL, NULL, "Set HALT to trap to console ROM" }, { UNIT_CONH, UNIT_CONH, "HALT to console", "CONHALT", NULL, NULL, NULL, "Set HALT to trap to console ROM" },
{ MTAB_XTD|MTAB_VDV, 0, "IDLE", "IDLE={VMS|ULTRIX|NETBSD|OPENBSD|ULTRIXOLD|OPENBSDOLD|QUASIJARUS|32V|ALL}", &cpu_set_idle, &cpu_show_idle, NULL, "Display idle detection mode" }, { MTAB_XTD|MTAB_VDV, 0, "IDLE", "IDLE={VMS|ULTRIX|NETBSD|OPENBSD|ULTRIXOLD|OPENBSDOLD|QUASIJARUS|32V|SYSV|ALL}", &cpu_set_idle, &cpu_show_idle, NULL, "Display idle detection mode" },
{ MTAB_XTD|MTAB_VDV, 0, NULL, "NOIDLE", &sim_clr_idle, NULL, NULL, "Disables idle detection" }, { MTAB_XTD|MTAB_VDV, 0, NULL, "NOIDLE", &sim_clr_idle, NULL, NULL, "Disables idle detection" },
MEM_MODIFIERS, /* Model specific memory modifiers from vaxXXX_defs.h */ MEM_MODIFIERS, /* Model specific memory modifiers from vaxXXX_defs.h */
{ MTAB_XTD|MTAB_VDV|MTAB_NMO|MTAB_SHP, 0, "HISTORY", "HISTORY", { MTAB_XTD|MTAB_VDV|MTAB_NMO|MTAB_SHP, 0, "HISTORY", "HISTORY",
@ -2476,7 +2476,15 @@ for ( ;; ) {
case BLBC: case BLBC:
if ((op0 & 1) == 0) /* br if bit clear */ if ((op0 & 1) == 0) /* br if bit clear */
{
BRANCHB (brdisp); BRANCHB (brdisp);
if (((cpu_idle_mask & VAX_IDLE_SYSV) != 0) &&/* running System V? */
(PC == fault_PC) && /* to self? */
(fault_PC & 0x80000000) && /* in system space? */
(PSL_GETIPL (PSL) == 0x0) && /* at IPL 0? */
(PSL_GETCUR(PSL) == KERN)) /* in Kernel Mode? */
cpu_idle (); /* idle loop */
}
break; break;
/* Extract field instructions - ext?v pos.rl,size.rb,base.wb,dst.wl /* Extract field instructions - ext?v pos.rl,size.rb,base.wb,dst.wl
@ -3538,7 +3546,8 @@ static struct os_idle os_tab[] = {
{ "OPENBSD", VAX_IDLE_BSDNEW }, { "OPENBSD", VAX_IDLE_BSDNEW },
{ "QUASIJARUS", VAX_IDLE_QUAD }, { "QUASIJARUS", VAX_IDLE_QUAD },
{ "32V", VAX_IDLE_QUAD }, { "32V", VAX_IDLE_QUAD },
{ "ALL", VAX_IDLE_VMS|VAX_IDLE_ULTOLD|VAX_IDLE_ULT|VAX_IDLE_ULT1X|VAX_IDLE_QUAD|VAX_IDLE_BSDNEW }, { "SYSV", VAX_IDLE_SYSV },
{ "ALL", VAX_IDLE_VMS|VAX_IDLE_ULTOLD|VAX_IDLE_ULT|VAX_IDLE_ULT1X|VAX_IDLE_QUAD|VAX_IDLE_BSDNEW|VAX_IDLE_SYSV },
{ NULL, 0 } { NULL, 0 }
}; };
@ -3642,13 +3651,14 @@ fprintf (st, " -u interpret address as virtual, user mode\n\n");
fprintf (st, "The CPU attempts to detect when the simulator is idle. When idle, the\n"); fprintf (st, "The CPU attempts to detect when the simulator is idle. When idle, the\n");
fprintf (st, "simulator does not use any resources on the host system. Idle detection is\n"); fprintf (st, "simulator does not use any resources on the host system. Idle detection is\n");
fprintf (st, "controlled by the SET IDLE and SET NOIDLE commands:\n\n"); fprintf (st, "controlled by the SET IDLE and SET NOIDLE commands:\n\n");
fprintf (st, " sim> SET CPU IDLE{=VMS|ULTRIX|NETBSD|FREEBSD|32V|ALL}\n"); fprintf (st, " sim> SET CPU IDLE{=VMS|ULTRIX|NETBSD|FREEBSD|32V|SYSV|ALL}\n");
fprintf (st, " enable idle detection\n"); fprintf (st, " enable idle detection\n");
fprintf (st, " sim> SET CPU NOIDLE disable idle detection\n\n"); fprintf (st, " sim> SET CPU NOIDLE disable idle detection\n\n");
fprintf (st, "Idle detection is disabled by default. Unless ALL is specified, idle\n"); fprintf (st, "Idle detection is disabled by default. Unless ALL is specified, idle\n");
fprintf (st, "detection is operating system specific. If idle detection is enabled with\n"); fprintf (st, "detection is operating system specific. If idle detection is enabled with\n");
fprintf (st, "an incorrect operating system setting, simulator performance could be\n"); fprintf (st, "an incorrect operating system setting, simulator performance or correct\n");
fprintf (st, "impacted. The default operating system setting is VMS.\n\n"); fprintf (st, "functionality could be impacted. The default operating system setting is\n");
fprintf (st, "VMS.\n\n");
fprintf (st, "The CPU can maintain a history of the most recently executed instructions.\n"); fprintf (st, "The CPU can maintain a history of the most recently executed instructions.\n");
fprintf (st, "This is controlled by the SET CPU HISTORY and SHOW CPU HISTORY commands:\n\n"); fprintf (st, "This is controlled by the SET CPU HISTORY and SHOW CPU HISTORY commands:\n\n");
fprintf (st, " sim> SET CPU HISTORY clear history buffer\n"); fprintf (st, " sim> SET CPU HISTORY clear history buffer\n");

View file

@ -724,6 +724,7 @@ enum opcodes {
#define VAX_IDLE_ULT1X 0x08 /* Ultrix 1.x */ #define VAX_IDLE_ULT1X 0x08 /* Ultrix 1.x */
#define VAX_IDLE_QUAD 0x10 #define VAX_IDLE_QUAD 0x10
#define VAX_IDLE_BSDNEW 0x20 #define VAX_IDLE_BSDNEW 0x20
#define VAX_IDLE_SYSV 0x40
extern uint32 cpu_idle_mask; /* idle mask */ extern uint32 cpu_idle_mask; /* idle mask */
void cpu_idle (void); void cpu_idle (void);