tmr 360 src/simh/sim_timer.c int32 tmr; tmr 362 src/simh/sim_timer.c for (tmr = 0; tmr <= SIM_NTIMERS; tmr++) tmr 363 src/simh/sim_timer.c if (rtc_initd[tmr] != 0) tmr 364 src/simh/sim_timer.c sim_rtcn_init (rtc_initd[tmr], tmr); tmr 368 src/simh/sim_timer.c int32 sim_rtcn_init (int32 time, int32 tmr) tmr 370 src/simh/sim_timer.c return sim_rtcn_init_unit (NULL, time, tmr); tmr 373 src/simh/sim_timer.c int32 sim_rtcn_init_unit (UNIT *uptr, int32 time, int32 tmr) tmr 377 src/simh/sim_timer.c if (tmr == SIM_INTERNAL_CLK) tmr 378 src/simh/sim_timer.c tmr = SIM_NTIMERS; tmr 380 src/simh/sim_timer.c if ((tmr < 0) || (tmr >= SIM_NTIMERS)) tmr 388 src/simh/sim_timer.c if (rtc_currd[tmr]) tmr 389 src/simh/sim_timer.c time = rtc_currd[tmr]; tmr 391 src/simh/sim_timer.c uptr = sim_clock_unit[tmr]; tmr 392 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 394 src/simh/sim_timer.c if (!sim_clock_unit[tmr]) tmr 395 src/simh/sim_timer.c sim_register_clock_unit_tmr (uptr, tmr); tmr 397 src/simh/sim_timer.c rtc_clock_start_gtime[tmr] = sim_gtime(); tmr 398 src/simh/sim_timer.c rtc_rtime[tmr] = sim_os_msec (); tmr 399 src/simh/sim_timer.c rtc_vtime[tmr] = rtc_rtime[tmr]; tmr 400 src/simh/sim_timer.c rtc_nxintv[tmr] = 1000; tmr 401 src/simh/sim_timer.c rtc_ticks[tmr] = 0; tmr 402 src/simh/sim_timer.c rtc_hz[tmr] = 0; tmr 403 src/simh/sim_timer.c rtc_based[tmr] = time; tmr 404 src/simh/sim_timer.c rtc_currd[tmr] = time; tmr 405 src/simh/sim_timer.c rtc_initd[tmr] = time; tmr 406 src/simh/sim_timer.c rtc_elapsed[tmr] = 0; tmr 407 src/simh/sim_timer.c rtc_calibrations[tmr] = 0; tmr 408 src/simh/sim_timer.c rtc_clock_ticks_tot[tmr] += rtc_clock_ticks[tmr]; tmr 409 src/simh/sim_timer.c rtc_clock_ticks[tmr] = 0; tmr 410 src/simh/sim_timer.c rtc_calib_tick_time_tot[tmr] += rtc_calib_tick_time[tmr]; tmr 411 src/simh/sim_timer.c rtc_calib_tick_time[tmr] = 0; tmr 412 src/simh/sim_timer.c rtc_clock_catchup_pending[tmr] = FALSE; tmr 413 src/simh/sim_timer.c rtc_clock_catchup_eligible[tmr] = FALSE; tmr 414 src/simh/sim_timer.c rtc_clock_catchup_ticks_tot[tmr] += rtc_clock_catchup_ticks[tmr]; tmr 415 src/simh/sim_timer.c rtc_clock_catchup_ticks[tmr] = 0; tmr 416 src/simh/sim_timer.c rtc_calib_ticks_acked_tot[tmr] += rtc_calib_ticks_acked[tmr]; tmr 417 src/simh/sim_timer.c rtc_calib_ticks_acked[tmr] = 0; tmr 418 src/simh/sim_timer.c ++rtc_calib_initializations[tmr]; tmr 419 src/simh/sim_timer.c _rtcn_configure_calibrated_clock (tmr); tmr 423 src/simh/sim_timer.c int32 sim_rtcn_calb (uint32 ticksper, int32 tmr) tmr 426 src/simh/sim_timer.c if (tmr == SIM_INTERNAL_CLK) tmr 427 src/simh/sim_timer.c tmr = SIM_NTIMERS; tmr 429 src/simh/sim_timer.c if ((tmr < 0) || (tmr >= SIM_NTIMERS)) tmr 432 src/simh/sim_timer.c if (rtc_hz[tmr] != ticksper) { /* changing tick rate? */ tmr 433 src/simh/sim_timer.c rtc_hz[tmr] = ticksper; tmr 434 src/simh/sim_timer.c rtc_clock_tick_size[tmr] = 1.0/ticksper; tmr 435 src/simh/sim_timer.c _rtcn_configure_calibrated_clock (tmr); tmr 436 src/simh/sim_timer.c rtc_currd[tmr] = (int32)(sim_timer_inst_per_sec()/ticksper); tmr 438 src/simh/sim_timer.c if (sim_clock_unit[tmr] == NULL) { /* Not using TIMER units? */ tmr 439 src/simh/sim_timer.c rtc_clock_ticks[tmr] += 1; tmr 440 src/simh/sim_timer.c rtc_calib_tick_time[tmr] += rtc_clock_tick_size[tmr]; tmr 442 src/simh/sim_timer.c if (rtc_clock_catchup_pending[tmr]) { /* catchup tick? */ tmr 443 src/simh/sim_timer.c ++rtc_clock_catchup_ticks[tmr]; /* accumulating which were catchups */ tmr 444 src/simh/sim_timer.c rtc_clock_catchup_pending[tmr] = FALSE; tmr 446 src/simh/sim_timer.c return rtc_currd[tmr]; /* return now avoiding counting catchup tick in calibration */ tmr 453 src/simh/sim_timer.c int tmr; tmr 457 src/simh/sim_timer.c for (tmr=0; tmr<=SIM_NTIMERS; tmr++) { tmr 458 src/simh/sim_timer.c sim_timer_units[tmr].action = &sim_timer_tick_svc; tmr 459 src/simh/sim_timer.c sim_timer_units[tmr].flags = UNIT_DIS | UNIT_IDLE; tmr 484 src/simh/sim_timer.c int tmr, clocks; tmr 489 src/simh/sim_timer.c for (tmr=clocks=0; tmr<=SIM_NTIMERS; ++tmr) { tmr 490 src/simh/sim_timer.c if (0 == rtc_initd[tmr]) tmr 493 src/simh/sim_timer.c if (sim_clock_unit[tmr]) { tmr 496 src/simh/sim_timer.c (tmr == SIM_NTIMERS) ? "Internal Calibrated Timer(" : "", tmr 497 src/simh/sim_timer.c sim_uname(sim_clock_unit[tmr]), tmr 498 src/simh/sim_timer.c (tmr == SIM_NTIMERS) ? ")" : ""); tmr 501 src/simh/sim_timer.c fprintf (st, "%s%sTimer %d:\n", "", rtc_hz[tmr] ? "Calibrated " : "Uncalibrated ", tmr); tmr 502 src/simh/sim_timer.c if (rtc_hz[tmr]) { tmr 503 src/simh/sim_timer.c fprintf (st, " Running at: %lu Hz\n", (unsigned long)rtc_hz[tmr]); tmr 504 src/simh/sim_timer.c fprintf (st, " Tick Size: %s\n", sim_fmt_secs (rtc_clock_tick_size[tmr])); tmr 505 src/simh/sim_timer.c fprintf (st, " Ticks in current second: %lu\n", (unsigned long)rtc_ticks[tmr]); tmr 507 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 508 src/simh/sim_timer.c if (tmr == calb_tmr) { tmr 509 src/simh/sim_timer.c fprintf (st, " Calibration Opportunities: %lu\n", (unsigned long)rtc_calibrations[tmr]); tmr 512 src/simh/sim_timer.c if (rtc_clock_calib_skip_idle[tmr]) tmr 513 src/simh/sim_timer.c fprintf (st, " Calibs Skip While Idle: %lu\n", (unsigned long)rtc_clock_calib_skip_idle[tmr]); tmr 514 src/simh/sim_timer.c if (rtc_clock_calib_backwards[tmr]) tmr 515 src/simh/sim_timer.c fprintf (st, " Calibs Skip Backwards: %lu\n", (unsigned long)rtc_clock_calib_backwards[tmr]); tmr 516 src/simh/sim_timer.c if (rtc_clock_calib_gap2big[tmr]) tmr 517 src/simh/sim_timer.c fprintf (st, " Calibs Skip Gap Too Big: %lu\n", (unsigned long)rtc_clock_calib_gap2big[tmr]); tmr 519 src/simh/sim_timer.c if (rtc_gtime[tmr]) tmr 520 src/simh/sim_timer.c fprintf (st, " Instruction Time: %.0f\n", rtc_gtime[tmr]); tmr 521 src/simh/sim_timer.c fprintf (st, " Current Insts Per Tick: %lu\n", (unsigned long)rtc_currd[tmr]); tmr 522 src/simh/sim_timer.c fprintf (st, " Initializations: %lu\n", (unsigned long)rtc_calib_initializations[tmr]); tmr 523 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 524 src/simh/sim_timer.c if (rtc_clock_skew_max[tmr] != 0.0) tmr 525 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 526 src/simh/sim_timer.c if (rtc_calib_ticks_acked[tmr]) tmr 527 src/simh/sim_timer.c fprintf (st, " Ticks Acked: %lu\n", (unsigned long)rtc_calib_ticks_acked[tmr]); tmr 528 src/simh/sim_timer.c if (rtc_calib_ticks_acked_tot[tmr]+rtc_calib_ticks_acked[tmr] != rtc_calib_ticks_acked[tmr]) //-V584 tmr 529 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 530 src/simh/sim_timer.c if (rtc_calib_tick_time[tmr]) tmr 531 src/simh/sim_timer.c fprintf (st, " Tick Time: %s\n", sim_fmt_secs (rtc_calib_tick_time[tmr])); tmr 532 src/simh/sim_timer.c if (rtc_calib_tick_time_tot[tmr]+rtc_calib_tick_time[tmr] != rtc_calib_tick_time[tmr]) tmr 533 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 534 src/simh/sim_timer.c if (rtc_clock_catchup_ticks[tmr]) tmr 535 src/simh/sim_timer.c fprintf (st, " Catchup Ticks Sched: %lu\n", (unsigned long)rtc_clock_catchup_ticks[tmr]); tmr 536 src/simh/sim_timer.c if (rtc_clock_catchup_ticks_tot[tmr]+rtc_clock_catchup_ticks[tmr] != rtc_clock_catchup_ticks[tmr]) //-V584 tmr 537 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 551 src/simh/sim_timer.c if (rtc_clock_catchup_eligible[tmr]) { tmr 552 src/simh/sim_timer.c _double_to_timespec (&now, rtc_clock_catchup_base_time[tmr]+rtc_calib_tick_time[tmr]); tmr 555 src/simh/sim_timer.c _double_to_timespec (&now, rtc_clock_catchup_base_time[tmr]); tmr 559 src/simh/sim_timer.c if (rtc_clock_time_idled[tmr]) tmr 560 src/simh/sim_timer.c fprintf (st, " Total Time Idled: %s\n", sim_fmt_secs (rtc_clock_time_idled[tmr]/1000.0)); tmr 569 src/simh/sim_timer.c int tmr; tmr 571 src/simh/sim_timer.c for (tmr=0; tmr<=SIM_NTIMERS; ++tmr) { tmr 572 src/simh/sim_timer.c if (sim_clock_unit[tmr] == NULL) tmr 574 src/simh/sim_timer.c if (sim_clock_cosched_queue[tmr] != QUEUE_LIST_END) { tmr 578 src/simh/sim_timer.c sim_name, sim_uname(sim_clock_unit[tmr])); tmr 580 src/simh/sim_timer.c for (uptr = sim_clock_cosched_queue[tmr]; uptr != QUEUE_LIST_END; uptr = uptr->next) { //-V763 tmr 641 src/simh/sim_timer.c int tmr = (int)(uptr-sim_timer_units); tmr 644 src/simh/sim_timer.c rtc_clock_ticks[tmr] += 1; tmr 645 src/simh/sim_timer.c rtc_calib_tick_time[tmr] += rtc_clock_tick_size[tmr]; tmr 654 src/simh/sim_timer.c if (sim_clock_unit[tmr]->action == NULL) tmr 656 src/simh/sim_timer.c stat = sim_clock_unit[tmr]->action (sim_clock_unit[tmr]); tmr 657 src/simh/sim_timer.c --sim_cosched_interval[tmr]; /* Countdown ticks */ tmr 659 src/simh/sim_timer.c if (rtc_clock_catchup_eligible[tmr]) { /* calibration started? */ tmr 674 src/simh/sim_timer.c skew = (_timespec_to_double(&now) - (rtc_calib_tick_time[tmr]+rtc_clock_catchup_base_time[tmr])); tmr 676 src/simh/sim_timer.c if (fabs(skew) > fabs(rtc_clock_skew_max[tmr])) tmr 677 src/simh/sim_timer.c rtc_clock_skew_max[tmr] = skew; tmr 679 src/simh/sim_timer.c while ((sim_clock_cosched_queue[tmr] != QUEUE_LIST_END) && tmr 680 src/simh/sim_timer.c (sim_cosched_interval[tmr] < sim_clock_cosched_queue[tmr]->time)) { tmr 681 src/simh/sim_timer.c UNIT *cptr = sim_clock_cosched_queue[tmr]; tmr 682 src/simh/sim_timer.c sim_clock_cosched_queue[tmr] = cptr->next; tmr 687 src/simh/sim_timer.c if (sim_clock_cosched_queue[tmr] != QUEUE_LIST_END) tmr 688 src/simh/sim_timer.c sim_cosched_interval[tmr] = sim_clock_cosched_queue[tmr]->time; tmr 690 src/simh/sim_timer.c sim_cosched_interval[tmr] = 0; tmr 692 src/simh/sim_timer.c sim_timer_activate_after (uptr, 1000000/rtc_hz[tmr]); tmr 770 src/simh/sim_timer.c int32 tmr; tmr 774 src/simh/sim_timer.c for (tmr=0; tmr<SIM_NTIMERS; tmr++) { tmr 775 src/simh/sim_timer.c if ((rtc_hz[tmr]) && tmr 776 src/simh/sim_timer.c (rtc_hz[tmr] <= (uint32)sim_os_tick_hz)) tmr 779 src/simh/sim_timer.c if (tmr == SIM_NTIMERS) { /* None found? */ tmr 780 src/simh/sim_timer.c if ((tmr != newtmr) && (!sim_is_active (&SIM_INTERNAL_UNIT))) { tmr 791 src/simh/sim_timer.c if ((tmr == newtmr) && tmr 795 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 807 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 808 src/simh/sim_timer.c sim_calb_tmr = tmr; tmr 810 src/simh/sim_timer.c sim_calb_tmr = tmr; tmr 832 src/simh/sim_timer.c int tmr; tmr 836 src/simh/sim_timer.c for (tmr=0; tmr<=SIM_NTIMERS; tmr++) { tmr 839 src/simh/sim_timer.c if (sim_clock_unit[tmr]) { tmr 841 src/simh/sim_timer.c sim_cancel (&sim_timer_units[tmr]); tmr 842 src/simh/sim_timer.c if (rtc_hz[tmr]) tmr 843 src/simh/sim_timer.c sim_activate (sim_clock_unit[tmr], rtc_currd[tmr]); tmr 846 src/simh/sim_timer.c while (sim_clock_cosched_queue[tmr] != QUEUE_LIST_END) { tmr 847 src/simh/sim_timer.c UNIT *cptr = sim_clock_cosched_queue[tmr]; tmr 849 src/simh/sim_timer.c sim_clock_cosched_queue[tmr] = cptr->next; tmr 854 src/simh/sim_timer.c _sim_activate (cptr, accum*rtc_currd[tmr]); tmr 885 src/simh/sim_timer.c int inst_delay, tmr; tmr 889 src/simh/sim_timer.c for (tmr=0; tmr<=SIM_NTIMERS; tmr++) tmr 890 src/simh/sim_timer.c if (sim_clock_unit[tmr] == uptr) { tmr 891 src/simh/sim_timer.c uptr = &sim_timer_units[tmr]; tmr 910 src/simh/sim_timer.c t_stat sim_register_clock_unit_tmr (UNIT *uptr, int32 tmr) tmr 912 src/simh/sim_timer.c if (tmr == SIM_INTERNAL_CLK) tmr 913 src/simh/sim_timer.c tmr = SIM_NTIMERS; tmr 915 src/simh/sim_timer.c if ((tmr < 0) || (tmr >= SIM_NTIMERS)) tmr 919 src/simh/sim_timer.c while (sim_clock_cosched_queue[tmr] != QUEUE_LIST_END) { tmr 920 src/simh/sim_timer.c UNIT *uptr = sim_clock_cosched_queue[tmr]; tmr 925 src/simh/sim_timer.c sim_clock_unit[tmr] = NULL; tmr 928 src/simh/sim_timer.c if (NULL == sim_clock_unit[tmr]) tmr 929 src/simh/sim_timer.c sim_clock_cosched_queue[tmr] = QUEUE_LIST_END; tmr 930 src/simh/sim_timer.c sim_clock_unit[tmr] = uptr; tmr 932 src/simh/sim_timer.c sim_timer_units[tmr].flags = UNIT_DIS | (sim_clock_unit[tmr] ? UNIT_IDLE : 0); //-V547 tmr 940 src/simh/sim_timer.c int tmr; tmr 942 src/simh/sim_timer.c for (tmr=0; tmr<SIM_NTIMERS; tmr++) { tmr 943 src/simh/sim_timer.c if (uptr == sim_clock_cosched_queue[tmr]) { tmr 944 src/simh/sim_timer.c sim_clock_cosched_queue[tmr] = uptr->next; tmr 949 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);