tmr 358 src/simh/sim_timer.c int32 tmr; tmr 360 src/simh/sim_timer.c for (tmr = 0; tmr <= SIM_NTIMERS; tmr++) tmr 361 src/simh/sim_timer.c if (rtc_initd[tmr] != 0) tmr 362 src/simh/sim_timer.c sim_rtcn_init (rtc_initd[tmr], tmr); tmr 366 src/simh/sim_timer.c int32 sim_rtcn_init (int32 time, int32 tmr) tmr 368 src/simh/sim_timer.c return sim_rtcn_init_unit (NULL, time, tmr); tmr 371 src/simh/sim_timer.c int32 sim_rtcn_init_unit (UNIT *uptr, int32 time, int32 tmr) tmr 375 src/simh/sim_timer.c if (tmr == SIM_INTERNAL_CLK) tmr 376 src/simh/sim_timer.c tmr = SIM_NTIMERS; tmr 378 src/simh/sim_timer.c if ((tmr < 0) || (tmr >= SIM_NTIMERS)) tmr 386 src/simh/sim_timer.c if (rtc_currd[tmr]) tmr 387 src/simh/sim_timer.c time = rtc_currd[tmr]; tmr 389 src/simh/sim_timer.c uptr = sim_clock_unit[tmr]; tmr 390 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 392 src/simh/sim_timer.c if (!sim_clock_unit[tmr]) tmr 393 src/simh/sim_timer.c sim_register_clock_unit_tmr (uptr, tmr); tmr 395 src/simh/sim_timer.c rtc_clock_start_gtime[tmr] = sim_gtime(); tmr 396 src/simh/sim_timer.c rtc_rtime[tmr] = sim_os_msec (); tmr 397 src/simh/sim_timer.c rtc_vtime[tmr] = rtc_rtime[tmr]; tmr 398 src/simh/sim_timer.c rtc_nxintv[tmr] = 1000; tmr 399 src/simh/sim_timer.c rtc_ticks[tmr] = 0; tmr 400 src/simh/sim_timer.c rtc_hz[tmr] = 0; tmr 401 src/simh/sim_timer.c rtc_based[tmr] = time; tmr 402 src/simh/sim_timer.c rtc_currd[tmr] = time; tmr 403 src/simh/sim_timer.c rtc_initd[tmr] = time; tmr 404 src/simh/sim_timer.c rtc_elapsed[tmr] = 0; tmr 405 src/simh/sim_timer.c rtc_calibrations[tmr] = 0; tmr 406 src/simh/sim_timer.c rtc_clock_ticks_tot[tmr] += rtc_clock_ticks[tmr]; tmr 407 src/simh/sim_timer.c rtc_clock_ticks[tmr] = 0; tmr 408 src/simh/sim_timer.c rtc_calib_tick_time_tot[tmr] += rtc_calib_tick_time[tmr]; tmr 409 src/simh/sim_timer.c rtc_calib_tick_time[tmr] = 0; tmr 410 src/simh/sim_timer.c rtc_clock_catchup_pending[tmr] = FALSE; tmr 411 src/simh/sim_timer.c rtc_clock_catchup_eligible[tmr] = FALSE; tmr 412 src/simh/sim_timer.c rtc_clock_catchup_ticks_tot[tmr] += rtc_clock_catchup_ticks[tmr]; tmr 413 src/simh/sim_timer.c rtc_clock_catchup_ticks[tmr] = 0; tmr 414 src/simh/sim_timer.c rtc_calib_ticks_acked_tot[tmr] += rtc_calib_ticks_acked[tmr]; tmr 415 src/simh/sim_timer.c rtc_calib_ticks_acked[tmr] = 0; tmr 416 src/simh/sim_timer.c ++rtc_calib_initializations[tmr]; tmr 417 src/simh/sim_timer.c _rtcn_configure_calibrated_clock (tmr); tmr 421 src/simh/sim_timer.c int32 sim_rtcn_calb (uint32 ticksper, int32 tmr) tmr 423 src/simh/sim_timer.c if (tmr == SIM_INTERNAL_CLK) tmr 424 src/simh/sim_timer.c tmr = SIM_NTIMERS; tmr 426 src/simh/sim_timer.c if ((tmr < 0) || (tmr >= SIM_NTIMERS)) tmr 429 src/simh/sim_timer.c if (rtc_hz[tmr] != ticksper) { /* changing tick rate? */ tmr 430 src/simh/sim_timer.c rtc_hz[tmr] = ticksper; tmr 431 src/simh/sim_timer.c rtc_clock_tick_size[tmr] = 1.0/ticksper; tmr 432 src/simh/sim_timer.c _rtcn_configure_calibrated_clock (tmr); tmr 433 src/simh/sim_timer.c rtc_currd[tmr] = (int32)(sim_timer_inst_per_sec()/ticksper); tmr 435 src/simh/sim_timer.c if (sim_clock_unit[tmr] == NULL) { /* Not using TIMER units? */ tmr 436 src/simh/sim_timer.c rtc_clock_ticks[tmr] += 1; tmr 437 src/simh/sim_timer.c rtc_calib_tick_time[tmr] += rtc_clock_tick_size[tmr]; tmr 439 src/simh/sim_timer.c if (rtc_clock_catchup_pending[tmr]) { /* catchup tick? */ tmr 440 src/simh/sim_timer.c ++rtc_clock_catchup_ticks[tmr]; /* accumulating which were catchups */ tmr 441 src/simh/sim_timer.c rtc_clock_catchup_pending[tmr] = FALSE; tmr 443 src/simh/sim_timer.c return rtc_currd[tmr]; /* return now avoiding counting catchup tick in calibration */ tmr 450 src/simh/sim_timer.c int tmr; tmr 454 src/simh/sim_timer.c for (tmr=0; tmr<=SIM_NTIMERS; tmr++) { tmr 455 src/simh/sim_timer.c sim_timer_units[tmr].action = &sim_timer_tick_svc; tmr 456 src/simh/sim_timer.c sim_timer_units[tmr].flags = UNIT_DIS | UNIT_IDLE; tmr 481 src/simh/sim_timer.c int tmr, clocks; tmr 486 src/simh/sim_timer.c for (tmr=clocks=0; tmr<=SIM_NTIMERS; ++tmr) { tmr 487 src/simh/sim_timer.c if (0 == rtc_initd[tmr]) tmr 490 src/simh/sim_timer.c if (sim_clock_unit[tmr]) { tmr 494 src/simh/sim_timer.c (tmr == SIM_NTIMERS) ? "Internal Calibrated Timer(" : "", tmr 495 src/simh/sim_timer.c sim_uname(sim_clock_unit[tmr]), tmr 496 src/simh/sim_timer.c (tmr == SIM_NTIMERS) ? ")" : ""); tmr 500 src/simh/sim_timer.c rtc_hz[tmr] ? "Calibrated " : "Uncalibrated ", tmr 501 src/simh/sim_timer.c tmr); tmr 502 src/simh/sim_timer.c if (rtc_hz[tmr]) { tmr 504 src/simh/sim_timer.c (unsigned long)rtc_hz[tmr]); tmr 506 src/simh/sim_timer.c sim_fmt_secs (rtc_clock_tick_size[tmr])); tmr 508 src/simh/sim_timer.c (unsigned long)rtc_ticks[tmr]); tmr 511 src/simh/sim_timer.c (unsigned long)rtc_elapsed[tmr], tmr 512 src/simh/sim_timer.c sim_fmt_secs ((double)rtc_elapsed[tmr])); tmr 513 src/simh/sim_timer.c if (tmr == calb_tmr) { tmr 515 src/simh/sim_timer.c (unsigned long)rtc_calibrations[tmr]); tmr 519 src/simh/sim_timer.c if (rtc_clock_calib_skip_idle[tmr]) tmr 521 src/simh/sim_timer.c (unsigned long)rtc_clock_calib_skip_idle[tmr]); tmr 522 src/simh/sim_timer.c if (rtc_clock_calib_backwards[tmr]) tmr 524 src/simh/sim_timer.c (unsigned long)rtc_clock_calib_backwards[tmr]); tmr 525 src/simh/sim_timer.c if (rtc_clock_calib_gap2big[tmr]) tmr 527 src/simh/sim_timer.c (unsigned long)rtc_clock_calib_gap2big[tmr]); tmr 529 src/simh/sim_timer.c if (rtc_gtime[tmr]) tmr 531 src/simh/sim_timer.c rtc_gtime[tmr]); tmr 533 src/simh/sim_timer.c (unsigned long)rtc_currd[tmr]); tmr 535 src/simh/sim_timer.c (unsigned long)rtc_calib_initializations[tmr]); tmr 537 src/simh/sim_timer.c (unsigned long)rtc_clock_ticks_tot[tmr]+(unsigned long)rtc_clock_ticks[tmr]); tmr 538 src/simh/sim_timer.c if (rtc_clock_skew_max[tmr] != 0.0) tmr 540 src/simh/sim_timer.c sim_fmt_secs (fabs(rtc_clock_skew_max[tmr])), tmr 541 src/simh/sim_timer.c (rtc_clock_skew_max[tmr] < 0) ? " fast" : " slow"); tmr 542 src/simh/sim_timer.c if (rtc_calib_ticks_acked[tmr]) tmr 544 src/simh/sim_timer.c (unsigned long)rtc_calib_ticks_acked[tmr]); tmr 545 src/simh/sim_timer.c if (rtc_calib_ticks_acked_tot[tmr]+rtc_calib_ticks_acked[tmr] != rtc_calib_ticks_acked[tmr]) //-V584 tmr 547 src/simh/sim_timer.c (unsigned long)rtc_calib_ticks_acked_tot[tmr]+(unsigned long)rtc_calib_ticks_acked[tmr]); tmr 548 src/simh/sim_timer.c if (rtc_calib_tick_time[tmr]) tmr 550 src/simh/sim_timer.c sim_fmt_secs (rtc_calib_tick_time[tmr])); tmr 551 src/simh/sim_timer.c if (rtc_calib_tick_time_tot[tmr]+rtc_calib_tick_time[tmr] != rtc_calib_tick_time[tmr]) tmr 553 src/simh/sim_timer.c sim_fmt_secs (rtc_calib_tick_time_tot[tmr]+rtc_calib_tick_time[tmr])); tmr 554 src/simh/sim_timer.c if (rtc_clock_catchup_ticks[tmr]) tmr 556 src/simh/sim_timer.c (unsigned long)rtc_clock_catchup_ticks[tmr]); tmr 557 src/simh/sim_timer.c if (rtc_clock_catchup_ticks_tot[tmr]+rtc_clock_catchup_ticks[tmr] != rtc_clock_catchup_ticks[tmr]) //-V584 tmr 559 src/simh/sim_timer.c (unsigned long)rtc_clock_catchup_ticks_tot[tmr]+(unsigned long)rtc_clock_catchup_ticks[tmr]); tmr 563 src/simh/sim_timer.c if (rtc_clock_catchup_eligible[tmr]) { tmr 564 src/simh/sim_timer.c _double_to_timespec (&now, rtc_clock_catchup_base_time[tmr]+rtc_calib_tick_time[tmr]); tmr 567 src/simh/sim_timer.c _double_to_timespec (&now, rtc_clock_catchup_base_time[tmr]); tmr 571 src/simh/sim_timer.c if (rtc_clock_time_idled[tmr]) tmr 572 src/simh/sim_timer.c fprintf (st, " Total Time Idled: %s\n", sim_fmt_secs (rtc_clock_time_idled[tmr]/1000.0)); tmr 581 src/simh/sim_timer.c int tmr; tmr 583 src/simh/sim_timer.c for (tmr=0; tmr<=SIM_NTIMERS; ++tmr) { tmr 584 src/simh/sim_timer.c if (sim_clock_unit[tmr] == NULL) tmr 586 src/simh/sim_timer.c if (sim_clock_cosched_queue[tmr] != QUEUE_LIST_END) { tmr 590 src/simh/sim_timer.c sim_name, sim_uname(sim_clock_unit[tmr])); tmr 592 src/simh/sim_timer.c for (uptr = sim_clock_cosched_queue[tmr]; uptr != QUEUE_LIST_END; uptr = uptr->next) { //-V763 tmr 655 src/simh/sim_timer.c int tmr = (int)(uptr-sim_timer_units); tmr 658 src/simh/sim_timer.c rtc_clock_ticks[tmr] += 1; tmr 659 src/simh/sim_timer.c rtc_calib_tick_time[tmr] += rtc_clock_tick_size[tmr]; tmr 668 src/simh/sim_timer.c if (sim_clock_unit[tmr]->action == NULL) tmr 670 src/simh/sim_timer.c stat = sim_clock_unit[tmr]->action (sim_clock_unit[tmr]); tmr 671 src/simh/sim_timer.c --sim_cosched_interval[tmr]; /* Countdown ticks */ tmr 673 src/simh/sim_timer.c if (rtc_clock_catchup_eligible[tmr]) { /* calibration started? */ tmr 678 src/simh/sim_timer.c skew = (_timespec_to_double(&now) - (rtc_calib_tick_time[tmr]+rtc_clock_catchup_base_time[tmr])); tmr 680 src/simh/sim_timer.c if (fabs(skew) > fabs(rtc_clock_skew_max[tmr])) tmr 681 src/simh/sim_timer.c rtc_clock_skew_max[tmr] = skew; tmr 683 src/simh/sim_timer.c while ((sim_clock_cosched_queue[tmr] != QUEUE_LIST_END) && tmr 684 src/simh/sim_timer.c (sim_cosched_interval[tmr] < sim_clock_cosched_queue[tmr]->time)) { tmr 685 src/simh/sim_timer.c UNIT *cptr = sim_clock_cosched_queue[tmr]; tmr 686 src/simh/sim_timer.c sim_clock_cosched_queue[tmr] = cptr->next; tmr 691 src/simh/sim_timer.c if (sim_clock_cosched_queue[tmr] != QUEUE_LIST_END) tmr 692 src/simh/sim_timer.c sim_cosched_interval[tmr] = sim_clock_cosched_queue[tmr]->time; tmr 694 src/simh/sim_timer.c sim_cosched_interval[tmr] = 0; tmr 696 src/simh/sim_timer.c sim_timer_activate_after (uptr, 1000000/rtc_hz[tmr]); tmr 778 src/simh/sim_timer.c int32 tmr; tmr 782 src/simh/sim_timer.c for (tmr=0; tmr<SIM_NTIMERS; tmr++) { tmr 783 src/simh/sim_timer.c if ((rtc_hz[tmr]) && tmr 784 src/simh/sim_timer.c (rtc_hz[tmr] <= (uint32)sim_os_tick_hz)) tmr 787 src/simh/sim_timer.c if (tmr == SIM_NTIMERS) { /* None found? */ tmr 788 src/simh/sim_timer.c if ((tmr != newtmr) && (!sim_is_active (&SIM_INTERNAL_UNIT))) { tmr 801 src/simh/sim_timer.c if ((tmr == newtmr) && tmr 807 src/simh/sim_timer.c tmr, rtc_hz[tmr]); tmr 821 src/simh/sim_timer.c sim_calb_tmr, rtc_hz[sim_calb_tmr], tmr, rtc_hz[tmr]); tmr 822 src/simh/sim_timer.c sim_calb_tmr = tmr; tmr 824 src/simh/sim_timer.c sim_calb_tmr = tmr; tmr 846 src/simh/sim_timer.c int tmr; tmr 850 src/simh/sim_timer.c for (tmr=0; tmr<=SIM_NTIMERS; tmr++) { tmr 853 src/simh/sim_timer.c if (sim_clock_unit[tmr]) { tmr 855 src/simh/sim_timer.c sim_cancel (&sim_timer_units[tmr]); tmr 856 src/simh/sim_timer.c if (rtc_hz[tmr]) tmr 857 src/simh/sim_timer.c sim_activate (sim_clock_unit[tmr], rtc_currd[tmr]); tmr 860 src/simh/sim_timer.c while (sim_clock_cosched_queue[tmr] != QUEUE_LIST_END) { tmr 861 src/simh/sim_timer.c UNIT *cptr = sim_clock_cosched_queue[tmr]; tmr 863 src/simh/sim_timer.c sim_clock_cosched_queue[tmr] = cptr->next; tmr 868 src/simh/sim_timer.c _sim_activate (cptr, accum*rtc_currd[tmr]); tmr 899 src/simh/sim_timer.c int inst_delay, tmr; tmr 903 src/simh/sim_timer.c for (tmr=0; tmr<=SIM_NTIMERS; tmr++) tmr 904 src/simh/sim_timer.c if (sim_clock_unit[tmr] == uptr) { tmr 905 src/simh/sim_timer.c uptr = &sim_timer_units[tmr]; tmr 924 src/simh/sim_timer.c t_stat sim_register_clock_unit_tmr (UNIT *uptr, int32 tmr) tmr 926 src/simh/sim_timer.c if (tmr == SIM_INTERNAL_CLK) tmr 927 src/simh/sim_timer.c tmr = SIM_NTIMERS; tmr 929 src/simh/sim_timer.c if ((tmr < 0) || (tmr >= SIM_NTIMERS)) tmr 933 src/simh/sim_timer.c while (sim_clock_cosched_queue[tmr] != QUEUE_LIST_END) { tmr 934 src/simh/sim_timer.c UNIT *uptr = sim_clock_cosched_queue[tmr]; tmr 939 src/simh/sim_timer.c sim_clock_unit[tmr] = NULL; tmr 942 src/simh/sim_timer.c if (NULL == sim_clock_unit[tmr]) tmr 943 src/simh/sim_timer.c sim_clock_cosched_queue[tmr] = QUEUE_LIST_END; tmr 944 src/simh/sim_timer.c sim_clock_unit[tmr] = uptr; tmr 946 src/simh/sim_timer.c sim_timer_units[tmr].flags = UNIT_DIS | (sim_clock_unit[tmr] ? UNIT_IDLE : 0); //-V547 tmr 954 src/simh/sim_timer.c int tmr; tmr 956 src/simh/sim_timer.c for (tmr=0; tmr<SIM_NTIMERS; tmr++) { tmr 957 src/simh/sim_timer.c if (uptr == sim_clock_cosched_queue[tmr]) { tmr 958 src/simh/sim_timer.c sim_clock_cosched_queue[tmr] = uptr->next; tmr 963 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);