tmr 349 src/simh/sim_timer.c int32 tmr; tmr 351 src/simh/sim_timer.c for (tmr = 0; tmr <= SIM_NTIMERS; tmr++) tmr 352 src/simh/sim_timer.c if (rtc_initd[tmr] != 0) tmr 353 src/simh/sim_timer.c sim_rtcn_init (rtc_initd[tmr], tmr); tmr 357 src/simh/sim_timer.c int32 sim_rtcn_init (int32 time, int32 tmr) tmr 359 src/simh/sim_timer.c return sim_rtcn_init_unit (NULL, time, tmr); tmr 362 src/simh/sim_timer.c int32 sim_rtcn_init_unit (UNIT *uptr, int32 time, int32 tmr) tmr 366 src/simh/sim_timer.c if (tmr == SIM_INTERNAL_CLK) tmr 367 src/simh/sim_timer.c tmr = SIM_NTIMERS; tmr 369 src/simh/sim_timer.c if ((tmr < 0) || (tmr >= SIM_NTIMERS)) tmr 377 src/simh/sim_timer.c if (rtc_currd[tmr]) tmr 378 src/simh/sim_timer.c time = rtc_currd[tmr]; tmr 380 src/simh/sim_timer.c uptr = sim_clock_unit[tmr]; tmr 381 src/simh/sim_timer.c sim_debug (DBG_CAL, &sim_timer_dev, "_sim_rtcn_init_unit(unit=%s, time=%d, tmr=%d)\n", sim_uname(uptr), time, tmr); tmr 383 src/simh/sim_timer.c if (!sim_clock_unit[tmr]) tmr 384 src/simh/sim_timer.c sim_register_clock_unit_tmr (uptr, tmr); tmr 386 src/simh/sim_timer.c rtc_clock_start_gtime[tmr] = sim_gtime(); tmr 387 src/simh/sim_timer.c rtc_rtime[tmr] = sim_os_msec (); tmr 388 src/simh/sim_timer.c rtc_vtime[tmr] = rtc_rtime[tmr]; tmr 389 src/simh/sim_timer.c rtc_nxintv[tmr] = 1000; tmr 390 src/simh/sim_timer.c rtc_ticks[tmr] = 0; tmr 391 src/simh/sim_timer.c rtc_hz[tmr] = 0; tmr 392 src/simh/sim_timer.c rtc_based[tmr] = time; tmr 393 src/simh/sim_timer.c rtc_currd[tmr] = time; tmr 394 src/simh/sim_timer.c rtc_initd[tmr] = time; tmr 395 src/simh/sim_timer.c rtc_elapsed[tmr] = 0; tmr 396 src/simh/sim_timer.c rtc_calibrations[tmr] = 0; tmr 397 src/simh/sim_timer.c rtc_clock_ticks_tot[tmr] += rtc_clock_ticks[tmr]; tmr 398 src/simh/sim_timer.c rtc_clock_ticks[tmr] = 0; tmr 399 src/simh/sim_timer.c rtc_calib_tick_time_tot[tmr] += rtc_calib_tick_time[tmr]; tmr 400 src/simh/sim_timer.c rtc_calib_tick_time[tmr] = 0; tmr 401 src/simh/sim_timer.c rtc_clock_catchup_pending[tmr] = FALSE; tmr 402 src/simh/sim_timer.c rtc_clock_catchup_eligible[tmr] = FALSE; tmr 403 src/simh/sim_timer.c rtc_clock_catchup_ticks_tot[tmr] += rtc_clock_catchup_ticks[tmr]; tmr 404 src/simh/sim_timer.c rtc_clock_catchup_ticks[tmr] = 0; tmr 405 src/simh/sim_timer.c rtc_calib_ticks_acked_tot[tmr] += rtc_calib_ticks_acked[tmr]; tmr 406 src/simh/sim_timer.c rtc_calib_ticks_acked[tmr] = 0; tmr 407 src/simh/sim_timer.c ++rtc_calib_initializations[tmr]; tmr 408 src/simh/sim_timer.c _rtcn_configure_calibrated_clock (tmr); tmr 412 src/simh/sim_timer.c int32 sim_rtcn_calb (uint32 ticksper, int32 tmr) tmr 415 src/simh/sim_timer.c if (tmr == SIM_INTERNAL_CLK) tmr 416 src/simh/sim_timer.c tmr = SIM_NTIMERS; tmr 418 src/simh/sim_timer.c if ((tmr < 0) || (tmr >= SIM_NTIMERS)) tmr 421 src/simh/sim_timer.c if (rtc_hz[tmr] != ticksper) { /* changing tick rate? */ tmr 422 src/simh/sim_timer.c rtc_hz[tmr] = ticksper; tmr 423 src/simh/sim_timer.c rtc_clock_tick_size[tmr] = 1.0/ticksper; tmr 424 src/simh/sim_timer.c _rtcn_configure_calibrated_clock (tmr); tmr 425 src/simh/sim_timer.c rtc_currd[tmr] = (int32)(sim_timer_inst_per_sec()/ticksper); tmr 427 src/simh/sim_timer.c if (sim_clock_unit[tmr] == NULL) { /* Not using TIMER units? */ tmr 428 src/simh/sim_timer.c rtc_clock_ticks[tmr] += 1; tmr 429 src/simh/sim_timer.c rtc_calib_tick_time[tmr] += rtc_clock_tick_size[tmr]; tmr 431 src/simh/sim_timer.c if (rtc_clock_catchup_pending[tmr]) { /* catchup tick? */ tmr 432 src/simh/sim_timer.c ++rtc_clock_catchup_ticks[tmr]; /* accumulating which were catchups */ tmr 433 src/simh/sim_timer.c rtc_clock_catchup_pending[tmr] = FALSE; tmr 435 src/simh/sim_timer.c return rtc_currd[tmr]; /* return now avoiding counting catchup tick in calibration */ tmr 442 src/simh/sim_timer.c int tmr; tmr 446 src/simh/sim_timer.c for (tmr=0; tmr<=SIM_NTIMERS; tmr++) { tmr 447 src/simh/sim_timer.c sim_timer_units[tmr].action = &sim_timer_tick_svc; tmr 448 src/simh/sim_timer.c sim_timer_units[tmr].flags = UNIT_DIS | UNIT_IDLE; tmr 473 src/simh/sim_timer.c int tmr, clocks; tmr 478 src/simh/sim_timer.c for (tmr=clocks=0; tmr<=SIM_NTIMERS; ++tmr) { tmr 479 src/simh/sim_timer.c if (0 == rtc_initd[tmr]) tmr 482 src/simh/sim_timer.c if (sim_clock_unit[tmr]) { tmr 485 src/simh/sim_timer.c (tmr == SIM_NTIMERS) ? "Internal Calibrated Timer(" : "", tmr 486 src/simh/sim_timer.c sim_uname(sim_clock_unit[tmr]), tmr 487 src/simh/sim_timer.c (tmr == SIM_NTIMERS) ? ")" : ""); tmr 490 src/simh/sim_timer.c fprintf (st, "%s%sTimer %d:\n", "", rtc_hz[tmr] ? "Calibrated " : "Uncalibrated ", tmr); tmr 491 src/simh/sim_timer.c if (rtc_hz[tmr]) { tmr 492 src/simh/sim_timer.c fprintf (st, " Running at: %lu Hz\n", (unsigned long)rtc_hz[tmr]); tmr 493 src/simh/sim_timer.c fprintf (st, " Tick Size: %s\n", sim_fmt_secs (rtc_clock_tick_size[tmr])); tmr 494 src/simh/sim_timer.c fprintf (st, " Ticks in current second: %lu\n", (unsigned long)rtc_ticks[tmr]); tmr 496 src/simh/sim_timer.c fprintf (st, " Seconds Running: %lu (%s)\n", (unsigned long)rtc_elapsed[tmr], sim_fmt_secs ((double)rtc_elapsed[tmr])); tmr 497 src/simh/sim_timer.c if (tmr == calb_tmr) { tmr 498 src/simh/sim_timer.c fprintf (st, " Calibration Opportunities: %lu\n", (unsigned long)rtc_calibrations[tmr]); tmr 501 src/simh/sim_timer.c if (rtc_clock_calib_skip_idle[tmr]) tmr 502 src/simh/sim_timer.c fprintf (st, " Calibs Skip While Idle: %lu\n", (unsigned long)rtc_clock_calib_skip_idle[tmr]); tmr 503 src/simh/sim_timer.c if (rtc_clock_calib_backwards[tmr]) tmr 504 src/simh/sim_timer.c fprintf (st, " Calibs Skip Backwards: %lu\n", (unsigned long)rtc_clock_calib_backwards[tmr]); tmr 505 src/simh/sim_timer.c if (rtc_clock_calib_gap2big[tmr]) tmr 506 src/simh/sim_timer.c fprintf (st, " Calibs Skip Gap Too Big: %lu\n", (unsigned long)rtc_clock_calib_gap2big[tmr]); tmr 508 src/simh/sim_timer.c if (rtc_gtime[tmr]) tmr 509 src/simh/sim_timer.c fprintf (st, " Instruction Time: %.0f\n", rtc_gtime[tmr]); tmr 510 src/simh/sim_timer.c fprintf (st, " Current Insts Per Tick: %lu\n", (unsigned long)rtc_currd[tmr]); tmr 511 src/simh/sim_timer.c fprintf (st, " Initializations: %lu\n", (unsigned long)rtc_calib_initializations[tmr]); tmr 512 src/simh/sim_timer.c fprintf (st, " Total Ticks: %lu\n", (unsigned long)rtc_clock_ticks_tot[tmr]+(unsigned long)rtc_clock_ticks[tmr]); tmr 513 src/simh/sim_timer.c if (rtc_clock_skew_max[tmr] != 0.0) tmr 514 src/simh/sim_timer.c fprintf (st, " Peak Clock Skew: %s%s\n", sim_fmt_secs (fabs(rtc_clock_skew_max[tmr])), (rtc_clock_skew_max[tmr] < 0) ? " fast" : " slow"); tmr 515 src/simh/sim_timer.c if (rtc_calib_ticks_acked[tmr]) tmr 516 src/simh/sim_timer.c fprintf (st, " Ticks Acked: %lu\n", (unsigned long)rtc_calib_ticks_acked[tmr]); tmr 517 src/simh/sim_timer.c if (rtc_calib_ticks_acked_tot[tmr]+rtc_calib_ticks_acked[tmr] != rtc_calib_ticks_acked[tmr]) //-V584 tmr 518 src/simh/sim_timer.c fprintf (st, " Total Ticks Acked: %lu\n", (unsigned long)rtc_calib_ticks_acked_tot[tmr]+(unsigned long)rtc_calib_ticks_acked[tmr]); tmr 519 src/simh/sim_timer.c if (rtc_calib_tick_time[tmr]) tmr 520 src/simh/sim_timer.c fprintf (st, " Tick Time: %s\n", sim_fmt_secs (rtc_calib_tick_time[tmr])); tmr 521 src/simh/sim_timer.c if (rtc_calib_tick_time_tot[tmr]+rtc_calib_tick_time[tmr] != rtc_calib_tick_time[tmr]) tmr 522 src/simh/sim_timer.c fprintf (st, " Total Tick Time: %s\n", sim_fmt_secs (rtc_calib_tick_time_tot[tmr]+rtc_calib_tick_time[tmr])); tmr 523 src/simh/sim_timer.c if (rtc_clock_catchup_ticks[tmr]) tmr 524 src/simh/sim_timer.c fprintf (st, " Catchup Ticks Sched: %lu\n", (unsigned long)rtc_clock_catchup_ticks[tmr]); tmr 525 src/simh/sim_timer.c if (rtc_clock_catchup_ticks_tot[tmr]+rtc_clock_catchup_ticks[tmr] != rtc_clock_catchup_ticks[tmr]) //-V584 tmr 526 src/simh/sim_timer.c fprintf (st, " Total Catchup Ticks Sched: %lu\n", (unsigned long)rtc_clock_catchup_ticks_tot[tmr]+(unsigned long)rtc_clock_catchup_ticks[tmr]); tmr 530 src/simh/sim_timer.c if (rtc_clock_catchup_eligible[tmr]) { tmr 531 src/simh/sim_timer.c _double_to_timespec (&now, rtc_clock_catchup_base_time[tmr]+rtc_calib_tick_time[tmr]); tmr 534 src/simh/sim_timer.c _double_to_timespec (&now, rtc_clock_catchup_base_time[tmr]); tmr 538 src/simh/sim_timer.c if (rtc_clock_time_idled[tmr]) tmr 539 src/simh/sim_timer.c fprintf (st, " Total Time Idled: %s\n", sim_fmt_secs (rtc_clock_time_idled[tmr]/1000.0)); tmr 548 src/simh/sim_timer.c int tmr; tmr 550 src/simh/sim_timer.c for (tmr=0; tmr<=SIM_NTIMERS; ++tmr) { tmr 551 src/simh/sim_timer.c if (sim_clock_unit[tmr] == NULL) tmr 553 src/simh/sim_timer.c if (sim_clock_cosched_queue[tmr] != QUEUE_LIST_END) { tmr 557 src/simh/sim_timer.c sim_name, sim_uname(sim_clock_unit[tmr])); tmr 559 src/simh/sim_timer.c for (uptr = sim_clock_cosched_queue[tmr]; uptr != QUEUE_LIST_END; uptr = uptr->next) { //-V763 tmr 620 src/simh/sim_timer.c int tmr = (int)(uptr-sim_timer_units); tmr 623 src/simh/sim_timer.c rtc_clock_ticks[tmr] += 1; tmr 624 src/simh/sim_timer.c rtc_calib_tick_time[tmr] += rtc_clock_tick_size[tmr]; tmr 633 src/simh/sim_timer.c if (sim_clock_unit[tmr]->action == NULL) tmr 635 src/simh/sim_timer.c stat = sim_clock_unit[tmr]->action (sim_clock_unit[tmr]); tmr 636 src/simh/sim_timer.c --sim_cosched_interval[tmr]; /* Countdown ticks */ tmr 638 src/simh/sim_timer.c if (rtc_clock_catchup_eligible[tmr]) { /* calibration started? */ tmr 643 src/simh/sim_timer.c skew = (_timespec_to_double(&now) - (rtc_calib_tick_time[tmr]+rtc_clock_catchup_base_time[tmr])); tmr 645 src/simh/sim_timer.c if (fabs(skew) > fabs(rtc_clock_skew_max[tmr])) tmr 646 src/simh/sim_timer.c rtc_clock_skew_max[tmr] = skew; tmr 648 src/simh/sim_timer.c while ((sim_clock_cosched_queue[tmr] != QUEUE_LIST_END) && tmr 649 src/simh/sim_timer.c (sim_cosched_interval[tmr] < sim_clock_cosched_queue[tmr]->time)) { tmr 650 src/simh/sim_timer.c UNIT *cptr = sim_clock_cosched_queue[tmr]; tmr 651 src/simh/sim_timer.c sim_clock_cosched_queue[tmr] = cptr->next; tmr 656 src/simh/sim_timer.c if (sim_clock_cosched_queue[tmr] != QUEUE_LIST_END) tmr 657 src/simh/sim_timer.c sim_cosched_interval[tmr] = sim_clock_cosched_queue[tmr]->time; tmr 659 src/simh/sim_timer.c sim_cosched_interval[tmr] = 0; tmr 661 src/simh/sim_timer.c sim_timer_activate_after (uptr, 1000000/rtc_hz[tmr]); tmr 739 src/simh/sim_timer.c int32 tmr; tmr 743 src/simh/sim_timer.c for (tmr=0; tmr<SIM_NTIMERS; tmr++) { tmr 744 src/simh/sim_timer.c if ((rtc_hz[tmr]) && tmr 745 src/simh/sim_timer.c (rtc_hz[tmr] <= (uint32)sim_os_tick_hz)) tmr 748 src/simh/sim_timer.c if (tmr == SIM_NTIMERS) { /* None found? */ tmr 749 src/simh/sim_timer.c if ((tmr != newtmr) && (!sim_is_active (&SIM_INTERNAL_UNIT))) { tmr 760 src/simh/sim_timer.c if ((tmr == newtmr) && tmr 764 src/simh/sim_timer.c sim_debug (DBG_CAL, &sim_timer_dev, "_rtcn_configure_calibrated_clock() - Stopping Internal Calibrated Timer, New Timer = %d (%dHz)\n", tmr, rtc_hz[tmr]); tmr 776 src/simh/sim_timer.c sim_debug (DBG_CAL, &sim_timer_dev, "_rtcn_configure_calibrated_clock() - Changing Calibrated Timer from %d (%dHz) to %d (%dHz)\n", sim_calb_tmr, rtc_hz[sim_calb_tmr], tmr, rtc_hz[tmr]); tmr 777 src/simh/sim_timer.c sim_calb_tmr = tmr; tmr 779 src/simh/sim_timer.c sim_calb_tmr = tmr; tmr 801 src/simh/sim_timer.c int tmr; tmr 805 src/simh/sim_timer.c for (tmr=0; tmr<=SIM_NTIMERS; tmr++) { tmr 808 src/simh/sim_timer.c if (sim_clock_unit[tmr]) { tmr 810 src/simh/sim_timer.c sim_cancel (&sim_timer_units[tmr]); tmr 811 src/simh/sim_timer.c if (rtc_hz[tmr]) tmr 812 src/simh/sim_timer.c sim_activate (sim_clock_unit[tmr], rtc_currd[tmr]); tmr 815 src/simh/sim_timer.c while (sim_clock_cosched_queue[tmr] != QUEUE_LIST_END) { tmr 816 src/simh/sim_timer.c UNIT *cptr = sim_clock_cosched_queue[tmr]; tmr 818 src/simh/sim_timer.c sim_clock_cosched_queue[tmr] = cptr->next; tmr 823 src/simh/sim_timer.c _sim_activate (cptr, accum*rtc_currd[tmr]); tmr 854 src/simh/sim_timer.c int inst_delay, tmr; tmr 858 src/simh/sim_timer.c for (tmr=0; tmr<=SIM_NTIMERS; tmr++) tmr 859 src/simh/sim_timer.c if (sim_clock_unit[tmr] == uptr) { tmr 860 src/simh/sim_timer.c uptr = &sim_timer_units[tmr]; tmr 879 src/simh/sim_timer.c t_stat sim_register_clock_unit_tmr (UNIT *uptr, int32 tmr) tmr 881 src/simh/sim_timer.c if (tmr == SIM_INTERNAL_CLK) tmr 882 src/simh/sim_timer.c tmr = SIM_NTIMERS; tmr 884 src/simh/sim_timer.c if ((tmr < 0) || (tmr >= SIM_NTIMERS)) tmr 888 src/simh/sim_timer.c while (sim_clock_cosched_queue[tmr] != QUEUE_LIST_END) { tmr 889 src/simh/sim_timer.c UNIT *uptr = sim_clock_cosched_queue[tmr]; tmr 894 src/simh/sim_timer.c sim_clock_unit[tmr] = NULL; tmr 897 src/simh/sim_timer.c if (NULL == sim_clock_unit[tmr]) tmr 898 src/simh/sim_timer.c sim_clock_cosched_queue[tmr] = QUEUE_LIST_END; tmr 899 src/simh/sim_timer.c sim_clock_unit[tmr] = uptr; tmr 901 src/simh/sim_timer.c sim_timer_units[tmr].flags = UNIT_DIS | (sim_clock_unit[tmr] ? UNIT_IDLE : 0); //-V547 tmr 909 src/simh/sim_timer.c int tmr; tmr 911 src/simh/sim_timer.c for (tmr=0; tmr<SIM_NTIMERS; tmr++) { tmr 912 src/simh/sim_timer.c if (uptr == sim_clock_cosched_queue[tmr]) { tmr 913 src/simh/sim_timer.c sim_clock_cosched_queue[tmr] = uptr->next; tmr 918 src/simh/sim_timer.c for (cptr = sim_clock_cosched_queue[tmr]; tmr 62 src/simh/sim_timer.h int32 sim_rtcn_init (int32 time, int32 tmr); tmr 63 src/simh/sim_timer.h int32 sim_rtcn_init_unit (UNIT *uptr, int32 time, int32 tmr); tmr 66 src/simh/sim_timer.h int32 sim_rtcn_calb (uint32 ticksper, int32 tmr); tmr 79 src/simh/sim_timer.h t_stat sim_register_clock_unit_tmr (UNIT *uptr, int32 tmr);