You use the interrupt mechanism in IAS to schedule interrupts a given number of instructions in the future, optionally repeating after a fixed interval. All time intervals mentioned in this document are in terms of the number of instructions that are executed, since that is the smallest quantum of execution in IAS. The action of taking an emulation-trap is counted as one instruction. Whether you use interrupts or not, the performance impact due to this mechanism is nominal.
IAS maintains all interrupts in a queue. When the time for the earliest enabled interrupt arrives, IAS behaves exactly as if the
pj_irl/pj_nmipins to the picoJava core had been set to a specific value, that is, it resolves the interrupt level through thePSRcontrol bits and so on. Interrupt request levels can vary from 1 to 15 on thepj_irlpins (0 => no interrupt); as a special case, theintrcommands treat anIRLspecification of 0 as being equivalent to scheduling anNMIor asserting thepj_nmipin.If you schedule multiple interrupts at the same time, the one with the highest priority overrides the others, which are effectively lost.
Note - A scheduled interrupt instantly puts the
pj_irlpins to the specifiedIRLvalue: Once set, thepj_irlpin remains at that value until the next change. The only other mechanism of changing thepj_irlpin that is seen by the simulator is a write to theinterrupt_ackaddress, which sets the state ofpj_irlandpj_nmlback to zero.Once you have scheduled a nonrepeating interrupt, it is disabled. You can also explicitly disable a scheduled interrupt. However, you can disable interrupts only, not delete them. This is a known and accepted limitation and will not be fixed.
Currently, the maximum number of interrupts you can schedule is 1,000.
Following are commands for interrupts:
intr listLists all interrupts that are currently scheduled. intr IRL numberSchedules an interrupt number of instructions from now with IRL. intr repeatIRL numberSchedules a repeating interrupt every number of instructions with IRL. intr disable numberCancels a scheduled interrupt. For example:
% intr 2031 2
(Schedule anirl-2 interrupt after 2,031 instructions.)
% intr repeat 1000 5
(Schedule a periodic 1,000-instruction interrupt.)
% intr 2031 1
(Schedule anirl-1 interrupt after 2,031 instructions.)
% intr 3000 0
(Schedule anNMIafter 3,000 instructions.)
% intr list
IAS outputs:
Intr# Enabled Next Intr at IRL Repeating Repeat-frequency 0 Yes 2061 2 No 1 Yes 1030 5 Yes 1000 2 Yes 2061 1 No 3 Yes 3030 NMI No Current instruction count is 30 Next interrupt event (#1) is scheduled at instruction count 1030
% intr disable 2
% intr list
IAS outputs:
Intr# Enabled Next Intr at IRL Repeating Repeat-frequency 0 Yes 2061 2 No 1 Yes 1030 5 Yes 1000 2 No 3 Yes 3030 NMI No Current instruction count is 30 Next interrupt event (#1) is scheduled at instruction count 1030