Throttling problem

67 views
Skip to first unread message

Andrew Herbert

unread,
Oct 14, 2022, 1:59:56 PM10/14/22
to PiDP-8
I'm running the multicore SD card system on a Raspberry Pi 3.

If I try to set the speed in simh using set throttle I get a strange result:

Host CPU is too slow to simulate 333,000 instructions per second
Host CPU can only simulate 7,591,260 instructions per second
Throttling disabled.

This message seems to be contradicting itself.

Any advice on what's going on?

Andrew

Here's the full trace including clock information.

Simulation stopped, PC: 01210 (JMP 1207)
sim> set throttle 333K
sim> cont
PiDP-8/I initial throttle = 333000 IPS
*********** WARNING ***********
Host CPU is too slow to simulate 333,000 instructions per second
Host CPU can only simulate 7,591,260 instructions per second
Throttling disabled.

Simulation stopped, PC: 01210 (JMP 1207)
sim> show clocks
Minimum Host Sleep Time:        1 ms (1000Hz)
Host Clock Resolution:          1 ms
Execution Rate:                 9,266,820 instructions/sec
Calibrated Timer:               CLK
Pre-Calibration Estimated Rate: 9,451,795
Calibration:                    Always
Asynchronous Clocks:            Available
Time at sim> prompt:            21.716 seconds

PDP-8 clock device is CLK
Calibrated Timer 0:
  Running at:                60 Hz
  Tick Size:                 16.667 msecs
  Ticks in current second:   25
  Seconds Running:           6,998 (1:56:38 hours)
  Calibration Opportunities: 6,998
  Instruction Time:          57562552904
  Real Time:                 3617779280
  Virtual Time:              3617779369
  Next Interval:             1,089
  Base Tick Delay:           141,825
  Initial Insts Per Tick:    16,000
  Current Insts Per Tick:    154,447
  Initializations:           3
  Ticks:                     419,904
  Tick Time:                 1:56:38.383333 hours
  Initialize Base Time:      16:58:31.728
  Tick Start Time:           16:58:31.751
  Wall Clock Time Now:       18:55:31.384

Heinz-Bernd Eggenstein

unread,
Oct 14, 2022, 4:17:23 PM10/14/22
to PiDP-8
This looks a lot like this bug 

https://github.com/simh/simh/issues/815

which was mitigated some time ago with a patch, but perhaps that patch isn't yet in the release you are using.  If you are familiar with software development you could try to apply the patch yourself and rebuild.

