VAX: Add command support to set the idle stability delay

SET CPU IDLE={OS{:n}} where n is the idle stability delay
which is also the clock calibration delay.
A -D switch on a SHOW -D CPU IDLE command will
display the stability delay as will a SHOW CLOCK command.
This commit is contained in:
Mark Pizzolato 2016-02-23 17:07:12 -08:00
parent 2e21baffa8
commit 49d3ec8ff7
2 changed files with 16 additions and 5 deletions

View file

@ -3600,13 +3600,15 @@ static struct os_idle os_tab[] = {
t_stat cpu_set_idle (UNIT *uptr, int32 val, char *cptr, void *desc)
{
uint32 i;
char gbuf[CBUFSIZE];
if (cptr != NULL) {
cptr = get_glyph (cptr, gbuf, ':');
for (i = 0; os_tab[i].name != NULL; i++) {
if (strcmp (os_tab[i].name, cptr) == 0) {
if (strcmp (os_tab[i].name, gbuf) == 0) {
cpu_idle_type = i + 1;
cpu_idle_mask = os_tab[i].mask;
return sim_set_idle (uptr, val, NULL, desc);
return sim_set_idle (uptr, val, cptr, desc);
}
}
return SCPE_ARG;
@ -3684,14 +3686,16 @@ 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, "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, " sim> SET CPU IDLE{=VMS|ULTRIX|NETBSD|FREEBSD|32V|ELN|ALL}\n");
fprintf (st, " sim> SET CPU IDLE{=VMS|ULTRIX|NETBSD|FREEBSD|32V|ELN|ALL}{:n}\n");
fprintf (st, " enable idle detection\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, "detection is operating system specific. If idle detection is enabled with\n");
fprintf (st, "an incorrect operating system setting, simulator performance or correct\n");
fprintf (st, "functionality could be impacted. The default operating system setting is\n");
fprintf (st, "VMS.\n\n");
fprintf (st, "VMS. The value 'n', if present in the \"SET CPU IDLE={OS}:n\" command,\n");
fprintf (st, "indicated the number of seconds which the simulator must run before idling\n");
fprintf (st, "(and clock calibration) starts.\n\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, " sim> SET CPU HISTORY clear history buffer\n");

View file

@ -723,9 +723,12 @@ int i;
uint32 clock_start, clock_last, clock_now;
sim_debug (DBG_TRC, &sim_timer_dev, "sim_timer_init()\n");
for (i=0; i<SIM_NTIMERS; i++)
for (i=0; i<SIM_NTIMERS; i++) {
sim_timer_units[i].action = &sim_timer_tick_svc;
sim_timer_units[i].flags = UNIT_DIS;
}
sim_timer_units[SIM_NTIMERS].action = &sim_throt_svc;
sim_timer_units[SIM_NTIMERS].flags = UNIT_DIS;
sim_register_internal_device (&sim_timer_dev);
sim_idle_enab = FALSE; /* init idle off */
sim_idle_rate_ms = sim_os_ms_sleep_init (); /* get OS timer rate */
@ -761,6 +764,9 @@ t_stat sim_show_timers (FILE* st, DEVICE *dptr, UNIT* uptr, int32 val, char* des
{
int tmr, clocks;
fprintf (st, "Minimum Host Sleep Time: %dms\n", sim_os_sleep_min_ms);
fprintf (st, "Host Clock Resolution: %dms\n", sim_os_clock_resoluton_ms);
fprintf (st, "Time before Clock Calibration: %d seconds\n\n", sim_idle_stable);
for (tmr=clocks=0; tmr<SIM_NTIMERS; ++tmr) {
if (0 == rtc_initd[tmr])
continue;
@ -1405,6 +1411,7 @@ for (i = 0; i < SIM_NTIMERS; i++)
if (i == SIM_NTIMERS) { /* No clocks have signed in. */
/* setup internal clock */
sim_timer_units[SIM_NTIMERS+1].action = &sim_timer_clock_tick_svc;
sim_timer_units[SIM_NTIMERS+1].flags = UNIT_DIS;
}
if (sim_timer_units[SIM_NTIMERS+1].action == &sim_timer_clock_tick_svc) {
/* actual clock reset */