Electrical computers and digital processing systems: processing – Processing control – Branching
Reexamination Certificate
1998-05-14
2001-04-10
An, Meng-Al T. (Department: 2154)
Electrical computers and digital processing systems: processing
Processing control
Branching
C712S222000
Reexamination Certificate
active
06216222
ABSTRACT:
BACKGROUND OF THE INVENTION
1. Field of the Invention
The present invention relates to techniques for handling exceptions in a data processing apparatus, and in particular to a data processing apparatus and method for handling exceptions in situations where multiple instructions can be executed simultaneously in a plurality of pipelined stages of an execution unit.
2. Description of the Prior Art
In a data processing apparatus, it is known to provide one or more dedicated processing units adapted to perform particular processing tasks. For example, a floating point unit may be provided to perform a particular floating point operation, for example a multiply-accumulate operation. Such dedicated processing units may be part of the main processor, or may be provided within a separate coprocessor.
If the operation to be performed by such a dedicated processing unit can be broken down into a number of separate steps, it is common to provide a number of pipelined processing stages within the processing unit. By such an approach, it is possible for a number of instructions to be executed simultaneously within the processing unit. As an instruction is passed into the pipeline, the processing unit will typically retrieve the source data required for the instruction from a data register file, and on completion of the instruction, will store the data result to a predetermined destination register.
When executing such instructions, it is possible that an exception condition may be detected by the processing unit, and in such a situation it is typically necessary to invoke an exception processing tool to deal with the exception, in order to ensure that an appropriate data result is placed in the destination register.
However, in pipelined architectures, the detection of an exception condition may occur later than required to stop the issue of subsequent instructions into the pipeline. Such instructions must be either completed or restarted. A number of prior art techniques have been proposed for dealing with this problem.
Firstly, the problem can be avoided by ensuring that any instruction entering the pipeline which may give rise to an exception condition is completed before any subsequent instruction is allowed to enter the pipeline. Such an approach was employed in the Motorola MC68881 chip, where the CPU was only permitted to issue a subsequent instruction when the current instruction completed.
An alternative approach is to provide a significant area of memory, referred to as a state frame, in which all intermediate states in the pipeline can be stored as and when required. Thus, if an exception condition is detected, and hence the exception processing tool needs to be invoked to recover from the exception, then the state of all stages of the pipeline can be stored in the state frame, such that the pipeline can be restored to its previous state once the exception processing tool has completed the recovery process. Such an approach was employed in the Motorola MC68040 chip. This approach suffers from the drawback that an instruction, when exceptional, blocks completion of all subsequent instructions currently executing in the pipeline. Further, this technique is significantly more complex than the single issue technique discussed previously, and requires significant time to process a store or load of an exceptional state to or from memory.
A further approach employed in prior art processing units involves the use of a history, or reorder, buffer. The reorder buffer typically stores the entire instruction stream of the data processing apparatus, and has logic arranged to send the instructions to the appropriate processing unit(s) of the data processing apparatus, and to subsequently place in the reorder buffer in association with the instruction the data result determined upon execution of that instruction. As each instruction reaches the bottom of the reorder buffer, it is “retired”, for example by storing the data result in the appropriate destination register. If, however, an exception condition is associated with the instruction being retired, then the exception processing tool is invoked to recover from the exception. Subsequent to the recovery process, the instruction stream is restarted from the instruction immediately following the retired instruction.
Since exception conditions are quite rare, the reorder buffer can provide good performance, although there is clearly a significant performance hit when an exception does occur, since then all subsequent instructions being executed by all processing units (not just the processing unit handling the exceptional instruction) are re-executed. Further, reorder buffers are of significantly greater complexity and greater chip area than either of the two previously discussed techniques.
It is an object of the present invention to provide a data processing apparatus and method which enables more efficient processing of exception conditions in situations where several instructions may be executed simultaneously within a dedicated processing unit.
SUMMARY OF THE INVENTION
Accordingly, the present invention provides a data processing apparatus, comprising: an execution unit comprising a plurality of pipelined stages for executing instructions, such that a maximum of ‘n’ instructions can be being executed simultaneously within the execution unit; a set of at least ‘n’ logical exception registers, each exception register being capable of storing a number of exception attributes associated with an instruction for which an exception has been detected during execution by the execution unit; in the event of an exception being detected during execution of a first instruction, the execution unit being arranged to: (i) store in a first of said exception registers said exception attributes associated with said first instruction; and (ii) to continue executing any remaining instructions already in the pipelined stages at the time the exception was detected, the execution unit further being arranged to store in said exception registers the exception attributes associated with any of said remaining instructions for which an exception is detected during execution; whereby the exception attributes stored in the exception registers can be provided to an exception processing tool for use in recovering from any exceptions occurring during processing of said first instruction and said remaining instructions.
In accordance with the present invention, when an exception is detected, exception attributes associated with the instruction giving rise to the exception are stored in an exception register, and the remaining instructions in the pipelined stages are allowed to continue to be executed. If any of these remaining instructions also give rise to an exception, then the exception attributes associated with those instructions are also stored in exception registers. By this approach, when the exception processing tool is invoked, then it can deal with any exceptions arising from the instructions executed by the pipeline. This has the benefit that, once the exceptions have been dealt with, then the data processing apparatus can continue with the next instruction, without the need to re-execute any of the instructions that were in the pipeline at the time the first exception was detected. Further, any other processing units of the data processing system will not need to re-execute any instructions which were executed after the first exceptional instruction. Additionally, there is not the need to expend significant time storing to memory the state of the pipeline at the time the first exception was detected.
The data processing apparatus has at least ‘n’ logical exception registers for storing exception attributes. These may be ‘n’ physically separate registers, or alternatively be provided as portions of a smaller number of larger physical registers. For example, four 32-bit exception registers could be provided by four separate 32-bit registers or be provided within two 64-bit registers.
The exception processing tool may be provided as part of the data processing a
Elwood Matthew Paul
Hinds Christopher Neal
Jaggar David Vivian
Matheny David Terrence
An Meng-Al T.
ARM Limited
Chang Jung-won
Nixon & Vanderhye P.C.
LandOfFree
Handling exceptions in a pipelined data processing apparatus does not yet have a rating. At this time, there are no reviews or comments for this patent.
If you have personal experience with Handling exceptions in a pipelined data processing apparatus, we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and Handling exceptions in a pipelined data processing apparatus will most certainly appreciate the feedback.
Profile ID: LFUS-PAI-O-2457840