(P.S.:  I'm referencing the "old" simh repo so I can ppoint at this specific bug, but note that the Open SIMH project is now hosted here:  https://github.com/open-simh )

Warren Young

unread,
Oct 15, 2022, 5:28:43 AM10/15/22
to PiDP-8
On Friday, October 14, 2022 at 11:59:56 AM UTC-6 andrewjam...@gmail.com wrote:
I'm running the multicore SD card system on a Raspberry Pi 3.

Is it a fresh installation or an upgraded one? If you run pidp8i-sim without arguments, what is the version line emitted at the start?

Your symptom should be prevented by this.. If you're running an old simulator that doesn't understand the THROT_DELAY setting in 0.script, this is why your symptom is happening.

If you do have a throttle delay value set, I can only speculate that it has to be longer due to other configuration changes on your system, such as adding additional background services that drag the Pi's little CPU down longer than our tests predict. Try increasing it.

Warren Young

unread,
Oct 15, 2022, 5:39:11 AM10/15/22
to PiDP-8
On Friday, October 14, 2022 at 2:17:23 PM UTC-6 hbep...@googlemail.com wrote:
This looks a lot like this bug 

https://github.com/simh/simh/issues/815

While that patch was indeed applied after our last stable release, it shouldn't be necessary. The earlier improvement referenced by the README-throttle.doc should suffice.
 
I wouldn't classify this as a "bug" so much as an unfortunate design decision. Quoting that same doc, "SIMH's reaction to not having enough host CPU power to run at the requested IPS rate is to turn off throttling entirely, thus hogging the whole host CPU, exactly the opposite of what you want by turning on throttling!"

The question is, why does the OP's system not have enough spare capacity at the time this decision is made to continue running at 333 kIPS? That's not a strenuous load. Something else is hogging the CPU, leaving insufficient power for the simulator.

If you are familiar with software development you could try to apply the patch yourself and rebuild.

Not necessary. The trunk version is currently based on a version of SIMH v4 2022-01-06, well after that patch went into the upstream tree.

If you want to upgrade beyond that, see tools/simh-update.

(P.S.:  I'm referencing the "old" simh repo so I can ppoint at this specific bug, but note that the Open SIMH project is now hosted here:  https://github.com/open-simh )

All of that drama occurred after I stopped updating SIMH v4 in our tree, so the license conflict doesn't exist in our tree. Even if it did, I don't believe it affects PDP-8 file systems.

My policy, therefore, is that when/if it comes time to do another PiDP-8/I software release, we'll decide how the fork is going at that time, then decide if we're going to rebase on the new project or keep going with the non-conflicted version we have now.

Andrew Herbert

unread,
Oct 15, 2022, 12:14:08 PM10/15/22
to PiDP-8
I made the problem go away by replacing set no throttle by set throttle 333k in boot/0.script.

Andrew

Just for information:

I am running the system distributed as an SD card image on the web site on a Raspberry 3B+.

Prior to tweaking 0.script no modifications had been made to the system.  I have, thus far, only been writing simple programs under OS/8 to explore the various programming languages and utilities available.

I am connecting from a Mac via SSH to the RPi and then using the pidp8i command to start the emulation.

Here is how the system announces itself:

PiDP-8/I release:id[280c662a13] [pi3b] [ils] [stdpcb] [gpio] [rt]

PDP-8 simulator V4.0-0 Current        git commit id: 2f66e74c

Loading OS/8 from the RK05 cartridge disk...


PiDP-8/I release:id[280c662a13] - OS/8 V3D - KBM V3Q - CCL V1F

Configured by pidp8i@raspberrypi on 2021.02.15 at 03:51:25 GMT

If I run ps -u in another window I get this:

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND

pidp8i    1305  0.0  0.3   8272  3548 pts/3    Ss+  Oct14   0:00 /bin/bash

pidp8i    1309  0.0  0.3   8272  3480 pts/4    Ss+  Oct14   0:00 /bin/bash

pidp8i   12304  0.0  0.3   8360  3524 pts/0    Ss   16:40   0:00 -bash

pidp8i   12358  141  0.2  13532  2424 pts/1    Rsl+ 16:40  10:36 /opt/pidp8i/bin/pidp8i-sim /opt/pidp8i/share/boot/0.script

pidp8i   12373  0.0  0.2   8000  2332 pts/0    S+   16:40   0:00 screen -r -S pidp8i

pidp8i   12441  0.1  0.3   8360  3524 pts/2    Ss   16:45   0:00 -bash

pidp8i   12456  0.0  0.2   9788  2512 pts/2    R+   16:48   0:00 ps -u


The figure for pidp8i-sim - 141% seems very high - the simulation is sitting idle at the OS/8 command prompt (dot).


ps -aux shows almost every other process is idle or consuming very little cpu.


After tweaking 0.script and restarting the emulation, show throttle says:

sim> show throttle

Throttle:                      333 kiloinstructions

Throttling by sleeping for:    1 ms every 346 instructions

sim> 

Andrew



Warren Young

unread,
Oct 15, 2022, 12:51:31 PM10/15/22
to PiDP-8
On Saturday, October 15, 2022 at 10:14:08 AM UTC-6 andrewjam...@gmail.com wrote:
The figure for pidp8i-sim - 141% seems very high - the simulation is sitting idle at the OS/8 command prompt (dot).

That is also documented in README-throttle.md. You don't suppose I called those files "README-*" for no good reason, did you?
Reply all
Reply to author
Forward
0 new messages