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_nmi
pins to the picoJava core had been set to a specific value, that is, it resolves the interrupt level through thePSR
control bits and so on. Interrupt request levels can vary from 1 to 15 on thepj_irl
pins (0 => no interrupt); as a special case, theintr
commands treat anIRL
specification of 0 as being equivalent to scheduling anNMI
or asserting thepj_nmi
pin.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_irl
pins to the specifiedIRL
value: Once set, thepj_irl
pin remains at that value until the next change. The only other mechanism of changing thepj_irl
pin that is seen by the simulator is a write to theinterrupt_ack
address, which sets the state ofpj_irl
andpj_nml
back 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 list
Lists all interrupts that are currently scheduled. intr IRL number
Schedules an interrupt number of instructions from now with IRL. intr repeat
IRL numberSchedules a repeating interrupt every number of instructions with IRL. intr disable number
Cancels 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 anNMI
after 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