diff --git a/PDP10/pdp10_cpu.c b/PDP10/pdp10_cpu.c index 34dd92d1..af508f79 100644 --- a/PDP10/pdp10_cpu.c +++ b/PDP10/pdp10_cpu.c @@ -2358,6 +2358,10 @@ static const char *pdp10_clock_precalibrate_commands[] = { "PC 100", NULL}; +static const char *pdp10_clock_precalibrate_cleanup_commands[] = { + "0-120 0", + NULL}; + /* Reset routine */ t_stat cpu_reset (DEVICE *dptr) @@ -2380,6 +2384,7 @@ if (M == NULL) sim_vm_pc_value = &pdp10_pc_value; sim_vm_is_subroutine_call = &cpu_is_pc_a_subroutine_call; sim_clock_precalibrate_commands = pdp10_clock_precalibrate_commands; +sim_clock_precalibrate_cleanup_commands = pdp10_clock_precalibrate_cleanup_commands; sim_vm_initial_ips = 2 * SIM_INITIAL_IPS; pcq_r = find_reg ("PCQ", NULL, dptr); if (pcq_r) diff --git a/PDP11/pdp11_cpu.c b/PDP11/pdp11_cpu.c index 63359927..3cb280c1 100644 --- a/PDP11/pdp11_cpu.c +++ b/PDP11/pdp11_cpu.c @@ -3413,6 +3413,10 @@ static const char *pdp11_clock_precalibrate_commands[] = { "PC 100", NULL}; +static const char *pdp11_clock_precalibrate_cleanup_commands[] = { + "100-200 0", + NULL}; + /* Special boot command - linked into SCP by initial reset Syntax: BOOT {CPU} @@ -3480,6 +3484,7 @@ if (M == NULL) { /* First time init */ sim_brk_type_desc = cpu_breakpoints; sim_vm_is_subroutine_call = &cpu_is_pc_a_subroutine_call; sim_clock_precalibrate_commands = pdp11_clock_precalibrate_commands; + sim_clock_precalibrate_cleanup_commands = pdp11_clock_precalibrate_cleanup_commands; auto_config(NULL, 0); /* do an initial auto configure */ } pcq_r = find_reg ("PCQ", NULL, dptr); diff --git a/PDP8/pdp8_cpu.c b/PDP8/pdp8_cpu.c index 35ab239b..3abf4c26 100644 --- a/PDP8/pdp8_cpu.c +++ b/PDP8/pdp8_cpu.c @@ -1387,6 +1387,10 @@ static const char *pdp8_clock_precalibrate_commands[] = { "PC 100", NULL}; +static const char *pdp8_clock_precalibrate_cleanup_commands[] = { + "100-112 0", + NULL}; + /* Reset routine */ t_stat cpu_reset (DEVICE *dptr) @@ -1401,6 +1405,7 @@ if (pcq_r) else return SCPE_IERR; sim_clock_precalibrate_commands = pdp8_clock_precalibrate_commands; +sim_clock_precalibrate_cleanup_commands = pdp8_clock_precalibrate_cleanup_commands; sim_vm_initial_ips = 10 * SIM_INITIAL_IPS; sim_brk_types = SWMASK ('E') | SWMASK('I'); sim_brk_dflt = SWMASK ('E'); diff --git a/SDS/sds_cpu.c b/SDS/sds_cpu.c index 103691cd..8d525dda 100644 --- a/SDS/sds_cpu.c +++ b/SDS/sds_cpu.c @@ -1806,12 +1806,17 @@ static const char *sds_clock_precalibrate_commands[] = { "111 BRU 100", NULL}; +static const char *sds_clock_precalibrate_cleanup_commands[] = { + "100-120 0", + NULL}; + /* Clock reset */ t_stat rtc_reset (DEVICE *dptr) { sim_clock_precalibrate_commands = sds_clock_precalibrate_commands; +sim_clock_precalibrate_cleanup_commands = sds_clock_precalibrate_cleanup_commands; rtc_pie = 0; /* disable pulse */ rtc_unit.wait = sim_rtcn_init (rtc_unit.wait, TMR_RTC); /* initialize clock calibration */ sim_activate (&rtc_unit, rtc_unit.wait); /* activate unit */ diff --git a/VAX/vax_cpu.c b/VAX/vax_cpu.c index b9a2a49b..37ddc2f3 100644 --- a/VAX/vax_cpu.c +++ b/VAX/vax_cpu.c @@ -3324,6 +3324,10 @@ static const char *vax_clock_precalibrate_commands[] = { "PC 100", NULL}; +static const char *vax_clock_precalibrate_cleanup_commands[] = { + "100-140 0", + NULL}; + /* Reset */ t_stat cpu_reset (DEVICE *dptr) @@ -3341,6 +3345,7 @@ if (M == NULL) { /* first time init? */ sim_brk_types = sim_brk_dflt = SWMASK ('E'); sim_vm_is_subroutine_call = cpu_is_pc_a_subroutine_call; sim_clock_precalibrate_commands = vax_clock_precalibrate_commands; + sim_clock_precalibrate_cleanup_commands = vax_clock_precalibrate_cleanup_commands; sim_vm_initial_ips = SIM_INITIAL_IPS; pcq_r = find_reg ("PCQ", NULL, dptr); if (pcq_r == NULL) diff --git a/doc/simh.doc b/doc/simh.doc index 9f6dd638..244ddc2a 100644 Binary files a/doc/simh.doc and b/doc/simh.doc differ diff --git a/scp.c b/scp.c index 168b7829..70595633 100644 --- a/scp.c +++ b/scp.c @@ -483,6 +483,7 @@ t_bool (*sim_vm_fprint_stopped) (FILE *st, t_stat reason) = NULL; const char *sim_vm_release = NULL; const char *sim_vm_release_message = NULL; const char **sim_clock_precalibrate_commands = NULL; +const char **sim_clock_precalibrate_cleanup_commands = NULL; /* Prototypes */ diff --git a/scp.h b/scp.h index b7ee0b5f..52a8be39 100644 --- a/scp.h +++ b/scp.h @@ -391,6 +391,7 @@ extern t_value (*sim_vm_pc_value) (void); extern t_bool (*sim_vm_is_subroutine_call) (t_addr **ret_addrs); extern void (*sim_vm_reg_update) (REG *rptr, uint32 idx, t_value prev_val, t_value new_val); extern const char **sim_clock_precalibrate_commands; +extern const char **sim_clock_precalibrate_cleanup_commands; extern uint32 sim_vm_initial_ips; /* base estimate of simulated instructions per second */ extern const char *sim_vm_interval_units; /* Simulator can change this - default "instructions" */ extern const char *sim_vm_step_unit; /* Simulator can change this - default "instruction" */ diff --git a/sim_timer.c b/sim_timer.c index 5676dde9..a5aa0e70 100644 --- a/sim_timer.c +++ b/sim_timer.c @@ -3820,6 +3820,10 @@ for (tmr=0; tmr<=SIM_NTIMERS; tmr++) { if (rtc->hz) rtc->initd = rtc->currd = (int32)(((double)sim_precalibrate_ips) / rtc->hz); } +if ((cmd = sim_clock_precalibrate_cleanup_commands)) { + while (*cmd) + exdep_cmd (EX_D, *(cmd++)); + } reset_all_p (0); sim_run_boot_prep (RU_GO); for (tmr=0; tmr<=SIM_NTIMERS; tmr++) {