[Simh] RE: slowing up simh
Sterling Garwood
slgarwood at charter.net
Fri Sep 30 10:50:05 EDT 2005
I've been poking around in simh v 3.5 just to learn how things work
since I want to slow up the code to let my laptop run cooler. I've
been using the pdp11 code since I think I understand how a PDP11
works :-)
I set up a barebones 11/03 to make the testing as simple as possible.
A couple of findings .... applicable only to my Mac OS X 10.4.2 iBook
to be sure. YMMV !!!
The simulation code never sleeps - somewhat understandable since it
handles everything under one thread. Even with just a two instruction
wait/branch loop it never sleeps .... but it also seems to drop out
of the PDP11 WAIT code immediately. This is a bit of a puzzle since
nothing else is going on ... not even the CLK - and I put a WAIT at
the CLK vector. If I understand the PDP11 correctly, the cpu should
only drop out of a WAIT due to an interrupt of some sort. My guess is
that there is an interaction with the poll loop for the simulator
console. I need to do some more research here. By the way --- is
there any way to disable/detach the CLK device? If so I haven't found
it yet :-)
I've played around with both a nanosleep (q.v.) and usleep (also
q.v.) in the WAIT instruction decode...a usleep with a 2 or 3 MS
sleep seems to slow up the simulator quite a bit ... my laptop
processor usage drops to the 50% range from 100%...but there is not
much difference between 1 ms and 10 ms .... so the lower cpu probably
a combination of syscall task switching and dispatching under Mac OS X.
More information about the Simh
mailing list