[Simh] UNS: Representative Instruction Execution Timing

Brad Parker brad at heeltoe.com
Tue Apr 5 11:09:08 EDT 2011


It might be confused, but I'd think you could get access
to the TSC register on most modern cpu's running windows.

With that you should be able to run at given rate using
a delay loop.  You might need to do some work to figure
out what the TSC is actually telling you (as I recall that
it represents has changed depending on the cpu vintage)
but that too should be possible...

I also thought win32 api had some sort of high res timer support which 
would give
you calibrated delays....

(me, I'm more interested in a fully pipelined pdp-8 with
caches running in an fpga :-)

-brad

Dalby, Jeremy R (GE Power & Water) wrote:
> I am trying to figure out how to slow down the SIMH PDP-8 simulator such
> that the instructions are executed with similar timing to that of a real
> PDP-8.  I have found that that even with throttling set very low, the
> PDP-8 simulator executes much, much faster than a real PDP-8.
>
> >From what I have read, I believe the execution of a single PDP-8
> instruction can take anywhere from 1.2 - 4.6 microseconds, depending on
> the type of instruction and I/O device to which the instruction applies.
>
> I am running the PDP-8 simulator on a Windows XP host, which I
> unfortunately cannot change to a real-time environment.
>
> Some things I have considered:
>
> 1.  Inserting a sleep() function after execution of each PDP-8
> instruction, but this won't work since the minimum sleep time is 1
> millisecond, and even a 1 ms sleep request is not likely to return for
> at least 20 ms due to Windows non-real-time scheduling.
>
> 2. Inserting a loop that cycles for some number of times after execution
> of each PDP-8 instruction, in order to kill some time. The exact number
> of cycles required would depend on the host processor speed, so I would
> have to come up with some sort of calibration method to determine the
> number of cycles.  I don't really like this method because I would have
> to disable throttling and tie up the processor 100%, and I'm really not
> sure how I would go about calibrating the number of cycles.
>
> I am kind of thinking at this point that representative instruction
> timing on a Windows host is pretty much impossible, but I thought it
> might be worthwhile to throw the question out there to you guys and see
> what comes back.  Any thoughts or ideas would be much appreciated.
>
> Thanks,
> Jeremy Dalby
>
> _______________________________________________
> Simh mailing list
> Simh at trailing-edge.com
> http://mailman.trailing-edge.com/mailman/listinfo/simh
>   




More information about the Simh mailing list