TIMER: Add additional calibration skip while idling counter statistic
This commit is contained in:
parent
165c37acee
commit
60fb70128c
1 changed files with 31 additions and 31 deletions
14
sim_timer.c
14
sim_timer.c
|
@ -720,6 +720,7 @@ static t_bool rtc_clock_catchup_pending[SIM_NTIMERS+1] = { 0 };/* clock tick cat
|
|||
static t_bool rtc_clock_catchup_eligible[SIM_NTIMERS+1] = { 0 };/* clock tick catchup eligible */
|
||||
static uint32 rtc_clock_time_idled[SIM_NTIMERS+1] = { 0 };/* total time idled */
|
||||
static uint32 rtc_clock_time_idled_last[SIM_NTIMERS+1] = { 0 };/* total time idled */
|
||||
static uint32 rtc_clock_calib_skip_idle[SIM_NTIMERS+1] = { 0 };/* Calibrations skipped due to idling */
|
||||
|
||||
UNIT sim_timer_units[SIM_NTIMERS+1]; /* one for each timer and one for an */
|
||||
/* internal clock if no clocks are registered */
|
||||
|
@ -855,6 +856,7 @@ if (last_idle_pct > (100 - sim_idle_calib_pct)) {
|
|||
rtc_rtime[tmr] = new_rtime; /* save wall time */
|
||||
rtc_vtime[tmr] = rtc_vtime[tmr] + 1000; /* adv sim time */
|
||||
rtc_gtime[tmr] = sim_gtime(); /* save instruction time */
|
||||
++rtc_clock_calib_skip_idle[tmr];
|
||||
sim_debug (DBG_CAL, &sim_timer_dev, "skipping calibration due to idling - result: %d\n", rtc_currd[tmr]);
|
||||
return rtc_currd[tmr]; /* avoid calibrating idle checks */
|
||||
}
|
||||
|
@ -1017,7 +1019,9 @@ for (tmr=clocks=0; tmr<=SIM_NTIMERS; ++tmr) {
|
|||
fprintf (st, " Ticks in current second: %d\n", rtc_ticks[tmr]);
|
||||
}
|
||||
fprintf (st, " Seconds Running: %u (%s)\n", rtc_elapsed[tmr], sim_fmt_secs ((double)rtc_elapsed[tmr]));
|
||||
fprintf (st, " Calibrations: %u\n", rtc_calibrations[tmr]);
|
||||
fprintf (st, " Calibration Opportunities: %u\n", rtc_calibrations[tmr]);
|
||||
if (rtc_clock_calib_skip_idle[tmr])
|
||||
fprintf (st, " Calibs Skipped While Idle: %u\n", rtc_clock_calib_skip_idle[tmr]);
|
||||
if (rtc_gtime[tmr])
|
||||
fprintf (st, " Instruction Time: %.0f\n", rtc_gtime[tmr]);
|
||||
if ((!sim_asynch_timer) && (sim_throt_type == SIM_THROT_NONE)) {
|
||||
|
@ -1258,7 +1262,7 @@ DEVICE sim_throttle_dev = {
|
|||
|
||||
t_bool sim_idle (uint32 tmr, t_bool sin_cyc)
|
||||
{
|
||||
static uint32 cyc_ms = 0;
|
||||
uint32 cyc_ms = 0;
|
||||
uint32 w_ms, w_idle, act_ms;
|
||||
int32 act_cyc;
|
||||
|
||||
|
@ -1312,13 +1316,12 @@ if (_rtcn_tick_catchup_check(tmr, 0)) {
|
|||
the bookkeeping on sim_idle_idled is done here in sim_timer where it
|
||||
means something, while not idling when it isn't enabled.
|
||||
*/
|
||||
//sim_idle_idled = TRUE; /* record idle attempt */
|
||||
sim_debug (DBG_TRC, &sim_timer_dev, "sim_idle(tmr=%d, sin_cyc=%d)\n", tmr, sin_cyc);
|
||||
cyc_ms = (rtc_currd[tmr] * rtc_hz[tmr]) / 1000; /* cycles per msec */
|
||||
if ((sim_idle_rate_ms == 0) || (cyc_ms == 0)) { /* not possible? */
|
||||
if (sin_cyc)
|
||||
sim_interval = sim_interval - 1;
|
||||
sim_debug (DBG_IDL, &sim_timer_dev, "not possible %d - %d\n", sim_idle_rate_ms, cyc_ms);
|
||||
sim_debug (DBG_IDL, &sim_timer_dev, "not possible idle_rate_ms=%d - cyc/ms=%d\n", sim_idle_rate_ms, cyc_ms);
|
||||
return FALSE;
|
||||
}
|
||||
w_ms = (uint32) sim_interval / cyc_ms; /* ms to wait */
|
||||
|
@ -1759,9 +1762,6 @@ return _timespec_to_double (&now);
|
|||
|
||||
#if defined(SIM_ASYNCH_CLOCKS)
|
||||
|
||||
extern UNIT * volatile sim_wallclock_queue;
|
||||
extern UNIT * volatile sim_wallclock_entry;
|
||||
|
||||
pthread_t sim_timer_thread; /* Wall Clock Timing Thread Id */
|
||||
pthread_cond_t sim_timer_startup_cond;
|
||||
t_bool sim_timer_thread_running = FALSE;
|
||||
|
|
Loading…
Add table
Reference in a new issue