rcornwell / sims

Burroughs B5500, ICL1900, SEL32, IBM 360/370, IBM 7000 and DEC PDP10 KA10/KI10/KL10/KS10, PDP6 simulators for SimH
http://sky-visions.com
95 stars 20 forks source link

KA10: Accept SOJx instructions in the idle loop. #246

Closed larsbrinkhoff closed 3 years ago

larsbrinkhoff commented 3 years ago

WAITS has this null job:

NULJ10: 0
    ROT 0,-1    ; RING AROUND THE ACCUMULATOR
    TLNN 0,200000
    TLC 0,400000
    MOVEI 10,70000
    SOJGE 10,5
    JRST 1
rcornwell commented 3 years ago

Not sure this is correct patch. Any AOJ/SOJ executed in the AC's should trigger idle.

larsbrinkhoff commented 3 years ago

Side note. Foonly F2 has this idle loop:


IFN FTF2,<
NULJP1: 201400,,0               ; CAREFUL NOT TO GET OVER/UNDER FLOWS
        FMPRI 0,201400          ; LOT OF TIME, BUT NOT MEMORY CYCLES
        JRST 1
NULP1X←←.-NULJP1
>;IFN FTF2
larsbrinkhoff commented 3 years ago

Any AOJ/SOJ executed in the AC's should trigger idle.

The mask was 760 which allows AOJ and AOS, so maybe that was not what you intended.

Instruction Opcode Masked with 760
AOJ 340 340
AOS 350 340
SOJ 360 360
SOS 370 360
larsbrinkhoff commented 3 years ago

Using mask 750 catches AOJ and SOJ, but excludes AOS and SOS.

However, WAITS is still not idling. SHOW Q reveals the PMP device is not "idle capable".

larsbrinkhoff commented 3 years ago

I added UNIT_IDLE to PMP, but still using 100% CPU.


sim> show q
KA-10 event queue status, time = 1019326202, executing 27,363,360 cycles/sec
  DCS at 0 (Idle capable)
  PMP unit 1 at 7 (0 usecs) (Idle capable)
  PMP unit 2 at 7 (0 usecs) (Idle capable)
  PMP unit 0 at 7 (0 usecs) (Idle capable)
  CPU unit 0 at 456038 (16.666 msecs) (Idle capable)
  CTY unit 1 at 456038 plus 16666 usecs (33.332 msecs total) (Idle capable)
asynchronous pending event queue
  Empty
asynch latency: 4000 nanoseconds
asynch instruction latency: 109 cycles
rcornwell commented 3 years ago

I would catch AOS/AOJ/SOS/SOJ then. I don't want to make all instructions executed out of registers to be idle checking. It is common to copy stuff to registers and run code out of them.

larsbrinkhoff commented 3 years ago

The PMP device seems to reschedule itself at a very high frequency, so it effectively kills idling.

larsbrinkhoff commented 3 years ago

Ok, changed to mask 740 which allows all of AOJ, AOS, SOJ, and SOS.

rcornwell commented 3 years ago

Not surprising that the PMP device is killing idle. It is tracking the rotation of the disk.

larsbrinkhoff commented 3 years ago

If you really want the skip instructions AOS/SOS, this should be good to go.

rcornwell commented 3 years ago

I put this in another commit. So I am closing this.