![](http://datasheet.mmic.net.cn/290000/XPC801ZP25_datasheet_16187868/XPC801ZP25_99.png)
The PowerPC Core
6-8
MPC801 USER’S MANUAL
MOTOROLA
6
6.2.4 Precise Exception Model Implementation
To achieve maximum performance, many pieces of the instruction stream are concurrently
processed by the core, regardless of the sequence specified by the executing program.
Instructions execute in parallel and are completed out of order. The hardware works hard to
ensure that this out-of-order operation never has any effect besides the one specified by the
program. This is most difficult to safeguard when an interrupt occurs after instructions that
logically follow the faulting instruction or have already completed. At the time of an interrupt,
the machine state becomes visible to other processes and, therefore, must be in the
appropriate architecturally specified condition. The core takes care of this in the hardware
by automatically backing up the machine to the instruction that caused the interrupt. By
doing it, the core implements a precise exception model. This is, of course, assuming the
instruction that caused the exception has not already begun when the interrupt occurs.
To recover from an interrupt, a history buffer is used. This buffer is a FIFO queue that
records the relevant machine state at the time of each instruction issue. When issued,
instructions are placed on the tail of the queue and they percolate to the head of the queue
while they are executing. Instructions remain in the queue until they finish executing and all
preceding instructions have completed to a point where no exception can be generated. In
the core, such a condition is fulfilled by waiting for full completion. In the event of an
exception, the machine state necessary to recover the architectural state is available. As
instructions finish executing, they are released (retired) from the queue and the buffer
storage is reclaimed for new instructions entering the queue.
Table 6-2. “Before” and “After” Interrupts
INTERRUPT TYPE
INSTRUCTION
TYPE
BEFORE /
AFTER
CONTENTS OF SRR0
Hard Reset
Any
NA
Undefined
System Reset
Any
Before
Next Instruction to Execute
Machine Check Interrupt
Any
Before
Faulting Instruction
Implementation Specific Instruction / Data TLB Miss / Error Interrupts
Any
Before
Faulting Fetch or Load/Store
Other Asynchronous Interrupts (Noninstruction Related Interrupts)
Any
Before
Next Instruction to Execute
Alignment Interrupt
Load / Store
Before
Faulting Instruction
Privileged Instruction
Any Privileged
Instruction
Before
Faulting Instruction
Trap
tw, twi
Before
Faulting Instruction
System Call Interrupt
sc
After
Next Instruction to Execute
Trace
Any
After
Next Instruction to Execute
Debug I- Breakpoint
Any
Before
Faulting Instruction
Debug L- Breakpoint
Load / Store
After
Faulting Instruction + 4
Implementation Dependent Software Emulation Interrupt
NA
Before
Faulting Instruction
Floating Point Unavailable
Floating Point
Before
Faulting Instruction