In sim_timer.c, locate this routine (there are several versions, look for the last one, which is for UNIX systems):

uint32 sim_os_ms_sleep_init (void)
{
uint32 i, t1, t2, tot, tim;

for (i = 0, tot = 0; i < sleep1Samples; i++) {
    t1 = sim_os_msec ();
    sim_os_ms_sleep (1);
    t2 = sim_os_msec ();
    tot += (t2 - t1);
    }
tim = (tot + (sleep1Samples - 1)) / sleep1Samples;
if (tim > SIM_IDLE_MAX)
    tim = 0;
return tim;
}

If you are running with gdb, place a breakpoint on the line

if (tim > SIM_IDLE_MAX)

and see what the value of 'tim' is. Otherwise, insert the following before the if statement:

printf ("Calculated minimum sleep time = %d\r\n", tim);

and see what gets printed out.

/Bob Supnik

_______________________________________________
Simh mailing list
[email protected]
http://mailman.trailing-edge.com/mailman/listinfo/simh

Reply via email to