I learned how to run justme's benchmarking and have done it.
I thought I'd identified places where additional instructions were being executed, and that by returning to the earlier mode of instruction decoding, I'd get back some performance. It looks like my re-merge may not have bought us anything. Indeed it seems to run a teeny bit slower. However, I still need to test the old cycle-accurate code on a non-blinking-light platform.
Below are benchmark logs from 5 tests:
1. Trunk with instruction accurate emulation. Running on a pidp8i with a Pi3b.
Tick Time: 27.05 seconds; Ticks: 1,624; Current Insts Per Tick: 159,514
2. Previous cycle-accurate emulation, most recently from Vince Slyngstad.Running on a pidp8i with a Pi3b.
Tick Time: 62.08 seconds Ticks: 3,726;Current Insts Per Tick: 70,645
3. My reversion to some of the earlier instruction decoding, integrated into cycle-accurate emulation. Running on a pidp8i with a Pi3b.
Tick Time: 64.9; Ticks: 3,895; Current Insts Per Tick: 67,801
4. Trunk with instruction accurate emulation. Running on an M2 Mac. (No gpio)
Tick Time: 2.8 seconds; Ticks: 169; Current Insts Per Tick: 6,293,658
5. My reversion version of cycle-accurate emulation. Running on an M2 Mac. (No gpio)
Tick Time: 3.18 seconds; Ticks: 192; Current Insts Per Tick: 4,107,841
High level analysis:
On a Pi3b, with blinking lights, cycle accurate takes 2 and 1/3 as much time to run the benchmark (64 seconds versus 27 seconds), 2 and a quarter times as many ticks, and runs 40% of the instructions per tick.
On my mac with no blinking lights cycle accurate takes only about 10% more clock time (3.1 seconds versus 2.8 seconds), 12% more ticks, and runs 65% of the instructions per tick.
Conclusions:
Phoning out the additional states to the PiDP-8 gpio introduces significant slowness. However, it must be admitted that it does enable the functionality of single step, which is a real front panel action on nearly all of the PDP-8 Family. (The exception being the PDP-8/a.)
I have come to believe that, if we're not taking the time to phone out additional light state, the overhead of cycle accurate emulation is not all that bad!
I will run the benchmark against the old cycle-accurate code and see if I really did make any improvement.
Detail:
1. The trunk with instruction accurate emulation clocks in as follows:
Script started, file is /home/pi/Bench-2025-06-26-trunk-1.log
pi@pidp8:~/src/pidp8i/trunk $ ./Benchmark1
spawn bin/pidp8i-sim SimStart
PiDP-8/I trunk:id[3fee766e68] [pinctrl I/O] [ils] [stdpcb] [gpio] [rt]
PDP-8 simulator Open SIMH V4.1-0 Current git commit id: ffe537a6
.SET SYS NO INIT
.R P,PASCAL,PRIME1
P8RTS V1-0-F E
P8COM V1-0-F F
NO ERRORS DETECTED.
.R P,PRIME1
P8RTS V1-0-F E
.
Simulation stopped, PC: 01210 (JMP 1207)
sim> show clocks
Minimum Host Sleep Time: 1 ms (1000Hz)
Host Clock Resolution: 1 ms
Execution Rate: 9,570,840 instructions/sec
Calibrated Timer: CLK
Pre-Calibration Estimated Rate: 9,671,179
Calibration: Always
Asynchronous Clocks: Available
PDP-8 clock device is CLK
Calibrated Timer 0:
Running at: 60 Hz
Tick Size: 16.667 msecs
Ticks in current second: 4
Seconds Running: 27 (27 seconds)
Calibration Opportunities: 27
Instruction Time: 249595079
Real Time: 2859048153
Virtual Time: 2859048153
Next Interval: 1,000
Base Tick Delay: 159,514
Initial Insts Per Tick: 8,000
Current Insts Per Tick: 159,514
Initializations: 2
Ticks: 1,624
Tick Time: 27.05 seconds
Initialize Base Time: 00:05:11.319
Tick Start Time: 00:05:11.340
Wall Clock Time Now: 00:05:37.703
----
2. The previous cycle-accurate emulation clocks in as follows:
Script started, file is /home/pi/Bench-2025-06-26-cycle-old-2.log
pi@pidp8:~/src/pidp8i/cycle $ ./Benchmark1
spawn bin/pidp8i-sim SimStart
PiDP-8/I pi5-ils2-bworm-cyclerealistic:id[9de1597bf4] [pinctrl I/O] [ils] [stdpcb] [gpio] [rt]
PDP-8 simulator Open SIMH V4.1-0 Current git commit id: ffe537a6
PiDP-8/I initial throttle = 1000000.000000 IPS
PiDP-8/I initial throttle = 1000000.000000 IPS
.SET SYS NO INIT
.R P,PASCAL,PRIME1
P8RTS V1-0-F E
P8COM V1-0-F F
NO ERRORS DETECTED.
.R P,PRIME1
P8RTS V1-0-F E
.
Simulation stopped, PC: 01210 (JMP 1207)
sim> show clocks
Minimum Host Sleep Time: 1 ms (1000Hz)
Host Clock Resolution: 1 ms
Execution Rate: 4,238,700 instructions/sec
Calibrated Timer: CLK
Pre-Calibration Estimated Rate: 1,648,532
Calibration: Always
Asynchronous Clocks: Available
PDP-8 clock device is CLK
Calibrated Timer 0:
Running at: 60 Hz
Tick Size: 16.667 msecs
Ticks in current second: 6
Seconds Running: 62 (1:02 minutes)
Calibration Opportunities: 62
Instruction Time: 248008054
Real Time: 2858929822
Virtual Time: 2858929822
Next Interval: 1,000
Base Tick Delay: 70,645
Initial Insts Per Tick: 8,000
Current Insts Per Tick: 70,645
Initializations: 2
Ticks: 3,726
Tick Time: 1:02.083333 minutes
Initialize Base Time: 00:02:40.542
Tick Start Time: 00:02:40.547
Wall Clock Time Now: 00:03:39.400
-----
3. My new merge clocks in as follows:
pi@pidp8:~/src/pidp8i/cycle $ date; ./Benchmark1
Thu 26 Jun 2025 12:44:46 AM EDT
spawn bin/pidp8i-sim SimStart
PiDP-8/I pi5-ils2-bworm-cyclerealistic:id[c9676ea6c5] [pinctrl I/O] [ils] [stdpcb] [gpio] [rt]
PDP-8 simulator Open SIMH V4.1-0 Current git commit id: ffe537a6
PiDP-8/I initial throttle = 1000000.000000 IPS
PiDP-8/I initial throttle = 1000000.000000 IPS
.SET SYS NO INIT
.R P,PASCAL,PRIME1
P8RTS V1-0-F E
P8COM V1-0-F F
NO ERRORS DETECTED.
.R P,PRIME1
P8RTS V1-0-F E
.
Simulation stopped, PC: 01210 (JMP 1207)
sim> show clocks
Minimum Host Sleep Time: 1 ms (1000Hz)
Host Clock Resolution: 1 ms
Execution Rate: 4,068,060 instructions/sec
Calibrated Timer: CLK
Pre-Calibration Estimated Rate: 1,653,439
Calibration: Always
Asynchronous Clocks: Available
PDP-8 clock device is CLK
Calibrated Timer 0:
Running at: 60 Hz
Tick Size: 16.667 msecs
Ticks in current second: 55
Seconds Running: 64 (1:04 minutes)
Calibration Opportunities: 64
Instruction Time: 244678496
Real Time: 2861461305
Virtual Time: 2861461307
Next Interval: 1,002
Base Tick Delay: 67,666
Initial Insts Per Tick: 8,000
Current Insts Per Tick: 67,801
Initializations: 2
Ticks: 3,895
Tick Time: 1:04.9 minutes
Initialize Base Time: 00:44:49.971
Tick Start Time: 00:44:49.977
Wall Clock Time Now: 00:45:51.713
4. Trunk on my mac.
Script started, output file is ../Bench-trunk-mac-1.log
The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit
https://support.apple.com/kb/HT208050.
bash-3.2$ cp -p ~/PDP-8/PiDP-8/mkatz-benchmarks/Benchmark/Benchmark.rk05 bin
bash-3.2$ ./Benchmark1
spawn bin/pidp8i-sim SimStart
PDP-8 simulator Open SIMH V4.1-0 Current git commit id: ffe537a6
.SET SYS NO INIT
.R P,PASCAL,PRIME1
P8RTS V1-0-F E
P8COM V1-0-F F
NO ERRORS DETECTED.
.R P,PRIME1
P8RTS V1-0-F E
.
Simulation stopped, PC: 01207 (KSF)
sim> show clocks
Minimum Host Sleep Time: 1 ms (1000Hz)
Host Clock Resolution: 1 ms
Execution Rate: 377,619,480 instructions/sec
Calibrated Timer: CLK
Pre-Calibration Estimated Rate: 43,859,649
Calibration: Always
Asynchronous Clocks: Available
PDP-8 clock device is CLK
Calibrated Timer 0:
Running at: 60 Hz
Tick Size: 16.667 msecs
Ticks in current second: 49
Seconds Running: 2 (2 seconds)
Calibration Opportunities: 2
Instruction Time: 3971965
Real Time: 2862539409
Virtual Time: 2862541138
Next Interval: 1,500
Base Tick Delay: 4,195,772
Initial Insts Per Tick: 8,000
Current Insts Per Tick: 6,293,658
Initializations: 2
Ticks: 169
Tick Time: 2.8 seconds
Initialize Base Time: 01:03:48.864
Tick Start Time: 01:03:48.867
Wall Clock Time Now: 01:03:50.104
sim> bash-3.2$ exit
----
5. My stab at cycle-accurate on my mac:
Script started, output file is ../Bench-cycle-mac-1.log
The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit
https://support.apple.com/kb/HT208050.
bash-3.2$ cp -p ~/PDP-8/PiDP-8/mkatz-benchmarks/Benchmark/Benchmark.rk05 bin
bash-3.2$ ./Benchmark1
spawn bin/pidp8i-sim SimStart
PDP-8 simulator Open SIMH V4.1-0 Current git commit id: ffe537a6
.SET SYS NO INIT
.R P,PASCAL,PRIME1
P8RTS V1-0-F E
P8COM V1-0-F F
NO ERRORS DETECTED.
.R P,PRIME1
P8RTS V1-0-F E
.
Simulation stopped, PC: 01207 (KSF)
sim> show clocks
Minimum Host Sleep Time: 1 ms (1000Hz)
Host Clock Resolution: 1 ms
Execution Rate: 246,470,460 instructions/sec
Calibrated Timer: CLK
Pre-Calibration Estimated Rate: 44,642,857
Calibration: Always
Asynchronous Clocks: Available
PDP-8 clock device is CLK
Calibrated Timer 0:
Running at: 60 Hz
Tick Size: 16.667 msecs
Ticks in current second: 12
Seconds Running: 3 (3 seconds)
Calibration Opportunities: 3
Instruction Time: 237870477
Real Time: 2862502013
Virtual Time: 2862503243
Next Interval: 1,500
Base Tick Delay: 2,738,561
Initial Insts Per Tick: 8,000
Current Insts Per Tick: 4,107,841
Initializations: 2
Ticks: 192
Tick Time: 3.183333 seconds
Initialize Base Time: 01:03:10.037
Tick Start Time: 01:03:10.041
Wall Clock Time Now: 01:03:11.803
sim> bash-3.2$ exit